All Products
Search
Document Center

Auto Scaling:DescribeLifecycleHooks

Last Updated:Nov 02, 2026

Queries the details of lifecycle hooks by specifying lifecycle hook IDs or scaling group IDs. The details include the next action to perform after the wait state ends, the scaling activity type associated with the lifecycle hook, the Notification Recipient identifier, and the suspension wait time.

Operation description

Operation description

You can query lifecycle hooks in the following three ways:

  • Specify a list of lifecycle hook IDs (LifecycleHookId.N). In this case, the ScalingGroupId and LifecycleHookName parameters are ignored.

  • Specify a scaling group ID (ScalingGroupId).

  • Specify both a scaling group ID (ScalingGroupId) and a lifecycle hook name (LifecycleHookName).

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:DescribeLifecycleHooks

get

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ScalingGroupId

string

No

The ID of the scaling group.

asg-bp1igpak5ft1flyp****

LifecycleHookName

string

No

The name of the lifecycle hook.

lifecyclehook****

PageNumber

integer

No

The page number of the instance status list. Pages start from 1.

Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page during a paged query. Maximum value: 50.

Default value: 50.

50

LifecycleHookId

array

No

The list of lifecycle hook IDs.

ash-bp19d1032y9kij96****

string

No

The ID of the lifecycle hook.

ash-bp1at9ufhmcf9cmy****

RegionId

string

No

The region ID of the scaling group.

cn-beijing

Response elements

Element

Type

Description

Example

object

LifecycleHooks

object

LifecycleHook

array<object>

The list of lifecycle hooks.

array<object>

The details of the lifecycle hook.

DefaultResult

string

The next action to perform after the wait state of the suspended instance ends.

CONTINUE

HeartbeatTimeout

integer

The wait time configured in the lifecycle hook for the scaling activity. The next action is performed after the wait time expires.

60

LifecycleActionSources

object

LifecycleActionSource

array

The specific scenario that triggers the lifecycle hook.

string

The specific scenario that triggers the lifecycle hook. Valid values:

  • DirectToScalingGroup: The instance is directly added to the scaling group during scale-out.

  • DirectToWarmPool: The instance is added to the warm pool during scale-out.

  • WarmPoolToScalingGroup: The instance is added to the scaling group from the warm pool during scale-out.

  • ScalingGroupToTerminate: The instance is directly removed from the scaling group and released during scale-in.

  • WarmPoolToTerminate: The instance is directly removed from the warm pool and released during scale-in.

  • ScalingGroupToWarmPool: The instance is removed from the scaling group and reclaimed to the warm pool during scale-in.

DirectToScalingGroup

LifecycleHookId

string

The ID of the lifecycle hook.

ash-bp19d1032y9kij96****

LifecycleHookName

string

The name of the lifecycle hook.

lifecyclehook****

LifecycleHookStatus

string

The status of the lifecycle hook. Valid values:

  • Active: Enabled.

  • InActive: Paused.

Active

LifecycleTransition

string

The type of scaling activity associated with the lifecycle hook.

SCALE_OUT

NotificationArn

string

The identifier of the Notification Recipient for the lifecycle hook. The parameter format is as follows:

  • No notification configured: acs:ess:{region-id}:{account-id}:null/null.

  • Message Service (MNS) queue: acs:mns:{region-id}:{account-id}:queue/{queuename}.

  • MNS topic: acs:mns:{region-id}:{account-id}:topic/{topicname}.

  • Operation Orchestration Service (OOS) template: acs:oos:{region-id}:{account-id}:template/{templatename}.

  • EventBridge: acs:eventbridge:{region-id}:{account-id}:eventbus/default.

Variables in the parameter format have the following meanings:

  • region-id: The ID of the region where the scaling group resides.

  • account-id: The Alibaba Cloud account ID.

  • queuename: The name of the MNS queue.

  • topicname: The name of the MNS topic.

  • templatename: The name of the OOS template.

acs:ess:cn-beijing:161456884340****:null/null

NotificationMetadata

string

The fixed string information for the wait state of the scaling activity.

Test Lifecycle Hook.

ScalingGroupId

string

The ID of the scaling group.

asg-bp1igpak5ft1flyp****

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries returned per page.

50

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

The total number of lifecycle hooks.

1

Examples

Success response

JSON format

{
  "LifecycleHooks": {
    "LifecycleHook": [
      {
        "DefaultResult": "CONTINUE",
        "HeartbeatTimeout": 60,
        "LifecycleActionSources": {
          "LifecycleActionSource": [
            "DirectToScalingGroup"
          ]
        },
        "LifecycleHookId": "ash-bp19d1032y9kij96****",
        "LifecycleHookName": "lifecyclehook****",
        "LifecycleHookStatus": "Active",
        "LifecycleTransition": "SCALE_OUT",
        "NotificationArn": "acs:ess:cn-beijing:161456884340****:null/null",
        "NotificationMetadata": "Test Lifecycle Hook.",
        "ScalingGroupId": "asg-bp1igpak5ft1flyp****"
      }
    ]
  },
  "PageNumber": 1,
  "PageSize": 50,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TotalCount": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.