AWS CodeDeploy: Automatic Rollback Configuration for Production Environment

Automatic Rollback Configuration for CodeDeploy in Production Environment

Prev Question Next Question

Question

Your team has created a new AWS CodeDeploy application to automate deployments to Amazon EC2 instances under an autoscaling group.

It is possible that a deployment activity has failed due to software issues.

Your manager asked you to configure automatic rollback for the deployment group in the production environment.

In terms of the automatic rollback configuration of CodeDeploy, which statement is correct?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - D.

Check https://docs.aws.amazon.com/codedeploy/latest/userguide/deployments-rollback-and-redeploy.html.

for how to redeploy and roll back a deployment in CodeDeploy.

Option A is incorrect: Users can configure triggers using SNS notifications.

However, automatic rollback cannot be configured together with these triggers.

Option B is incorrect: CodeDeploy deployment group supports automatic rollback.

It is within the advanced settings.

Check the above link.

Option C is incorrect: Because EC2 Auto Scaling groups, EC2 instances or On-premises instances all support automatic rollback.

Option D is CORRECT: Because automatic rollback can be triggered when a deployment fails or the configured alarm thresholds are met:

Specify regions

Choose the regions in which you want to deploy stacks

US East (Ohio) Remove
Asia Pacific (Singapore) Remove
US East (N.Virginia) Remove
US West (Oregon) Remove
EU (Ireland) Remove
US West (N. California) Remove
Asia Pacific (Tokyo) Remove
South America (Sao Paulo) Remove
Asia Pacific (Sydney) Remove

The correct answer is D. Automatic rollback can be triggered when alarm thresholds are met.

AWS CodeDeploy is a fully-managed deployment service that automates software deployments to a variety of compute services, including Amazon EC2 instances, on-premises instances, and Lambda functions. It allows users to deploy applications from various sources, including Amazon S3 buckets, GitHub repositories, and Bitbucket repositories.

When it comes to automatic rollback, CodeDeploy allows users to configure rollback settings at the deployment group level. If a deployment fails due to a software issue, CodeDeploy will automatically initiate a rollback and restore the previous version of the application.

Users can configure the following automatic rollback triggers in CodeDeploy:

  • Alarm thresholds: Users can create CloudWatch alarms that monitor application health during a deployment. If the alarm threshold is breached, CodeDeploy will initiate a rollback.
  • Custom scripts: Users can create custom scripts that run during a deployment. If the script returns a non-zero exit code, CodeDeploy will initiate a rollback.
  • Amazon CloudWatch Events: Users can create CloudWatch Events rules that trigger a rollback when a specific event occurs.

It's worth noting that users can also trigger a rollback manually in CodeDeploy. This can be done through the AWS Management Console, AWS CLI, or AWS SDKs.

In summary, automatic rollback can be configured in CodeDeploy using alarm thresholds, custom scripts, or CloudWatch Events. There is no option to trigger a rollback based on SNS notifications.