Skip to content

nanlabs/terraform-aws-modules

๐Ÿš€ NaN Labs' Terraform AWS Modules

Deploy Production Infrastructure in Minutes, Not Months

Terraform AWS Kubernetes License: MIT GitHub Stars

๐Ÿ”ฅ Battle-tested โ€ข ๐Ÿ”’ Security-first โ€ข ๐Ÿ’ฐ Cost-optimized โ€ข ๐Ÿš€ Developer-friendly

From MVP to Enterprise: Infrastructure that scales with your business


๐Ÿงญ TL;DR

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 apply

Need something bigger? Jump to the example catalog or full module list below.

โœจ Why These Modules?

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.

๐ŸŽช Examples

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.

๐ŸŽฏ Motivation

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.

๐Ÿ“ฆ Modules Overview

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
โœˆ๏ธ AWS Transit Gateway 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

Other Cloud Providers

Module Description Use Cases
๐Ÿƒ MongoDB Atlas Cluster Managed multi-cloud MongoDB Global & serverless data

๐Ÿš€ Quick Module Usage

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).

๐ŸŽฏ Ready to Get Started?

๐Ÿš€ 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! โญ

๐Ÿค Contributing

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.

๐ŸŒŸ Ways to Contribute

  1. Star this repo - It helps others discover these modules
  2. Share your experience - Write a blog post or tweet about your usage
  3. Submit feedback - Open issues with suggestions or bug reports
  4. Code contributions - Submit PRs for new features or fixes
  5. Documentation - Help improve guides and examples

๐Ÿ“š Documentation

๐Ÿ“– 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

๐Ÿ“š Additional Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Contributors

Contributors

Made with contributors-img.


๐ŸŒŸ Built with โค๏ธ by NaN Labs

Website LinkedIn

๐Ÿš€ Accelerating development through proven technology solutions

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •