A developer is configuring a deployment pipeline using AWS CodeDeploy to update an AWS Lambda function. The deployment uses the `CodeDeployDefault.LambdaCanary10Percent10Minutes` configuration, which shifts of the traffic to the new version for a duration of . The traffic is routed through a Lambda alias named `live`. The developer wants to ensure the deployment automatically rolls back if the new function version introduces errors, while preventing false rollbacks caused by test executions on the `$LATEST` version or activity on other development aliases of the function. Which configuration should the developer implement to meet these requirements?
- Create a CloudWatch Alarm for the Lambda `Errors` metric using the `FunctionName` and `Resource` dimensions, with the `Resource` dimension set to `my-function:live`. Associate this alarm with the CodeDeploy deployment group's rollback configuration.Cevap
- BCreate a CloudWatch Alarm for the Lambda `Errors` metric using only the `FunctionName` dimension. Associate this alarm with the CodeDeploy deployment group's rollback configuration.
- CCreate a CloudWatch Alarm for the Lambda `Errors` metric using the `Resource` dimension set to `my-function:$LATEST`. Associate this alarm with the CodeDeploy deployment group's rollback configuration.
- DCreate a CloudWatch Alarm for the Lambda `Errors` metric using a dynamic `Resource` dimension set to the newly created version number. Use a CodeDeploy `BeforeAllowTraffic` lifecycle hook to update the deployment group with this alarm before traffic shifting starts.
Cevap
Create a CloudWatch Alarm for the Lambda Errors metric using the FunctionName and Resource dimensions, with the Resource dimension set to the function name and the live alias. Associate this alarm with the CodeDeploy deployment group's rollback configuration.
The correct answer configuration monitors the specific Lambda alias (live) that is undergoing traffic shifting. Lambda publishes metrics under the Resource dimension in the format of FunctionName:AliasName. Monitoring this specific resource isolates the traffic routed to the production environment, ensuring that errors on other versions or aliases do not cause false alarms, and that any issues introduced by the new canary version are correctly detected.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy automates Lambda traffic shifting using aliases. Monitoring for automatic rollbacks must use the specific alias Resource dimension to isolate deployment-related errors and avoid false rollbacks from unrelated invocations.
Tahmini Süre:2m 0s