aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
328 stars 188 forks source link

[Feature request] Deployments to ASG Warm pool instances using CodeDeploy lifecycle hooks #390

Open pawelhajski opened 6 months ago

pawelhajski commented 6 months ago

Currently, CodeDeploy lifecycle hooks in EC2 Auto Scaling are not working with Warm pool instances in Warmed:Pending:Wait state. Please make it possible for CodeDeploy to work with Warm pool instances.

cocest commented 3 months ago

I am currently experiencing the exact problem, and this happens if you have a warm pool attached to your AWS auto scaling group (ASG). I am using AWS launch template's user data. Even though my cloud configuration script invoke AWS lifecycle hook to complete the process. If I am to SSH into the launch instance I can complete the lifecycle hook manually. My only conclusion is that the lifecycle hook is only invoked on Warmed:Pending:Wait and never Pending:Wait event for it to transition into InService state.

One of the way to overcome this issue is to deamonise your bash script to complete the lifecycle hook on system startup.