
Answer-first summary for fast verification
Answer: BeforeInstall
The correct answer is C: BeforeInstall. According to the AWS CodeDeploy documentation, the 'BeforeInstall' hook is the appropriate hook to use for running scripts that need to be executed before the installation process begins on your instances. Since the requirement is to download and install a license file before the instances start handling traffic, 'BeforeInstall' is the suitable hook. Other options are either not available for replacement instances or reserved for CodeDeploy operations and cannot be used to run scripts.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a production environment, a company utilizes AWS CodeDeploy for blue/green deployments of their application, which involves Amazon EC2 Auto Scaling groups launching instances running Amazon Linux 2. The code repository contains a functional appspec.yml file. To ensure that a script can download and install a license file on the instances before they begin to handle traffic, a DevOps engineer modifies the appspec.yml file by adding a hooks section. Which specific hook should the DevOps engineer utilize to execute the script responsible for downloading and installing the license file?
A
AfterBlockTraffic
B
BeforeBlockTraffic
C
BeforeInstall
D
DownloadBundle
No comments yet.