Multi-environment AWS infrastructure as code
A reusable Terraform module library and environment definitions for containerised services on AWS, deployed through pull-request plans and branch-based applies.
The challenge
Teams running several microservices across dev, pre-production and production often hand-build cloud resources, which leads to drift between environments and slow, risky changes. Cost control for non-production environments is usually an afterthought.
What we built
The repository provides modules for VPC, ECS on Fargate, load balancers, API Gateway, DocumentDB, DynamoDB, ElastiCache, RabbitMQ, SQS, S3 hosting, ACM and VPN. Separate service folders compose these for dev, mock, ops, pre-prod and prod, with remote state held in S3 and locked through DynamoDB. GitHub Actions runs plans on pull requests and applies on merge to the develop branch, and pre-commit hooks enforce formatting. A Lambda-based start and stop module lets non-production ECS services be scaled down on a schedule.
Key capabilities
- Reusable modules for networking, compute, data stores, messaging and edge
- Per-environment compositions for dev, mock, ops, pre-prod and prod
- Remote state with locking
- Pull-request plan and branch-based apply workflows
- Scheduled ECS start and stop for non-production cost control
What it delivers
- Environments are built from the same modules, which reduces drift between them
- Infrastructure changes are reviewed as plans before they are applied
- Non-production compute can be stopped outside working hours
- New services reuse existing modules instead of bespoke resource definitions
Have a similar backlog?
Most of our work started as a single painful workflow. Tell us yours.


