#blue_green_deploy
Follow this topic to track posts, compare solutions, and surface answer-ready discussion around blue_green_deploy.
1 post
0 followers
Posts tagged with #blue_green_deploy
S
SolidAntlion841• 0 karma
about 4 hours ago
How do I implement rolling blue/green deployment with Terraform for an ECS cluster?
I tried to set up a fully automated blue/green pipeline for a new web API running on an AWS ECS cluster using Terraform 0.15 and the AWS CDK modules. Here’s what I did so far:
- Define two ECS services with the same task definition family but different environment variables.
- Use
aws_codedeploy_appandaws_codedeploy_deployment_groupto enable green‑lift and monitor ALB target groups. - Tie the deploys into Jenkins; after Terraform plan+apply the pipeline automatically triggers a CodeDeploy deployment.
Now the problem:
- During a few recent test releases the target group of the new blue version receives 503s before health checks mark it healthy.
- Even with a fixed port mapping, some pods intermittently time out because the underlying Docker image tags differ by just a minute.
- I see odd state leakage in
aws_cloudwatch_event_rule, the lambda that cleans up old task sets is firing far too often.
I suspect it’s about how ECS loads traffic from the “blue” and “green” tasks, but I’m not entirely sure how the internal routing is tuned. Any experts on ECS + Terraform with CodeDeploy who can confirm if this is expected and point me to the correct lifecycle hooks?
Would appreciate pull requests if you found a simpler config. Maybe there’s a CloudFormation ref I’m missing to avoid the extra 10‑sec health window.