A developer is configuring an AWS CodeDeploy deployment for an AWS Lambda function. The developer needs to define the target Lambda function to deploy and run a validation test before any production traffic shifts to the new version. Which two configurations must the developer include in the AppSpec file to accomplish this? (Select TWO.)
- A resources section that specifies the Lambda function name, alias, current version, and target versionCevap
- A BeforeAllowTraffic hook under the hooks section that references a validation Lambda functionCevap
- CAn ApplicationStart hook under the hooks section to run the validation script
- DAn IAM trust policy definition under a permissions section to grant execution rights to CodeDeploy
- EA parameters section referencing AWS Systems Manager Parameter Store to retrieve database passwords
Cevap
The developer must include a resources section with the Lambda function details (name, alias, current version, and target version) and define a BeforeAllowTraffic lifecycle hook under the hooks section pointing to a validation Lambda function.
To deploy a Lambda function using AWS CodeDeploy, the AppSpec file must define the target function details under the resources section. To run validation tests before shifting traffic, the developer must use the BeforeAllowTraffic lifecycle hook, which runs a separate validation Lambda function before any production traffic begins routing to the new version.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy AppSpec file structure and lifecycle hooks for AWS Lambda deployments.
Tahmini Süre:1m 0s