TerminateInstanceInAutoScalingGroup
In this article:
TerminateInstanceInAutoScalingGroup#
Description#
Terminates an instance attached to an Auto Scaling group (ASG).
If the option to decrement the desired ASG capacity is set to false, the desired number of instances in the group will not change, and a new instance will be created instead of the terminated one. If the option is set to true, the desired ASG capacity will be reduced by one.
If the resulting value is less than the minimum ASG capacity, the termination will fail and the request will return an error.
If the instance is not found in any existing ASG, the termination will fail and the request will return an error.
Request Parameters#
InstanceId — The ID of the instance.
Type: String
Required: Yes
ShouldDecrementDesiredCapacity — Indicates whether the desired capacity of the ASG is reduced after termination.
Type: Boolean
Required: Yes
Response Elements#
Activity — Активность ASG.
Type: Activity object
Examples#
c2-as TerminateInstanceInAutoScalingGroup InstanceId "i-xxxxxxxx" ShouldDecrementDesiredCapacity True