A company runs a critical microservice on Amazon ECS using the AWS Fargate launch type. A SysOps administrator is configuring a blue/green deployment strategy using AWS CodeDeploy to update the ECS service.
The deployment must satisfy the following operational requirements:
- Route a small fraction of test traffic to the new task set (green environment) using a test listener on port to perform integration tests.
- Automatically roll back to the original task set (blue environment) if the integration tests fail or if the Application Load Balancer (ALB) green target group's `HTTPCode_Target_5XX_Count` metric exceeds a threshold during the deployment.
- The rollback must occur automatically without manual intervention.
Which two configurations must the SysOps administrator implement to meet these requirements? (Select two.)
- Specify an AWS Lambda function under the AfterAllowTestTraffic hook in the AppSpec file to execute the validation tests.Answer
- Create a CloudWatch alarm for the HTTPCode_Target_5XX_Count metric of the green target group, and associate it with the CodeDeploy deployment group's rollback configuration.Answer
- CSpecify the validation tests under the BeforeInstall hook in the AppSpec file to ensure the new container image functions before task set creation.
- DConfigure the CodeDeploy service role trust policy to allow sts:AssumeRole for the Amazon ECS task execution role to grant task deployment permissions.
- ECreate a CloudWatch alarm for the HTTPCode_Target_5XX_Count metric of the blue target group, and configure an Amazon EventBridge rule to invoke a custom rollback function.