Stop a service before an EC2 application deployment and run a health check afterward.
Define the scripts and their order in the deployment definition.
Which feature is most appropriate?
Define lifecycle scripts in the hooks section of a CodeDeploy AppSpec file.
Detailed explanation
S3 object lifecycle does not control EC2 deployment order.
S3 object lifecycle does not control EC2 deployment order.
AppSpec lifecycle hooks run scripts at stages such as BeforeInstall and AfterInstall.
AppSpec lifecycle hooks run scripts at stages such as BeforeInstall and AfterInstall.
A health check does not execute pre- or post-deployment scripts.
A health check does not execute pre- or post-deployment scripts.
Dashboards display information and do not execute deployment lifecycle hooks.
Dashboards display information and do not execute deployment lifecycle hooks.
Check official documentation
Compare the following points with the official documentation.
AWS CodeDeploy AppSpec hooksの公式説明を確認する。
What to confirm
デプロイステージとライフサイクルフックを区別できる。
Key points
- AppSpec
- Lifecycle hook
- BeforeInstall and AfterInstall
Notes
- Environment: AWS公式SOA-C03試験ガイドとAWS公式ドキュメントの確認
- Confirm current AWS service behavior in the official documentation.
Foundation review
Deployment ordering
Hooks express dependencies between service stop, installation, and health validation.
Execution context
The deployment agent runs hook scripts on the target host at the defined point.