This repository contains the infrastructure-as-code (IaC) setup using Terraform to deploy a complete AWS environment, including VPC, EKS (Kubernetes), RDS database, and DNS.
Bank-Infrastructure/
├── environments/
│ ├── dev/ # Development deployment root
│ │ ├── main.tf
│ │ ├── provider.tf
│ │ ├── variables.tf
│ │ └── terraform.tfvars
│ └── prod/ # Production deployment root
│ ├── main.tf
│ ├── provider.tf
│ ├── variables.tf
│ └── terraform.tfvars
├── module-database/ # Terraform module to deploy RDS MySQL
├── module-dns/ # Terraform module for Route53 DNS records
├── module-eks/ # Terraform module to deploy EKS cluster and tooling
├── module-vpc/ # Terraform module to provision VPC and networking
├── .gitignore # Ignore local state, secrets, and temp files
├── backend.tf # Optional shared backend config for root workspace
├── main.tf # Existing root entry point (not used by env roots)
├── output.tf # Existing root outputs
├── readme.MD # This file
├── terraform.tfvars # Existing shared tfvars file
└── variable.tf # Existing shared variables fileRun Terraform from the environment folder you want to deploy:
cd environments/dev && terraform initcd environments/prod && terraform init
Each environment folder provides its own input values via terraform.tfvars and sets environment = "dev" or environment = "prod".
The shared modules are:
module-vpc/for VPC, subnets, NAT gateways, and network securitymodule-eks/for EKS cluster, node group, IAM roles, Helm chartsmodule-dns/for Route53 hosted zone and DNS recordsmodule-database/for RDS MySQL deployment
This deployment creates the following AWS resources:
- VPC with public subnet -frontend, private subnet - backend, and private subnet -database
- Internet Gateway and NAT Gateways
- Public and private route tables with associations
- Security group for MySQL access
- EKS cluster with managed node group
- IAM roles and policies for EKS cluster and worker nodes
- Helm-deployed NGINX ingress controller
- Route53 hosted zone and DNS records for application hostnames
- RDS MySQL instance with DB subnet group
Do not commit sensitive values such as:
db_usernamedb_password- any local tfstate files
- any
.envor private key files
The repo .gitignore already excludes:
.terraform/.terraform.lock.hcl*.tfstate*.tfstate.backup*.pem*.key.env
prodis the production environment.devis the development environment.- Both env roots reuse the same modules but with separate configuration values.
