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
ApplicationStop: Stops the currently running application (if any) on the instance.
BeforeInstall: Runs tasks or scripts before the new application revision is installed.
Install: Deploys the new application revision.
AfterInstall: Runs tasks or scripts after the new application revision is installed.
ApplicationStart: Starts the application after installation.
ValidateService: Validates that the service is running as expected after the application starts.
A) Eliminated - The ApplicationStop hook must be the first step to stop the currently running application
C) BeforeInstall cannot occur before ApplicationStop because the application needs to be stopped first.
D) Eliminated - ValidateService should run after the application starts, not before.
==> discard C, D: ValidateService is invalid lifecycle in In-place CodeDeploy
==> discard A: it is not logic, cuz install --> then stop app => pointless
So I choose B
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
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.
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
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
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.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
pratchatcap
Highly Voted 1 year, 9 months agoawsdummie
1 year, 7 months agosumanshu
Most Recent 2 weeks, 1 day agosumanshu
2 weeks, 1 day agotrieudo
3 weeks, 2 days agoAnandesh
5 months, 3 weeks ago65703c1
7 months, 2 weeks agoSD_CS
11 months, 1 week agoez_24
1 year agoquanbui
1 year, 2 months agoSkywalker23
1 year, 3 months agoTony88
1 year, 4 months agoninomfr64
1 year, 4 months agosp323
1 year, 4 months agofcbc62d
1 year, 5 months agojipark
1 year, 5 months agoScherbakovMike
1 year, 7 months agoNagendhar
1 year, 8 months agoDeaconStJohn
1 year, 8 months ago