ModifyLifecycleHook
Modifies the information of a lifecycle hook.
Operation description
Operation description
You can specify the lifecycle hook to be modified in one of the following ways:
-
Specify only the lifecycle hook ID (LifecycleHookId). In this case, the scaling group ID (ScalingGroupId) and lifecycle hook name (LifecycleHookName) parameters are ignored.
-
Specify both the scaling group ID (ScalingGroupId) and the lifecycle hook name (LifecycleHookName), because the lifecycle hook name is unique within a scaling group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:ModifyLifecycleHook |
update |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| LifecycleHookId |
string |
No |
The ID of the lifecycle hook to be modified. This parameter is used to specify the lifecycle hook. |
ash-bp1fxuqyi98w0aib**** |
| ScalingGroupId |
string |
No |
The ID of the scaling group. This parameter is used to specify the lifecycle hook. |
asg-bp18p2yfxow2dloq**** |
| LifecycleHookName |
string |
No |
The name of the lifecycle hook to be modified. This parameter is used to specify the lifecycle hook. |
test_SCAL**** |
| DefaultResult |
string |
No |
The action to be performed after the wait state ends. Valid values:
When a scale-in activity (SCALE_IN) occurs in a scaling group and triggers multiple lifecycle hooks, if the DefaultResult of one lifecycle hook is set to ABANDON or ROLLBACK, the wait states of other lifecycle hooks are ended in advance when the wait state of this hook ends. In other cases, the next action is subject to the next action of the last lifecycle hook that ends its wait state. |
CONTINUE |
| HeartbeatTimeout |
integer |
No |
The wait time set by the lifecycle hook for the scaling group activity. The next action is performed after the wait state times out. Valid values: 30 to 21600. Unit: seconds. You can call the RecordLifecycleActionHeartbeat operation to extend the wait time of the ECS instance, or call the CompleteLifecycleAction operation to end the wait state of the scaling activity in advance. |
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 information for the wait state of the scaling activity. The value can be up to 4,096 characters in length. Each time Auto Scaling pushes a message to the notification recipient, it also sends the predefined NotificationMetadata value to help you manage and tag different types of notification messages. The NotificationMetadata parameter takes effect only when you also specify the NotificationArn parameter. |
Test |
| NotificationArn |
string |
No |
The identifier of the notification recipient for the lifecycle hook. The following notification methods are supported when you set this parameter:
Variables in the 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 |
Modifies the status of the current lifecycle hook. Valid values:
If you do not set this parameter, the status of the current lifecycle hook remains unchanged. Note
After a lifecycle hook is created, it is in the Active state by default. |
Active |
| LifecycleActionSources |
array |
No |
The specific scenarios triggered by the lifecycle hook. |
|
|
string |
No |
The specific scenarios triggered by the lifecycle hook. Valid values when LifecycleTransition is set to SCALE_OUT:
The default value in this case is DirectToScalingGroup. Valid values when LifecycleTransition is set to SCALE_IN:
The default value in this case is ScalingGroupToTerminate. |
DirectToScalingGroup |
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.