Meaning of CONTINUE vs ABANDON in lifecycle hooks

0

I'm confused about which default-result to give to our lifecycle hooks -- CONTINUE or ABANDON. The hook is handling an instance termination, so if our lambda handling that fails, what is being CONTINUEd or ABANDONed?

What is it acting on? The termination process? Or the lambda? Or the instance?

In other words, if I say CONTINUE and our process fails, will auto scaling continue to terminate the instance? If I say ABANDON, what gets abandoned? The process (which would mean the instance would hang in limbo, half-terminated so to speak until the timeout period). Or does the instance get abandoned?

The docs say just:

Defines the action the Auto Scaling group should take when the
lifecycle hook timeout elapses or if an unexpected failure occurs.
This parameter can be either "CONTINUE" or "ABANDON" . The default
value is "ABANDON" .

asked 6 years ago2668 views
1 Answer
1

Hi,

Thank you for reaching out to us on AWS Forums.

The default result of your lifecycle hook can be set to either CONTINUE or ABANDON. As you mentioned, the default result defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs.

So lets say you have created a lifecycle hook for EC2_INSTANCE_LAUNCHING and you have set the default result to CONTINUE. In this case, if lifecycle hook times out or any unexpected error occurs then also the instance will be put into service, as the result CONTINUE indicates that your actions were successful, even though they were not.

If you specified the default result as ABANDON, then the instance won’t be put to In-service and will be terminated as the result ABANDON indicates that your custom actions were unsuccessful.

However, in case the lifecycle hook is created for EC2_INSTANCE_TERMINATING, then the behavior is different.

Now, lets say you created a lifecycle hook for EC2_INSTANCE_TERMINATING and you have set the default result to CONTINUE. So now if any instance from your ASG need to be terminated, it first goes into the TERMINATING_WAIT state. During this time, if your lifecycle hook times out or any unexpected failure occurs - then in that case the instance would still be terminated and you will notice the status of the instance (in Auto Scaling console) changing to TERMINATING_PROCEED and then later the instance would TERMINATED (can be seen from EC2 console), when the instance has been removed from the ASG successfully.

If you specified the default result to ABANDON and your lifecycle hook timed out or any unexpected error occurred, then the instance would still be terminated, however no other lifecycle hook can be performed on that instance, whereas CONTINUE would allow any other lifecycle hooks to complete.

Basically the lifecycle hook is being acted upon the process for which it is configured, that is, launching or terminating. Lifecycle hook just adds a pause to that process and the script or lambda function that the user is running during that pause- is acting on the instance.

For more information, please go through the below link :-

https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html

I hope the above information answers your queries.

Thank you.

AWS
answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions