All Products
Search
Document Center

Auto Scaling:ModifyLifecycleHook

Last Updated:Aug 28, 2026

Modifies a lifecycle hook. You can change the scaling activity type, timeout period, and default action. Specify the target hook by its ID, name, or scaling group.

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:ModifyLifecycleHook

update

*ScalingGroup

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

None None

Request parameters

Parameter

Type

Required

Description

Example

LifecycleHookId

string

No

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

ash-bp1fxuqyi98w0aib****

ScalingGroupId

string

No

The ID of the scaling group to which the lifecycle hook belongs.

asg-bp18p2yfxow2dloq****

LifecycleHookName

string

No

The name of the lifecycle hook that you want to modify.

test_SCALE_IN

DefaultResult

string

No

The action that Auto Scaling performs after the lifecycle hook times out. Valid values:

  • CONTINUE: Auto Scaling continues to respond to scaling requests.

  • ABANDON: Auto Scaling releases ECS instances created during scale-out activities, or removes ECS instances from the scaling group during scale-in activities.

If multiple lifecycle hooks in a scaling group are triggered during scale-in activities and you set DefaultResult to ABANDON, Auto Scaling immediately performs the action after this hook ends, causing other lifecycle hooks to end ahead of schedule. Otherwise, Auto Scaling performs the action only after all lifecycle hooks end.

CONTINUE

HeartbeatTimeout

integer

No

The timeout period of the lifecycle hook. Auto Scaling performs the default action when this period expires. Valid values: 30 to 21600. Unit: seconds.

Call RecordLifecycleActionHeartbeat to extend the timeout, or CompleteLifecycleAction to end a lifecycle hook early.

600

LifecycleTransition

string

No

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

  • SCALE_OUT

  • SCALE_IN

SCALE_IN

NotificationMetadata

string

No

A fixed string included in notifications that Auto Scaling sends when the lifecycle hook takes effect. Maximum length: 4,096 characters.

Use this parameter to categorize notifications. Takes effect only when NotificationArn is specified.

Test

NotificationArn

string

No

The Alibaba Cloud Resource Name (ARN) of the notification recipient. Valid formats:

  • SMQ (formerly MNS) queue: acs:mns:{region-id}:{account-id}:queue/{queuename}

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

  • OOS template: acs:oos:{region-id}:{account-id}:template/{templatename}

  • Event bus: acs:eventbridge:{region-id}:{account-id}:eventbus/default

Variables:

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

  • account-id: your Alibaba Cloud account ID.

  • queuename: the name of the SMQ queue.

  • topicname: the name of the SMQ topic.

  • templatename: the name of the OOS template.

acs:mns:cn-beijing:161456884340****:queue/modifyLifecycleHo****

RegionId

string

No

The region ID of the scaling group.

cn-beijing

LifecycleHookStatus

string

No

The status to set for the lifecycle hook. Valid values:

  • Active

  • InActive

If not specified, the status remains unchanged.

Note

Lifecycle hooks are Active by default after creation.

Active

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.