Q55 — AWS DVA-C02 Ch.1
Question 55 of 100 | ← Chapter 1
For an in-place deployment using AWS CodeDeploy, what is the execution order of deployment lifecycle hooks?
- A. BeforeInstall > ApplicationStop > ApplicationStart > AfterInstall
- B. ApplicationStop > BeforeInstall > AfterInstall > ApplicationStart ✓
- C. BeforeInstall > ApplicationStop > ValidateService > ApplicationStart
- D. ApplicationStop > BeforeInstall > ValidateService > ApplicationStart
Correct Answer: B. ApplicationStop > BeforeInstall > AfterInstall > ApplicationStart
Explanation
For an in-place deployment using AWS CodeDeploy, the hook execution order is: ApplicationStop → BeforeInstall → AfterInstall → ApplicationStart. This means the ApplicationStop hook runs first to stop the current version of the application running on the instance. Next, the BeforeInstall hook prepares the instance for the new application version. Then, the AfterInstall hook installs the new application version. Finally, the ApplicationStart hook starts the new version. Therefore, the correct answer is Option B: ApplicationStop → BeforeInstall → AfterInstall → ApplicationStart.