The signature and its nearby causes#
A launch lifecycle hook holds a new instance in Pending:Wait while something prepares it: a user data script, a deploy agent, or a Lambda function triggered by EventBridge. Whatever does the work must call CompleteLifecycleAction with CONTINUE for the launch to proceed. When the hook ends in ABANDON, Auto Scaling terminates the instance and launches a replacement, and the launch activity records it. AWS's examples show StatusCode Cancelled with a status message that begins Instance failed to complete user's Lifecycle Action and ends Lifecycle Action Completed with ABANDON Result. Retrieve an error message · Lifecycle hooks
The same message covers three situations:
- The hook timed out.
DefaultResultis the action taken when the heartbeat timeout elapses or an unexpected failure occurs, and its default isABANDON. An agent that never ran, lacked permission, or never reached the API looks like this. - The agent called
CompleteLifecycleActionwithABANDONitself. AWS's Lambda tutorial does exactly this when its custom action fails. The hook worked; the agent's own check failed. - The hook uses
CONTINUEand nothing abandoned. The instance waits, and after the timeout goes into service without the work finishing. This leaves no cancelled activity, only a slow launch and a deploy that seems to stall.
LifecycleHook · PutLifecycleHook
Read the hooks#
Use a read-only profile and replace the uppercase placeholders. describe-lifecycle-hooks
aws autoscaling describe-lifecycle-hooks \
--profile PROFILE --region REGION --auto-scaling-group-name GROUP \
--query 'LifecycleHooks[].{name:LifecycleHookName,transition:LifecycleTransition,heartbeat:HeartbeatTimeout,global:GlobalTimeout,default:DefaultResult,target:NotificationTargetARN}' \
--output json --no-cli-pager
Only hooks with autoscaling:EC2_INSTANCE_LAUNCHING matter here. heartbeat is how long an instance can wait without a heartbeat; the range is 30 to 7200 seconds and the default is 3600. Each RecordLifecycleActionHeartbeat call restarts that timer, up to global, which is 48 hours or 100 times the heartbeat timeout, whichever is smaller. An empty target means the hook relies on EventBridge or user data, not an SNS topic or SQS queue. Add lifecycle hooks · Complete a lifecycle action
Time the abandoned launches#
aws autoscaling describe-scaling-activities \
--profile PROFILE --region REGION --auto-scaling-group-name GROUP \
--filters Name=Status,Values=Cancelled \
--query 'Activities[].{start:StartTime,end:EndTime,description:Description,message:StatusMessage}' \
--output json --no-cli-pager
aws autoscaling describe-auto-scaling-groups \
--profile PROFILE --region REGION --auto-scaling-group-names GROUP \
--query 'AutoScalingGroups[0].Instances[?LifecycleState==`"Pending:Wait"`].{id:InstanceId,version:LaunchTemplate.Version,zone:AvailabilityZone}' \
--output json --no-cli-pager
The time from start to end covers boot plus the wait. If every cancelled launch lasts roughly the boot time plus HeartbeatTimeout, the timeout ended them. If they end minutes after launch, well inside the timeout, something called ABANDON. Timing alone cannot separate a timeout from an ABANDON sent just before it, so confirm either reading with the agent's call below. The second command lists instances waiting now; during an instance refresh, these are the replacements the refresh is waiting on. describe-scaling-activities
Look for the agent's call#
CloudTrail records Auto Scaling API calls, including who made them and their request parameters. Look up CompleteLifecycleAction and RecordLifecycleActionHeartbeat in the window of a cancelled launch, and read CloudTrailEvent for the hook name, the instance ID and the result. Auto Scaling in CloudTrail · lookup-events
aws cloudtrail lookup-events \
--profile PROFILE --region REGION \
--lookup-attributes AttributeKey=EventName,AttributeValue=CompleteLifecycleAction \
--start-time LAUNCH_START_TIME --end-time LAUNCH_END_TIME \
--query 'Events[].{time:EventTime,user:Username,event:CloudTrailEvent}' \
--output json --no-cli-pager
Read the call first. A successful CompleteLifecycleAction for this hook and instance settles the case whatever the timing; the wait only decides when no such call succeeded.
| Call for this instance | Wait compared with HeartbeatTimeout | Reading |
|---|---|---|
Succeeded with ABANDON, matching hook and instance | Any, even just under the timeout | The agent reported failure; its own log has the reason |
| None | About equal | The agent never completed the action: it did not run, could not authenticate, or did not receive the event |
| Present but failed, or naming another hook, group or instance | About equal | The call did not complete this action; compare its errorCode, hook name, group name and instance ID or token with the hook |
| Heartbeats | Instance still in Pending:Wait | The agent is still working, and the launch waits up to the global timeout |
For "did not run" and "could not authenticate", AWS lists the prerequisites. A user data script that completes the action needs an instance profile whose role allows the call. A Lambda function needs the permission on its execution role, and its EventBridge rule must be in the group's Region. A hook created with an SNS topic or SQS queue needs a role that lets Auto Scaling publish to it. If the release changed the instance profile, the agent or the rule, start there. Prepare to add a lifecycle hook
What abandoning does to a deploy#
Each abandoned launch terminates the instance and starts another, so a broken agent turns into a loop of launches that never reach InService. AWS throttles launches when hooks fail consistently, which makes the loop slower and the rollout look stuck. An instance refresh that cannot launch any healthy instances eventually fails; see instance refresh failures. The CONTINUE case fails differently: instances go into service without the deploy, and can then fail load balancer health checks, which the health check guide covers. Lifecycle hooks considerations
Two fictional outcomes#
The group orders-asg has a launch hook orders-deploy with HeartbeatTimeout 600 and DefaultResult ABANDON. A script in user data installs the orders service and calls complete-lifecycle-action with CONTINUE. Launch template version 8 switches the instance profile to a new role.
In the first outcome, every launch since the switch is Cancelled about 11 minutes after it started: roughly a minute of boot plus the 600-second timeout. CloudTrail has no CompleteLifecycleAction event for those instances, and the script's log on a kept instance ends with an access denied error. The new role lacks permission to complete the action, so the hook timed out. Adding the permission to the role fixes the launches without touching the hook.
In the second outcome, launches end Cancelled after three minutes, well inside the timeout. CloudTrail shows CompleteLifecycleAction with result ABANDON from the instance role. The script ran and reported failure: its log shows the release artifact for version 8 could not be downloaded. The hook and its permissions are fine; the artifact is the cause.
Fix and confirm#
Fix what the table points to: the agent's permissions or trigger, the agent itself, or the hook settings. If the work legitimately takes longer than the timeout, raise HeartbeatTimeout with put-lifecycle-hook or have the agent send heartbeats; both are changes. Keep ABANDON as the default result if an unprepared instance must never take traffic. put-lifecycle-hook · record-lifecycle-action-heartbeat
Confirm on the next launch: the activity ends Successful, the instance moves from Pending:Wait to InService in about the time the work takes, and CloudTrail shows a CompleteLifecycleAction call with CONTINUE for that instance.
Where this reading stops#
The status message is the same for a timeout and for an explicit ABANDON, so the timing and the API call carry the distinction. A missing CloudTrail event shows that no completed call was recorded for that window; it cannot tell you why the agent stayed silent. Launch hooks do not run when you attach instances or move them out of standby. Scaling activities are kept for six weeks. For the other launch and health signatures, see the signature table.
Questions#
What does Lifecycle Action Completed with ABANDON Result mean?
A launch lifecycle hook ended with ABANDON, so Auto Scaling terminated the new instance and recorded the launch as Cancelled. Either the hook timed out with its default result of ABANDON, or something called CompleteLifecycleAction with ABANDON.
What is the default result of an Auto Scaling lifecycle hook?
ABANDON, with a heartbeat timeout of 3600 seconds unless you set one. A launching instance that is not completed in time is terminated and replaced.
Why is my Auto Scaling instance stuck in Pending:Wait?
A launch hook is waiting for CompleteLifecycleAction. It waits until the heartbeat timeout, or longer if the agent sends heartbeats, up to the global timeout. Check that the agent ran and has permission to complete the action.