Reusable, opinionated Terraform modules to provision a production-ready AWS stack: VPC networking, an EKS cluster with autoscaling node groups, and an RDS database.
Spinning up the same VPC → EKS → RDS foundation for every project is repetitive and error-prone. These modules encode sane defaults (private subnets, autoscaling, HPA-ready, least-privilege IAM) so a new environment is a few lines of HCL.
| Module | What it provisions | Docs |
|---|---|---|
vpc |
VPC, public/private subnets, NAT, route tables | modules/vpc |
eks |
EKS control plane + managed node groups with cluster autoscaler IAM | modules/eks |
rds |
RDS PostgreSQL instance, subnet group, security group | modules/rds |
module "vpc" {
source = "github.com/AntoniRomera/terraform-aws-modules//modules/vpc"
name = "demo"
cidr = "10.0.0.0/16"
azs = ["eu-west-1a", "eu-west-1b"]
}
module "eks" {
source = "github.com/AntoniRomera/terraform-aws-modules//modules/eks"
cluster_name = "demo"
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnet_ids
node_groups = {
default = { instance_types = ["t3.medium"], min_size = 1, max_size = 5, desired_size = 2 }
}
}flowchart TB
VPC[VPC + subnets] --> EKS[EKS cluster + autoscaling nodes]
VPC --> RDS[(RDS database)]
EKS --> HPA[HPA-ready workloads]
| Example | What it shows |
|---|---|
examples/full-stack |
Wires VPC + EKS + RDS together into a complete environment. Copy terraform.tfvars.example to terraform.tfvars to customize. |
examples/remote-state |
Consumes the modules with an S3 + DynamoDB remote backend. The bootstrap/ subdir provisions the state bucket and lock table first. |
- Terraform >= 1.5.0 (CI pins 1.9.8)
- AWS provider
>= 5.40, < 6.0(plustls >= 4.0for EKS IRSA andrandom >= 3.5for RDS) - Configured AWS credentials (use a profile or OIDC — never hardcode keys). See
.env.examplefor the environment variables a realplan/applyexpects.
A Makefile wraps the common workflows. Formatting, validation, and linting all run offline (-backend=false, no AWS credentials required):
make fmt-check # fail if any HCL is unformatted
make validate # terraform init + validate across modules + examples
make examples-validate # init + validate the examples/ configurations only
make lint # tflint with .tflint.hcl
make test # fmt-check + validate (CI test entrypoint)tflint is configured via .tflint.hcl with the recommended Terraform ruleset plus snake_case naming, documented-variables/outputs, and required-version/providers rules.
.github/workflows/ci.yml runs on every push and pull request to main:
make fmt-check— formatting gatemake validate—terraform init -backend=false+validatefor all modules and examplesmake lint—tflint
No AWS credentials are needed in CI because every step runs with -backend=false.
- Remote state example (S3 + DynamoDB lock) — see
examples/remote-state/ -
examples/folder with a full stack — seeexamples/full-stack/ - CI plan/validate with
tflint—.tflint.hcl+make validate lint, wired into.github/workflows/ci.yml
MIT © 2026 Antoni Romera Luis