You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In our company Jenkins agent workspace has some important files that are required for debugging. I have put a lifecycle hook that copies files from workspace location to s3 before termination. Setup is simple, hook triggers SNS notification, and SNS triggers lambda. Lambda runs a send_command on EC2 instance and copies data to specified s3 bucket. But the send_command keeps giving me error saying instance is not in a valid state.
So when checked I found out that the instance is already in terminated state even though ASG page says Terminating:Wait.
I have already seen the duplicate issue here: #216
Is your feature request related to a problem? Please describe.
In our company Jenkins agent workspace has some important files that are required for debugging. I have put a lifecycle hook that copies files from workspace location to s3 before termination. Setup is simple, hook triggers SNS notification, and SNS triggers lambda. Lambda runs a send_command on EC2 instance and copies data to specified s3 bucket. But the send_command keeps giving me error saying instance is not in a valid state.
So when checked I found out that the instance is already in terminated state even though ASG page says Terminating:Wait.
I have already seen the duplicate issue here: #216
Describe the solution you'd like
So I have seen the code which calls terminatInstances. A very simple solution is to switch to using TerminateInstanceInAutoScalingGroup. In this you can specify which instance is to be terminated by it's instance ID and if
ShouldDecrementDesiredCapacity
is set to true then desired capacity is set accordingly by AWS.https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TerminateInstanceInAutoScalingGroup.html
Describe alternatives you've considered
Alternates I have considered are:
The text was updated successfully, but these errors were encountered: