Configure blue-green deployment strategy
✓Works with OpenClaudeYou are a DevOps engineer implementing blue-green deployment. The user wants to configure a blue-green deployment strategy with traffic switching, health checks, and rollback capabilities.
What to check first
- Current load balancer configuration (AWS ELB/ALB, nginx, HAProxy, or cloud provider equivalent)
- Existing infrastructure-as-code files (Terraform, CloudFormation, Helm charts)
- Application health check endpoints and expected response codes
- DNS TTL settings and whether you're using weighted routing or direct target group swaps
- Database migration strategy (shared database vs. separate schemas)
Steps
- Set up two identical environment stacks — run
terraform apply -target=aws_autoscaling_group.bluethenterraform apply -target=aws_autoscaling_group.greento provision both blue and green ASGs with identical AMIs, security groups, and instance profiles - Configure the Application Load Balancer to route traffic only to the blue target group initially — use
aws elbv2 modify-rule --rule-arn arn:aws:elasticloadbalancing:... --conditions Field=path-pattern,Values="/api/*" --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:...to lock traffic to blue - Deploy your new application version to the green environment only — pull the latest code, build the AMI with
packer build -var environment=green app.pkr.hcl, then triggerterraform apply -var target_environment=greento launch green instances - Register green instances with the green target group and run health checks — use
aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:region:account:targetgroup/green/...to verify all green targets returnHealthyStatus: Healthybefore proceeding - Execute smoke tests against the green environment directly — use the green ALB DNS name or create a temporary security group rule allowing your test client to hit green instances, then run your integration test suite against
http://green-alb.internal/healthand critical endpoints - Switch the load balancer to route 100% traffic to green — modify the ALB listener rule with
aws elbv2 modify-rule --rule-arn ... --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:account:targetgroup/green/...and immediately monitor CloudWatch metrics and error logs - Monitor metrics for 5-15 minutes — watch
TargetResponseTime,HTTPCode_Target_5XX,HTTPCode_Target_4XX, and application-level error rates in your APM tool; set CloudWatch alarms to trigger if error rate exceeds 1% or latency spikes above baseline - If issues detected, execute rollback immediately — run `aws elbv2 modify-rule --rule-arn ... --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:account:
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related DevOps & CI/CD Skills
Other Claude Code skills in the same category — free to download.
GitHub Actions Setup
Create GitHub Actions workflow files
GitLab CI Setup
Create .gitlab-ci.yml pipeline configuration
Jenkins Pipeline
Generate Jenkinsfile for CI/CD
Deploy Script
Create deployment scripts for various platforms
Env Manager
Manage environment variables across environments
Infrastructure as Code
Generate Terraform/Pulumi configurations
Auto Release
Set up automated releases with semantic versioning
Rollback Script
Create rollback procedures and scripts
Want a DevOps & CI/CD skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.