AutoScaling.Client.
record_lifecycle_action_heartbeat
(**kwargs)¶Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using the PutLifecycleHook API call.
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.record_lifecycle_action_heartbeat(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
InstanceId='string'
)
[REQUIRED]
The name of the lifecycle hook.
[REQUIRED]
The name of the Auto Scaling group.
dict
Response Syntax
{}
Response Structure
Exceptions
AutoScaling.Client.exceptions.ResourceContentionFault
Examples
This example records a lifecycle action heartbeat to keep the instance in a pending state.
response = client.record_lifecycle_action_heartbeat(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleActionToken='bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635',
LifecycleHookName='my-lifecycle-hook',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}