AWS Certified Developer – Associate (DVA-C02)DeploymentHard

A developer needs to deploy a new version of an application to an Auto Scaling group of EC2 instances. They want to ensure that the deployment process updates instances one by one, replacing them with new instances running the updated application, while maintaining application availability. The old instances should be terminated only after the new instances are successfully launched and registered with the load balancer. Which CodeDeploy deployment type, combined with an Auto Scaling group, achieves this goal most efficiently?

  1. ABlue/Green deployment
  2. BIn-place deployment
  3. CLinear deployment
  4. DAll-at-once deployment
Show answer & explanation

Correct answer: A. Blue/Green deployment

Blue/Green deployment with CodeDeploy on an Auto Scaling group ensures that an entirely new set of instances with the updated application is launched and fully validated before traffic is shifted from the old environment. This maintains availability and allows for easy rollback if issues arise, matching the requirement of replacing old instances with new ones after successful launch and registration.

Why the other options are wrong

  • B. In-place deployment updates instances directly, leading to downtime or reduced capacity during updates on each instance.
  • C. Linear deployment is a traffic-shifting strategy, but Blue/Green specifically addresses replacing instances and maintaining availability with a new environment.
  • D. All-at-once deployment updates all instances simultaneously, causing significant downtime or service disruption.

CodeDeploy Blue/Green with ASG

AWS CodeDeploy's Blue/Green deployment strategy, when used with an Auto Scaling group, involves launching a new set of instances ('Green' environment) with the updated application, shifting traffic from the 'Blue' (old) environment to 'Green' after validation, and then terminating the 'Blue' instances. This ensures zero-downtime deployments and easy rollback.

  • Launches new instances for new version.
  • Shifts traffic after full validation.
  • Maintains application availability (zero downtime).
  • Easy rollback to the old environment.
  • Ideal for Auto Scaling groups and load balancers.

Memory trick: Blue/Green is the graceful switch, new instances, no glitch.

More Deployment questions