All projects
Terraform Self-Learn
- Terraform
- AWS
- VPC
- EC2
- RDS
- S3
The problem
Infrastructure built by hand in a console cannot be reviewed, versioned or rebuilt reliably — the structure of the environment lives only in whoever built it.
The goal
Describe a complete environment — network, compute, database and storage — as code, so it can be created, reviewed and destroyed repeatably.
The architecture
- VPC — Virtual Private Cloud
- Public subnet hosting EC2
- Second database subnet
- Database subnet group for RDS placement
- RDS — Relational Database Service
- Security groups controlling traffic between tiers
- S3 — Simple Storage Service
AWS ├── VPC │ ├── Public Subnet │ │ └── EC2 │ └── Database Subnet │ └── RDS ├── DB Subnet Group ├── Security Groups └── S3
My approach
Build the network first, then place compute and the database inside it, keeping the subnet split and security group rules explicit in code.
Implementation
- Terraform configuration covering VPC, subnets and routing
- EC2 in the public subnet behind security groups
- Database subnet group with RDS in its own subnet
- S3 storage defined alongside the rest of the environment