AWS Certified DevOps Engineer – ProfessionalSDLC AutomationMedium

A development team is using AWS CodePipeline to automate their software releases. They have a stage that deploys an application to an Amazon EC2 Auto Scaling group. The team wants to ensure that new deployments are only considered successful if the application passes a suite of health checks and is serving traffic correctly before terminating old instances. Which deployment strategy should they implement to achieve this with minimal downtime and automatic rollback capabilities?

  1. AAll-at-once deployment followed by a Lambda function to monitor application health.
  2. BBlue/Green deployment using AWS CodeDeploy with a load balancer and health checks.
  3. CRolling update with a manual approval step after new instances come online.
  4. DIn-place deployment with a pre-traffic hook to run health checks.
Show answer & explanation

Correct answer: B. Blue/Green deployment using AWS CodeDeploy with a load balancer and health checks.

Blue/Green deployments, facilitated by AWS CodeDeploy, are ideal for minimizing downtime and providing automatic rollback. By using a load balancer and health checks, traffic is shifted to the new 'green' environment only when it's fully operational, and the old 'blue' environment is retained for quick rollback if issues arise.

Why the other options are wrong

  • A. All-at-once deployment causes significant downtime, and a post-deployment Lambda for monitoring doesn't provide automatic rollback or zero-downtime during deployment itself.
  • C. Rolling updates can introduce issues gradually and complicate rollback, and a manual approval step adds unnecessary delay and doesn't inherently ensure health.
  • D. In-place deployment updates instances directly, leading to downtime and lacking a simple rollback mechanism for the entire environment.

Blue/Green Deployment

A deployment strategy where two identical environments (Blue and Green) are maintained. New code is deployed to the 'Green' environment, and once validated, traffic is switched from 'Blue' to 'Green'.

  • Minimizes downtime during deployment.
  • Provides an easy and fast rollback mechanism.
  • Requires double the infrastructure during the deployment phase.

Memory trick: Blue/Green is like a traffic light, switching from old to new with a safety net.

More SDLC Automation questions