Modifies a lifecycle hook.
Operation description
You can use one of the following methods to specify the lifecycle hook that you want to modify:
- Specify the lifecycle hook ID by using the LifecycleHookId parameter. When you use this method, the ScalingGroupId and LifecycleHookName parameters are ignored.
- Specify the scaling group ID by using the ScalingGroupId parameter and specify the lifecycle hook name by using the LifecycleHookName parameter.
Debugging
Authorization information
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 times out. Valid values:
If a scaling group has multiple lifecycle hooks in effect and you set the DefaultResult parameter for one of the lifecycle hooks to ABANDON or ROLLBACK, the following rule applies to scale-in activities: When the lifecycle hook whose DefaultResult parameter is set to ABANDON or ROLLBACK times out, other lifecycle hooks time out ahead of schedule. In other cases, Auto Scaling performs the action only after all lifecycle hooks time out. The action that Auto Scaling performs is specified by the DefaultResult parameter of the last lifecycle hook that times out. | CONTINUE |
HeartbeatTimeout | integer | No | The period of time before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action specified by the DefaultResult parameter. Valid values: 30 to 21600. Unit: seconds. You can call the RecordLifecycleActionHeartbeat operation to extend the period of time before a lifecycle hook times out. You can also call the CompleteLifecycleAction operation to end a lifecycle hook ahead of schedule. | 600 |
LifecycleTransition | string | No | The type of the 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 of the NotificationMetadata parameter together with the notification. This helps you categorize your notifications. If you specify the NotificationMetadata parameter, you must also specify the NotificationArn parameter. | Test |
NotificationArn | string | No | The Alibaba Cloud Resource Name (ARN) of the notification method.
The variables in the preceding 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 that you want to specify for 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 | see changesets | ||||
|