Problem
Infrastructure was clicked together in the console — no history, no review, and state living on a laptop.
Solution
Modularised VPC, EC2 and IAM into Terraform modules with a remote S3 backend (versioning + encryption) and DynamoDB state locking, plus plan output posted on pull requests before apply.
Architecture
- 01Modules: network (VPC/subnets/SG), compute (EC2), identity (IAM)
- 02Remote state: encrypted S3 bucket + DynamoDB lock table
- 03terraform plan on PR → manual approval → apply