capabilities.work

Register Lifecycle Hook and Complete Action

A 3-step recipe with Amazon EC2 Auto Scaling. We can help you get access.

Recipe · 3 steps

Register Lifecycle Hook and Complete Action

Create a lifecycle hook, verify it, and complete a pending lifecycle action.

  1. Create or update the lifecycle hook on the Auto Scaling group.
  2. Describe the group's lifecycle hooks to confirm the new hook is registered and capture its transition and timeout.
  3. Complete a pending lifecycle action for the instance with the supplied result so the instance can proceed.
What you'll need to have ready
  • autoScalingGroupName: The name of the Auto Scaling group.
  • lifecycleHookName: The name of the lifecycle hook.
  • lifecycleTransition: The lifecycle transition (autoscaling:EC2_INSTANCE_LAUNCHING or autoscaling:EC2_INSTANCE_TERMINATING).
  • roleArn: The ARN of the IAM role that allows the group to publish to the notification target.
  • notificationTargetArn: The ARN of the Amazon SNS topic or SQS queue notification target.
  • heartbeatTimeout: The maximum time, in seconds, before the lifecycle hook times out (30 to 7200).
  • lifecycleActionResult: The action for the group to take when completing the lifecycle action (CONTINUE or ABANDON).
  • lifecycleActionToken: The UUID token identifying the specific lifecycle action to complete.
  • instanceId: The ID of the instance whose lifecycle action is being completed.
For your developer

Arazzo workflow amazon-ec2-auto-scaling:register-lifecycle-hook-and-complete-action, 3 operations: PutLifecycleHook → DescribeLifecycleHooks → CompleteLifecycleAction. Specs on APIs.io.