Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use DescribeLifecycleHooks with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DescribeLifecycleHooks with a CLI

The following code examples show how to use DescribeLifecycleHooks.

CLI
AWS CLI

To describe your lifecycle hooks

This example describes the lifecycle hooks for the specified Auto Scaling group.

aws autoscaling describe-lifecycle-hooks \ --auto-scaling-group-name my-asg

Output:

{ "LifecycleHooks": [ { "GlobalTimeout": 3000, "HeartbeatTimeout": 30, "AutoScalingGroupName": "my-asg", "LifecycleHookName": "my-launch-hook", "DefaultResult": "ABANDON", "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING" }, { "GlobalTimeout": 6000, "HeartbeatTimeout": 60, "AutoScalingGroupName": "my-asg", "LifecycleHookName": "my-termination-hook", "DefaultResult": "CONTINUE", "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING" } ] }
PowerShell
Tools for PowerShell

Example 1: This example describes the specified lifecycle hook.

Get-ASLifecycleHook -AutoScalingGroupName my-asg -LifecycleHookName myLifecycleHook

Output:

AutoScalingGroupName : my-asg DefaultResult : ABANDON GlobalTimeout : 172800 HeartbeatTimeout : 3600 LifecycleHookName : myLifecycleHook LifecycleTransition : auto-scaling:EC2_INSTANCE_LAUNCHING NotificationMetadata : NotificationTargetARN : arn:aws:sns:us-west-2:123456789012:my-topic RoleARN : arn:aws:iam::123456789012:role/my-iam-role

Example 2: This example describes all lifecycle hooks for the specified Auto Scaling group.

Get-ASLifecycleHook -AutoScalingGroupName my-asg

Example 3: This example describes all lifecycle hooks for all your Auto Scaling groups.

Get-ASLifecycleHook
AWS CLI

To describe your lifecycle hooks

This example describes the lifecycle hooks for the specified Auto Scaling group.

aws autoscaling describe-lifecycle-hooks \ --auto-scaling-group-name my-asg

Output:

{ "LifecycleHooks": [ { "GlobalTimeout": 3000, "HeartbeatTimeout": 30, "AutoScalingGroupName": "my-asg", "LifecycleHookName": "my-launch-hook", "DefaultResult": "ABANDON", "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING" }, { "GlobalTimeout": 6000, "HeartbeatTimeout": 60, "AutoScalingGroupName": "my-asg", "LifecycleHookName": "my-termination-hook", "DefaultResult": "CONTINUE", "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING" } ] }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.