What is created
- ECS cluster (via
modules/cluster) with Fargate and Fargate Spot capacity providers - ECS service (via
modules/service) with:- FluentBit sidecar for log forwarding to Kinesis Firehose
- Blue/green deployment with 2-minute bake time
- ECS Exec enabled for debugging
- ALB integration with two target groups
- Service Connect
- Application Load Balancer
- VPC with 3 AZs
Code
- Cluster
- Service
Key highlights
- Separate sub-modules: The cluster and service are managed independently. This allows teams to manage the cluster and services in separate Terraform workspaces.
- Blue/green deployment:
strategy = "BLUE_GREEN"with a 2-minute bake period before traffic shifts. - ECS Exec:
enable_execute_command = trueallows interactive shell access to running containers. - FireLens to Firehose: Logs are forwarded from FluentBit to a Kinesis Firehose delivery stream.
Complete Example
Full example with EC2 ASG, predictive autoscaling, and advanced ALB configuration.
Fargate Guide
Learn more about Fargate capacity provider configuration.

