A SysOps Administrator is configuring a blue/green deployment strategy using AWS CodeDeploy for an application running on Amazon EC2 instances. The deployment must meet the following requirements:
- The deployment must automatically roll back if any of the replacement instances exceed a specific memory utilization threshold during the deployment.
- The original EC2 instances must remain active for 2 hours after traffic has successfully shifted to the replacement instances to allow for final validation.
Which combination of configurations will meet these requirements? (Select TWO.)
- Create an Amazon CloudWatch alarm based on memory metrics collected by the CloudWatch agent on the replacement instances, and add this alarm to the deployment group's auto-rollback configuration.Answer
- Configure the deployment group to terminate the original instances after a successful deployment, setting the wait time before termination to 2 hours.Answer
- CConfigure the deployment group to keep the original instances running indefinitely, and configure a scheduled AWS Systems Manager runbook to terminate the replacement instances after 2 hours.
- DEnable detailed monitoring on the EC2 instances to collect standard memory utilization metrics at 1-minute intervals, and associate this metric with the rollback alarm.
- EAdd the `iam:PassRole` permission to the EC2 instances' IAM role to allow the Amazon CloudWatch agent to delegate permissions to AWS CodeDeploy.
Answer
Create an Amazon CloudWatch alarm based on memory metrics collected by the CloudWatch agent on the replacement instances, and add this alarm to the deployment group's auto-rollback configuration. In addition, configure the deployment group to terminate the original instances after a successful deployment, setting the wait time before termination to 2 hours.
To monitor memory utilization, which is an operating system-level metric not captured by default EC2 metrics, the CloudWatch agent must be installed to send custom metrics. A CloudWatch alarm is then created and integrated with the CodeDeploy deployment group to trigger an automatic rollback when memory usage exceeds the defined threshold. Additionally, to keep the original instances for validation and ensure they are terminated automatically after 2 hours, the deployment group's success action must be configured to terminate the original instances with a 2-hour delay.
Step-by-Step Solution
Key Concept
Integrating custom operating system metrics with CodeDeploy rollback triggers and managing instance lifecycle termination delays in blue/green deployments.
Estimated Time:2m 30s