AWS CodeDeploy Hooks Sequence | Exam DVA-C01

AWS CodeDeploy Hooks Sequence

Prev Question Next Question

Question

Which of the following is the right sequence of hooks that get called in AWS CodeDeploy?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - A.

This is also mentioned in the AWS Documentation.

Options B and D are incorrect because the application needs to be stopped before doing the pre-install tasks such as decrypting files and creating a backup.

Option C is incorrect because ValidateService should be the last event.

It is used to verify if the deployment is completed successfully.

For more information on the hooks order, please refer to the below URL-

https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#reference-appspec-file-structure-hooks-run-order
Without Classic load
balancer in deployment
group

«==

ApplicationStop

=

Before install

om

Afterinstall

y
ApplicationStart

¥

ValidateService

«=

AWS CodeDeploy is a fully managed deployment service that automates software deployments to various computing services such as Amazon EC2 instances, AWS Lambda functions, and on-premises servers. It uses a sequence of lifecycle events, also known as hooks, to perform deployments.

The right sequence of hooks that get called in AWS CodeDeploy is:

B. BeforeInstall->After Install->Application Stop->Application Start

Here is a detailed explanation of each hook in the sequence:

  1. BeforeInstall: This hook is the first in the sequence and is used to prepare the system for the installation of new revisions of an application. It can be used to backup or delete old files, create new directories, and perform other necessary setup tasks before deployment.

  2. AfterInstall: This hook is called after the application is installed on the target instances. It can be used to configure the new version of the application, set up permissions, and perform other post-installation tasks.

  3. ApplicationStop: This hook is called before the application is stopped on the target instances. It can be used to save any in-flight transactions or data, stop any services or processes that may interfere with the deployment, and perform other necessary tasks before the application is stopped.

  4. ApplicationStart: This hook is called after the new version of the application is started on the target instances. It can be used to perform final configurations, such as updating DNS records, load balancer settings, and other tasks.

Therefore, option B is the right sequence of hooks that get called in AWS CodeDeploy: BeforeInstall->After Install->Application Stop->Application Start.