All Products
Search
Document Center

Auto Scaling:DescribeLifecycleHooks

Last Updated:Aug 28, 2026

Queries lifecycle hooks. When you call this operation, you can specify the lifecycle hook ID or scaling group ID to query the details of the desired lifecycle hook, such as the default action after the lifecycle hook times out, scaling activity that corresponds to the lifecycle hook, Alibaba Cloud Resource Name (ARN) of the notification recipient, and effective period of the lifecycle hook.

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 number of the page to return. Pages start from page 1.

Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page. Maximum value: 50.

Default value: 50.

50

LifecycleHookIds

array

No

The IDs of the lifecycle hooks that you want to query.

string

No

The ID of the lifecycle hook that you want to query.

ash-bp1at9ufhmcf9cmy****

RegionId

string

No

The region ID of the scaling group.

cn-beijing

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

PageNumber

integer

The page number of the returned page.

1

PageSize

integer

The number of entries returned per page.

50

TotalCount

integer

The total number of lifecycle hooks.

1

LifecycleHooks

array<object>

Details about the lifecycle hooks.

object

Details about the lifecycle hook.

DefaultResult

string

The next action that is performed after the lifecycle hook times out.

CONTINUE

LifecycleHookId

string

The ID of the lifecycle hook.

ash-bp19d1032y9kij96****

LifecycleHookName

string

The name of the lifecycle hook.

lifecyclehook****

LifecycleTransition

string

The type of the scaling activity to which the lifecycle hook applies.

SCALE_OUT

NotificationMetadata

string

The fixed string that is included in a notification that Auto Scaling sends when the lifecycle hook takes effect.

Test Lifecycle Hook.

NotificationArn

string

The ARN of the notification recipient when the lifecycle hook takes effect. The value of this parameter must be in one of the following formats:

  • If you do not create a notification rule, specify the value in the acs:ess:{region-id}:{account-id}:null/null format.

  • If you specify a Simple Message Queue (SMQ, formerly MNS) queue as the notification recipient, specify the value in the acs:mns:{region-id}:{account-id}:queue/{queuename} format.

  • If you specify an SMQ as the notification recipient, specify the value in the acs:mns:{region-id}:{account-id}:topic/{topicname} format.

  • If you specify a CloudOps Orchestration Service (OOS) template as the notification recipient, specify the value in the acs:oos:{region-id}:{account-id}:template/{templatename} format.

  • If you specify an event bus as the notification recipient, specify the value in the acs:eventbridge:{region-id}:{account-id}:eventbus/default format.

The variables in the preceding value formats have the following meanings:

  • region-id: the region ID of your scaling group.

  • account-id: the ID of your Alibaba Cloud account.

  • queuename: the name of the SMQ queue.

  • topicname: the name of the SMQ topic.

  • templatename: the name of the OOS template.

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

HeartbeatTimeout

integer

The period of time before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action that is specified by DefaultResult.

60

ScalingGroupId

string

The ID of the scaling group.

asg-bp1igpak5ft1flyp****

LifecycleHookStatus

string

The status of the lifecycle hook. Valid values:

  • Active: The lifecycle hook is enabled.

  • InActive: The lifecycle hook is disabled.

Active

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.