Testing and Deployment
A CodeDeploy deployment shifts traffic between Lambda versions. Its BeforeAllowTraffic validation function returns successfully, but deployment remains pending at that hook; what must the function do to complete validation?
Show the answer
Correct answerC. Report success through PutLifecycleEventHookExecutionStatus
AWhy not this: CodeDeploy manages alias traffic shifting; changing the alias does not report the validation hook's result.
BWhy not this: A successful invocation response does not notify CodeDeploy that the lifecycle event succeeded.
CWhy this is right: The API reports the result using the deployment ID and lifecycle event hook execution ID supplied to the function.
DWhy not this: Publishing a version creates deployable code but does not complete a pending validation event.
Lambda validation hooks must explicitly report their result to CodeDeploy through PutLifecycleEventHookExecutionStatus. A successful function return alone does not complete the lifecycle event.