Terraform monorepo building experience
Recently I took a Next.js project from “source code in a repo” to a fully automated delivery path on AWS: CodeCommit → CodePipeline/CodeBuild → ECS (behind an existing ALB), provisioned with Terraform. I made some decisions regarding the architecture: remote state in S3, a centralized Terraform repository, dev/prod separation, IAM aligned with repository layout, and a practical approach to environment variables across build-time and ECS runtime. I used S3 with versioning enabled and tight bucket policies to store Terraform state. This is boring infrastructure, and that’s the point: it prevents high-cost incidents later. ...