Modifies the information of a lifecycle hook.
Operation description
Operation description
You can specify the lifecycle hook to modify in one of the following ways:
-
Specify only the lifecycle hook ID (LifecycleHookId). The scaling group ID (ScalingGroupId) and lifecycle hook name (LifecycleHookName) parameters are ignored.
-
Specify both the scaling group ID (ScalingGroupId) and 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 that you want to modify. 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 that you want to modify. This parameter is used to specify the lifecycle hook. |
test_SCAL**** |
| DefaultResult |
string |
No |
The action that Auto Scaling takes when the lifecycle hook times out. Valid values:
When a scale-down activity (SCALE_IN) occurs in a scaling group and triggers multiple lifecycle hooks, if the DefaultResult of a lifecycle hook is set to ABANDON or ROLLBACK and the wait state of the hook ends, the wait states of the other lifecycle hooks end early. In other cases, the action is determined by the last lifecycle hook whose wait state ends. |
CONTINUE |
| HeartbeatTimeout |
integer |
No |
The wait time that the lifecycle hook sets for the scaling activity. After the wait state times out, the default action is taken. Valid values: 30 to 21600. Unit: seconds. You can call RecordLifecycleActionHeartbeat to extend the wait time for an ECS instance, or call CompleteLifecycleAction to end the wait state of a scaling activity early. |
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 that is associated with the wait state of a scaling activity. The parameter value cannot exceed 4,096 characters in length. Each time Auto Scaling pushes a message to the Notification Recipient, it also sends the NotificationMetadata parameter value that you specify. This helps you manage and mark notifications of different categories. 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. This parameter supports the following notification methods:
The variables in the parameter format are described as follows:
|
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 which you want to change the lifecycle hook. Valid values:
If you do not specify this parameter, the lifecycle hook retains its current status. Note
After a lifecycle hook is created, it is in the Active state by default. |
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.