π₯ Battle-tested β’ π Security-first β’ π° Cost-optimized β’ π Developer-friendly
From MVP to Enterprise: Infrastructure that scales with your business
Deploy production-grade AWS building blocks fast with battle-tested Terraform modules (secure defaults, full customization, clear docs).
# Try the smallest stack (~$46/mo)
git clone https://github.com/nanlabs/terraform-aws-modules.git
cd terraform-aws-modules/examples/simple-web-app
terraform init && terraform applyNeed something bigger? Jump to the example catalog or full module list below.
Secure by default, production-proven, cost-aware, and fully overridable. Built to scale from MVP to multi-account enterprise without rewriting your Terraform.
Show feature matrix
- π‘οΈ Reliability: MultiβAZ patterns, zeroβdowntime friendly changes, safe defaults that avoid accidental data loss.
- π Security: KMS encryption everywhere, leastβprivilege IAM surfaces, GitHub OIDC (keyless CI), optional CloudTrail + Config integration.
- π° Cost Awareness: Rightβsized defaults, optβin NAT / Transit Gateway, lifecycle policies for cold data, no hidden alwaysβon extras.
- π Observability: VPC Flow Logs ready, log/metrics hooks, consistent naming for tracing & tagging, surfaces for future dashboards.
- π§ͺ Developer Experience: Consistent variable names, βcomplete wrapperβ philosophy, rich runnable examples, autoβgenerated docs.
- π§© Extensibility: All upstream module variables & outputs exposed, composable building blocks, feature flags instead of forks.
Pick a starting point:
| Tier | Example | What You Get | Est. Cost* |
|---|---|---|---|
| Starter | π Simple Web App | Minimal VPC + one compute entrypoint (low cost) | ~$46 |
| Growth | βοΈ Medium Complexity | EKS + RDS + Bastion (microservices base) | ~$300 |
| Enterprise | π’ Complete Enterprise | Full platform: multi-AZ network, EKS, RDS (HA), MSK, TGW | ~$940 |
Need data / security / networking patterns? See the expanded catalog.
Full example catalog (with costs & focus areas)
| Example | Core Services | Focus | Est. Cost* |
|---|---|---|---|
| π Simple Web App | VPC + minimal compute | MVP / quick start | ~$46 |
| βοΈ Medium Complexity | VPC, EKS, RDS, Bastion | Microservices staging | ~$300 |
| π’ Complete Enterprise | VPC (multi-AZ), EKS, RDS (HA), MSK, TGW, encryption | Production foundation | ~$940 |
| π Secure Multi-Environment Data Platform | CloudTrail, Config, Data Lake, Glue, KMS | Compliance & governance | ~$420 |
| π°οΈ Hub & Spoke Networking | Transit Gateway + multi-VPC | Segmentation / org networking | ~$160 |
| π Analytics + Document Store | Data Lake, DocumentDB, MSK, Glue | Hybrid analytics (structured + doc) | ~$780 |
| π Data Processing Pipeline | Data Lake, Glue Jobs + Workflow | Batch ETL / curation | ~$180 |
| π§© Multi-Account Data Platform (Simulated) | Central KMS, TGW, Data Lake, Glue, Bastion | Multi-account pattern | ~$210 |
*Estimates at authoring time, us-east-1 on-demand, minimal throughput. Validate with AWS Pricing Calculator / Infracost before production.
Tip
New here? Jump to the Usage Guide or scan the modules below.
Building and maintaining infrastructure across cloud providers can become repetitive and error-prone. This repository consolidates reusable Terraform modules following best practices, allowing your team to provision infrastructure efficiently, securely, and consistentlyβwhether it's an AWS VPC, a Kubernetes cluster, or a MongoDB Atlas database.
Highly opinionated wrappers around official modulesβsimple defaults, full override capability.
Categories:
- Network & Access: VPC, Bastion, Transit Gateway (+ Spokes), Shared Networking
- Compute & Orchestration: EKS, Amplify
- Data & Analytics: RDS / Aurora, MSK, DocumentDB, Data Lake infra & encryption, Glue suite
- Security & Governance: CloudTrail, Config, GitHub OIDC, TF State Backend
- Multi-Cloud: MongoDB Atlas
Show full module catalog
| Module | Description | Use Cases |
|---|---|---|
| π AWS VPC | VPC with subnets, flow logs, sane defaults | Network foundation, multi-AZ setup |
| β‘ AWS EKS | Managed Kubernetes + addons wrapper | Microservices, container orchestration |
| ποΈ AWS RDS | Relational DB (backups, monitoring) | Application persistence |
| ποΈ AWS RDS Aurora | High-performance Aurora cluster | HA & read scaling |
| π¨ AWS MSK | Managed Kafka (secure & multi-AZ) | Event streaming, pipelines |
| π° AWS Bastion | SSM-based secure jump host | Admin access, troubleshooting |
| π AWS DocumentDB | MongoDB-compatible document store | Flexible JSON workloads |
| π€ AWS IAM Role | Opinionated IAM role creation | Least-privilege access |
| π AWS Amplify App | Frontend hosting & CI/CD | Static & SPA delivery |
| π AWS CloudTrail | Central activity logging | Audit & compliance |
| π‘οΈ AWS Config | Resource config tracking & rules | Governance & drift detection |
| π§± AWS Data Lake Encryption | Central KMS (S3 + Glue keys) | Unified encryption & rotation |
| ποΈ AWS Data Lake Infrastructure | Medallion S3 layout scaffold | Bronze/Silver/Gold zoning |
| 𧬠AWS Glue Code Registry | Schema/code registry | ETL governance |
| π AWS Glue Data Lake Catalog | Catalog databases / tables | Metadata discovery |
| π οΈ AWS Glue Jobs | Map-based multi Glue jobs | Batch / Spark ETL |
| π AWS Glue Workflow | Workflow & trigger orchestration | Chained ETL processes |
| Central routing hub | Multi-VPC topology | |
| π°οΈ AWS Transit Gateway Spoke | VPC attachment wrapper | Hub & spoke expansion |
| πΈοΈ AWS Shared Networking | Shared services networking layer | Central endpoints & DNS |
| π¦ AWS TF State Backend | S3 + DynamoDB state backend | Remote state & locking |
| π AWS GitHub OIDC Provider | OIDC federation for CI | Keyless deployments |
| Module | Description | Use Cases |
|---|---|---|
| π MongoDB Atlas Cluster | Managed multi-cloud MongoDB | Global & serverless data |
Each module is designed to be plug-and-play with sensible defaults, yet highly customizable for complex requirements.
module "vpc" {
source = "git::https://github.com/nanlabs/terraform-aws-modules.git//modules/aws-vpc?ref=v0.2.0"
vpc_cidr = "10.0.0.0/16"
# That's it! VPC with best practices is ready π
}π See the Usage Guide for advanced patterns (version pinning, multi-account, remote state, KMS sharing).
| π Quick Start | π Learn More | π€ Get Help |
|---|---|---|
| Browse Examples | Read Documentation | Join Discussions |
| Pick an example that fits your needs | Understand best practices | Ask questions, share ideas |
β If this project helps you, please consider giving it a star! β
We love contributions! Whether you're:
- π Reporting bugs or suggesting improvements
- π Improving documentation or adding examples
- π Adding new modules or enhancing existing ones
- π‘ Sharing ideas for new features
Every contribution matters! Check our Contributing Guidelines to get started.
- Star this repo - It helps others discover these modules
- Share your experience - Write a blog post or tweet about your usage
- Submit feedback - Open issues with suggestions or bug reports
- Code contributions - Submit PRs for new features or fixes
- Documentation - Help improve guides and examples
| π Guide | π― Purpose |
|---|---|
| π Usage Guide | Complete module usage, versioning, and advanced patterns |
| π οΈ Development Setup | Set up your development environment |
| π¦ Modules Guide | How to use and create modules |
| β Best Practices | Module design, security, and guidelines |
| π Versioning Strategy | Release management and versioning |
| π GitHub Actions | CI/CD workflows and automation |
| π€ Contributing | How to contribute to this repository |
- π Awesome NAN - Best practices and resources
- π Terraform Documentation - Official Terraform docs
- βοΈ AWS Provider Documentation - AWS provider reference
- π¬ NaN Labs Blog - Technical articles and insights
This project is licensed under the MIT License - see the LICENSE file for details.
Made with contributors-img.
π Built with β€οΈ by NaN Labs
π Accelerating development through proven technology solutions