
Answer-first summary for fast verification
Answer: Add a BeforeAllowTraffic hook to the AppSpec file that tests and waits for any necessary database changes before traffic can flow to the new version of the Lambda function.
The correct answer is A. Adding a BeforeAllowTraffic hook to the AppSpec file allows you to test and wait for any necessary database changes before traffic can flow to the new version of the Lambda function. This ensures that all required database updates are fully propagated and avoids potential intermittent failures caused by the Lambda function being invoked prematurely. Hooks like BeforeAllowTraffic are specifically designed to handle such pre-deployment checks, ensuring your deployment process accounts for dependencies such as database changes.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company has implemented an AWS Lambda function to process orders via an API, utilizing AWS CodeDeploy for the final deployment stage in their CI/CD pipeline. The DevOps team has observed occasional API failures shortly post-deployment, hypothesizing that these are caused by the Lambda function being invoked before database updates are fully integrated. What strategy should the DevOps engineer employ to prevent these failures by ensuring that database changes are fully propagated prior to the Lambda function's invocation?
A
Add a BeforeAllowTraffic hook to the AppSpec file that tests and waits for any necessary database changes before traffic can flow to the new version of the Lambda function.
B
Add an AfterAllowTraffic hook to the AppSpec file that forces traffic to wait for any pending database changes before allowing the new version of the Lambda function to respond.
C
Add a BeforeInstall hook to the AppSpec file that tests and waits for any necessary database changes before deploying the new version of the Lambda function.
D
Add a ValidateService hook to the AppSpec file that inspects incoming traffic and rejects the payload if dependent services, such as the database, are not yet ready.