Skip to content

almightymoon/terraform-aws-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform AWS Platform

Modular, production-grade AWS infrastructure as code with GitHub Actions CI/CD.

Terraform CI License: MIT

What This Is

A reusable Terraform platform for AWS that demonstrates DevOps best practices:

  • Modular design — VPC, EKS, RDS, and IAM as composable modules
  • Environment separationdev / staging / prod via workspaces
  • Remote state — S3 backend with DynamoDB locking
  • CI/CDterraform fmt, validate, plan on PR; apply on merge
  • Security — Least-privilege IAM, encrypted state, no hardcoded secrets

Architecture

┌─────────────────────────────────────────────────────────┐
│                      AWS Account                        │
│  ┌──────────┐   ┌──────────┐   ┌──────────────────┐    │
│  │   VPC    │──▶│   EKS    │──▶│  App Workloads   │    │
│  │ 3 AZs    │   │ Cluster  │   │  (via GitOps)    │    │
│  └────┬─────┘   └──────────┘   └──────────────────┘    │
│       │                                                 │
│  ┌────▼─────┐   ┌──────────┐   ┌──────────────────┐    │
│  │   RDS    │   │   S3     │   │  IAM / IRSA      │    │
│  │ Postgres │   │  State   │   │  Roles           │    │
│  └──────────┘   └──────────┘   └──────────────────┘    │
└─────────────────────────────────────────────────────────┘

Quick Start

# Bootstrap remote state (one-time)
cd bootstrap && terraform init && terraform apply

# Deploy dev environment
cd environments/dev
terraform init
terraform plan
terraform apply

Project Structure

terraform-aws-platform/
├── bootstrap/          # S3 + DynamoDB for remote state
├── modules/
│   ├── vpc/            # VPC, subnets, NAT, IGW
│   ├── eks/            # EKS cluster + node groups
│   ├── rds/            # PostgreSQL RDS
│   └── iam/            # IRSA roles, CI/CD roles
├── environments/
│   ├── dev/
│   ├── staging/
│   └── prod/
└── .github/workflows/

Modules

Module Resources Purpose
vpc VPC, subnets, NAT, route tables Network foundation
eks EKS cluster, node groups, add-ons Container orchestration
rds PostgreSQL, security groups Managed database
iam IRSA roles, OIDC provider Workload identity

CI/CD

Event Action
Pull Request fmt check, validate, plan (comment on PR)
Merge to main apply to dev
Tag v* apply to staging/prod (manual approval)

Requirements

  • Terraform >= 1.7
  • AWS CLI configured
  • S3 bucket for remote state (created by bootstrap)

License

MIT © almightymoon

About

Modular AWS infrastructure as code with Terraform — VPC, EKS, RDS, and GitHub Actions CI

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages