QuestionQ16

Resilient Cloud Solutions

A company uses AWS CodeDeploy to automate software deployments. The deployment must satisfy these requirements:

  • Several instances must remain available to serve traffic throughout the deployment. Traffic must be balanced among those instances, and the instances must heal automatically if a failure occurs.
  • A new fleet of instances must be automatically launched to deploy a new revision, without manual provisioning.
  • Traffic must be rerouted to the new environment to half of the new instances at a time. The deployment must succeed when traffic is rerouted to at least half of the instances; otherwise, it must fail.
  • Before traffic is routed to the new fleet of instances, temporary files created during the deployment process must be deleted.
  • At the conclusion of a successful deployment, the original instances in the deployment group must be deleted immediately to lower costs.

How can a DevOps engineer satisfy these requirements?

Explanation

An EC2/On-Premises blue/green deployment replaces the original environment with a separately provisioned replacement environment, and copying an existing Auto Scaling group creates the replacement fleet automatically. CodeDeployDefault.HalfAtATime has a 50% minimum healthy-host setting and processes the replacement instances in halves. BeforeAllowTraffic runs on replacement instances before they are registered with the load balancer, allowing temporary files to be removed before they receive traffic. After successful rerouting, CodeDeploy can terminate the original environment immediately.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!