DVA-C02 Exam QuestionsBrowse all questions from this exam

DVA-C02 Exam - Question 17


For a deployment using AWS Code Deploy, what is the run order of the hooks for in-place deployments?

Show Answer
Correct Answer: B

In the context of AWS CodeDeploy for in-place deployments, the hooks execute in a specific sequence to ensure a smooth and reliable deployment process. The correct order is: ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart. This sequence makes certain that any running instances are stopped, the new application version is correctly installed, and then the necessary services are restarted. This ensures a seamless transition to the updated application. Thus, the correct order of hooks for in-place deployments is as follows: ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart.

Discussion

17 comments
Sign in to comment
pratchatcapOption: B
Mar 27, 2023

It's B. Check the image in the link. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server

awsdummie
May 28, 2023

Answer A For InPlace deployment

SyreOption: A
Apr 16, 2023

You guys should read the questions carefully. Answer is A. You are confusing the run order of hooks for in-place deployments with the run order of hooks for blue/green deployments. For blue/green deployments, the run order of the hooks is indeed ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart, which matches option B. However, for in-place deployments, the correct run order of the hooks is BeforeInstall -> ApplicationStop -> AfterInstall -> ApplicationStart, as stated in option A.

DeaconStJohn
Apr 20, 2023

From the below link: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server Neither type of deployment follows this order. BeforeInstall -> ApplicationStop -> AfterInstall -> ApplicationStart

[Removed]
Jul 16, 2023

BeforeInstall runs after ApplicationStop for ALL deployments types. The correct answer is B

Tony88Option: B
Sep 3, 2023

Stopped -> Installed -> Started -> Validated Go with B.

ez_24
Dec 14, 2023

B In AWS CodeDeploy for in-place deployments, the hooks run in the following order: ApplicationStop: Executed before the new application revision is downloaded. DownloadBundle: The new application revision is downloaded. BeforeInstall: Executed after the new revision is downloaded but before the new version is installed. Install: The application revision specified in the deployment is installed. AfterInstall: Executed after the application revision is installed. ApplicationStart: Invoked to start any services that were stopped during ApplicationStop. ValidateService: Ensures the service is operating correctly after the new deployment. This sequence ensures a smooth deployment process by systematically stopping, updating, and restarting the application.

DeaconStJohnOption: B
Apr 20, 2023

I'll go with B based on the link provided by others

Nagendhar
May 9, 2023

Ans: A For an in-place deployment using AWS CodeDeploy, the run order of the hooks is option A, "BeforeInstall -> ApplicationStop -> ApplicationStart -> AfterInstall." This is the correct order of hooks for an in-place deployment, where the deployment package is installed on the same set of Amazon EC2 instances that are running the current version of the application.

awsdummieOption: A
May 28, 2023

Refere the video 18:00 time stamp https://youtu.be/ISttjCIBd6U

Skywalker23Option: B
Sep 24, 2023

Application must be stopped before installation. Otherwise the installation may corrupt the running application’s files and cause damages. Not good.

SD_CSOption: B
Feb 2, 2024

Answer is B. There is no doubt - please go to the URL https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html and search with "In-place deployments" In fact none of the deployments follow the order mentioned in A

ScherbakovMike
May 30, 2023

Definitely, B: the order is the same in case of InPlace and Blue/Green deployment: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#reference-appspec-file-structure-hooks-availability

jiparkOption: B
Jul 29, 2023

this image explain all : https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server

fcbc62dOption: B
Jul 31, 2023

For in-place deployment B is correct. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html

sp323
Aug 15, 2023

Application start is after install

ninomfr64Option: B
Aug 17, 2023

I's B as per doc https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server:~:text=a%20load%20balancer.-,Lifecycle%20event%20hook%20availability,-The%20following%20table

quanbui
Oct 11, 2023

ApplicationStop -> BeforeInstall -> AfterInstall -> ApplicationStart -> ValidateService. Ref: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html

65703c1Option: B
May 21, 2024

B is the correct answer.

AnandeshOption: B
Jul 16, 2024

https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server