In-place and blue/green deployments

Automating Deployments on AWS

Dunieski Otano

Amazon Web Services Solutions Architect

The 2 AM outage

2.00

  • All-at-once deploy goes wrong
  • Every server runs the broken version
  • Customers see errors for an hour
  • Rollback takes another full deploy
Automating Deployments on AWS

Why deployment strategy matters

2.1

  • A bad release can take a service down
  • All-at-once = fastest, riskiest
  • Gradual rollout = slower, safer
  • The strategy controls blast radius if it fails
Automating Deployments on AWS

In-place deployments

in-place

  • Deploy onto the same instances that serve traffic
  • One batch at a time: half, then half; or one by one
  • Health-check each batch before moving on
  • Cheap; no extra infrastructure needed
Automating Deployments on AWS

Blue/green deployments

  • Blue = current production fleet
  • Green = brand-new fleet with the new version
  • Load balancer shifts traffic from blue to green
  • Old fleet stays available for fast rollback

blue-green

Automating Deployments on AWS

Lambda and ECS are blue/green by design

  • Lambda: traffic shifts via alias version pointer
  • ECS: traffic shifts via replacement task set
  • No EC2-style fleet duplication required
  • You still pick a deployment configuration

ecs

Automating Deployments on AWS

Choosing in-place vs. blue/green

  • Tight budget, low-risk patch → in-place
  • Need zero downtime or instant rollback → blue/green
  • Single legacy server → in-place is the only option
  • Lambda or ECS → blue/green is built in

decide

Automating Deployments on AWS

Rollback in CodeDeploy

rollback

  • Rollback = redeploy the previous successful revision
  • Trigger automatically on deployment failure
  • Trigger automatically on CloudWatch alarm
  • Blue/green rollback: flip the load balancer back
Automating Deployments on AWS

Let's practice!

Automating Deployments on AWS

Preparing Video For Download...