Modifies a lifecycle hook. If an existing lifecycle hook does not meet your business requirements anymore, you can call the ModifyLifecycleHook operation to modify the information such as the scaling event, timeout period, and default action of the lifecycle hook. Before you modify a lifecycle hook, you can locate the lifecycle hook by its ID, name, or scaling group.
Operation description
You can use one of the following methods to locate the lifecycle hook that you want to modify:
- Specify LifecycleHookId. In this case, ScalingGroupId and LifecycleHookName are ignored.
- Specify ScalingGroupId and LifecycleHookName. Each lifecycle hook within a scaling group has a unique name.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ess:ModifyLifecycleHook | update |
|
| 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 you want Auto Scaling to perform after the lifecycle hook ends. Valid values:
If multiple lifecycle hooks in a scaling group are triggered during scale-in activities and you set the DefaultResult parameter to ABANDON for the lifecycle hook that you want to modify, Auto Scaling immediately performs the action after the lifecycle hook that you want to modify ends. As a result, other lifecycle hooks end ahead of schedule. In other cases, Auto Scaling performs the action only after all lifecycle hooks end. | CONTINUE |
HeartbeatTimeout | integer | No | The period of time before the lifecycle hook ends. Auto Scaling performs the specified action after the lifecycle hook ends. Valid values: 30 to 21600. Unit: seconds. You can call the RecordLifecycleActionHeartbeat operation to prolong the length of a lifecycle hook. You can also call the CompleteLifecycleAction operation to end a lifecycle hook ahead of schedule. | 600 |
LifecycleTransition | string | No | The type of scaling activity to which the lifecycle hook applies. Valid values:
| SCALE_IN |
NotificationMetadata | string | No | The fixed string that is included in a notification. Auto Scaling sends the notification when the lifecycle hook takes effect. The value of this parameter cannot exceed 4,096 characters in length. Auto Scaling sends the value specified for the NotificationMetadata parameter together with the notification. This helps you categorize your notifications. The NotificationMetadata parameter takes effect only after you specify the NotificationArn parameter. | Test |
NotificationArn | string | No | The Alibaba Cloud Resource Name (ARN) of the notification method. Specify the value in one of the following formats:
The variables in the preceding parameter formats have the following meanings:
| acs:mns:cn-beijing:161456884340****:queue/modifyLifecycleHo**** |
RegionId | string | No | The region ID of the scaling group. | cn-beijing |
LifecycleHookStatus | string | No | The status into which you want to put the lifecycle hook. Valid values:
If you do not specify this parameter, the status of the lifecycle hook remains unchanged after you call this operation. Note
By default, a lifecycle hook is in the Active state after you create it.
| Active |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-10-13 | The request parameters of the API has changed | View Change Details |