AutoScaling.Client.
complete_lifecycle_action
(**kwargs)¶Completes the lifecycle action for the specified token or instance with the specified result.
This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.complete_lifecycle_action(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
LifecycleActionResult='string',
InstanceId='string'
)
[REQUIRED]
The name of the lifecycle hook.
[REQUIRED]
The name of the Auto Scaling group.
[REQUIRED]
The action for the group to take. You can specify either CONTINUE
or ABANDON
.
dict
Response Syntax
{}
Response Structure
Exceptions
AutoScaling.Client.exceptions.ResourceContentionFault
Examples
This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance.
response = client.complete_lifecycle_action(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleActionResult='CONTINUE',
LifecycleActionToken='bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635',
LifecycleHookName='my-lifecycle-hook',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}