Soru

Zorluk: OrtaDeployment Strategies and Execution

A company runs a critical web application on a fleet of Amazon EC2 instances managed by an Amazon EC2 Auto Scaling group behind an Application Load Balancer. A SysOps Administrator is setting up a deployment pipeline using AWS CodeDeploy. The deployment process must satisfy the following requirements:
- The application must not experience any downtime during updates.
- If the update fails, the application must be rolled back to the previous version immediately without requiring the redeployment of code or launching of new instances during the rollback process.
- The deployment process must minimize the temporary increase in running instance costs.

Which deployment strategy and configuration should the Administrator choose to meet these requirements?

  1. A
    Configure an in-place deployment with a custom deployment configuration of 75% minimum healthy hosts, and rely on automatic rollbacks to redirect traffic to the previous version without redeployment.
  2. B
    Configure an AWS CloudFormation rolling update with rollback alarms, assuming that CloudFormation will keep the failed EC2 instances running in their current state to avoid launching new instances during rollback.
  3. Configure a blue/green deployment that deploys to a replacement Auto Scaling group, routes traffic using a canary configuration, and terminates the original instances immediately after the deployment succeeds.Cevap
  4. D
    Configure a blue/green deployment, but omit the IAM execution service role from the deployment configuration to allow CodeDeploy to default to the EC2 instance profile.

Cevap

Configure a blue/green deployment that deploys to a replacement Auto Scaling group, routes traffic using a canary configuration, and terminates the original instances immediately after the deployment succeeds.
The correct answer is to configure a blue/green deployment that deploys to a replacement Auto Scaling group, routes traffic using a canary configuration, and terminates the original instances immediately after the deployment succeeds. This setup ensures zero downtime by verifying the new code on a separate fleet, provides near-instantaneous rollback by redirecting the load balancer back to the original fleet without redeploying code or launching new instances during the rollback, and minimizes extra costs by immediately cleaning up the original fleet once success is confirmed.

Adım Adım Çözüm

1
Analyze the zero-downtime and immediate rollback requirements.
Identify that a blue/green deployment is necessary because the original instances remain untouched during the update, allowing traffic to be immediately routed back if a failure occurs.
In-place updates overwrite the running instance code, meaning rollbacks require a complete redeployment cycle, which is not immediate.
2
Address the requirement to minimize the temporary increase in running instance costs.
Configure the deployment to terminate the original instances immediately after the deployment successfully completes and traffic is fully shifted.
This limits the duration that two parallel sets of EC2 instances are running, keeping temporary costs to a minimum.
3
Ensure CodeDeploy has the necessary permissions to execute the deployment.
Provide CodeDeploy with a service role that has permissions to manage Auto Scaling groups and load balancers.
Omitting the service role or lacking the PassRole permission prevents CodeDeploy from performing the necessary actions on AWS resources.

Anahtar Kavram

AWS CodeDeploy deployment strategies and rollback mechanics
Bu soruyu puanla