Back to Lessons

AWS CodeDeploy Deployment

April 5, 2026

Automated Application Deployments

Deploy to EC2, Lambda, ECS, on-premises from Git/CodePipeline.

Deployment Strategies

EC2 Deployment Groups:
- In-place (instance reboot)
- Blue/Green (traffic shift)
- Canary (10% batch)
- Linear (20% every 5min)

Lambda Deployment:
Code zip upload + alias/version management
Gradual traffic shift (canary)

ECS Deployment:
Blue/Green (CodeDeploy + ALB)
External (task definition update)

appspec.yml:
version: 0.0
Files:
- Source: /target/app.jar
  Destination: /var/www
Hooks:
- BeforeInstall: validateService.sh

Rollbacks

  • Automatic on health check failure
  • Manual rollback to previous version
  • CloudWatch alarms trigger