Soru

Zorluk: OrtaDeployment Strategies and Execution

A SysOps Administrator is using AWS CodeDeploy to deploy an update to an application running on a fleet of Amazon EC2 instances. The deployment must guarantee that at least 75%75\% of the instances are healthy and serving traffic at any given time during the deployment. If any instance fails the update, the deployment must automatically revert to the previous working version.

Which configuration will meet these requirements?

  1. Create a custom deployment configuration with the minimum healthy hosts set to 75%75\% using the percentage type, and configure the deployment group to roll back automatically when a deployment fails.Cevap
  2. B
    Use the CodeDeployDefault.HalfAtATime predefined deployment configuration, and configure an Amazon CloudWatch alarm to trigger a rollback if any instance goes offline.
  3. C
    Create a custom deployment configuration with the minimum healthy hosts set to 25%25\% using the percentage type, and configure the deployment group to roll back automatically when a deployment fails.
  4. D
    Deploy the application using an AWS CloudFormation stack update, and rely on the CloudFormation rollback execution role to automatically revert the CodeDeploy deployment if a failure is detected.

Cevap

Create a custom deployment configuration with the minimum healthy hosts set to 75%75\% using the percentage type, and configure the deployment group to roll back automatically when a deployment fails.
Creating a custom deployment configuration with the minimum healthy hosts set to 75%75\% ensures that CodeDeploy updates at most 25%25\% of the instances at a time, keeping at least 75%75\% of the fleet healthy. Enabling the automatic rollback option on deployment failure in the deployment group ensures that CodeDeploy automatically reverts to the last known good version if any instance fails to deploy successfully.

Adım Adım Çözüm

1
Determine the required minimum healthy host threshold and create a custom CodeDeploy deployment configuration.
A custom configuration is created specifying minimum healthy hosts as 75%75\% (percentage type).
Predefined configurations like HalfAtATime (50%50\%) or AllAtOnce (0%0\%) do not guarantee that at least 75%75\% of the fleet remains online.
2
Configure the rollback behavior on the CodeDeploy deployment group.
The deployment group is updated to automatically roll back when a deployment failure occurs.
This fulfills the requirement to automatically revert to the previous working version upon failure without manual intervention.
3
Execute the deployment specifying the newly created custom deployment configuration.
The deployment runs, updating at most 25%25\% of the instances at any time, and automatically rolls back if a failure is encountered.
This maintains the required application capacity and safety during the update process.

Anahtar Kavram

AWS CodeDeploy Deployment Configurations and Automatic Rollback Settings
Bu soruyu puanla