DetachInstances#

Description#

Request to detach instances from Auto Scaling Group (ASG).

If the option to reduce the desired capacity of the ASG is disabled in the request, the parameter value will not change, and new instances will be created instead of the detached ones. If the option is enabled, the desired capacity of the ASG will be reduced by the number of instances to be detached. If the resulting value is less than the minimum capacity, the detachment will fail and the request will return an error.

Request Parameters#

  • AutoScalingGroupName — The name of the ASG.

    • Type: String

    • Required: Yes

  • InstanceIds — List of instance IDs.

    • Type: Array of strings

    • Required: Yes

    • Maximum number of elements: 20

  • ShouldDecrementDesiredCapacity — Indicates whether the desired capacity of the ASG is reduced after detachment.

    • Type: Boolean

    • Required: Yes

Response Elements#

  • Activities — List of the activities.

Examples#

c2-as DetachInstances AutoScalingGroupName "asg_name" InstanceIds.1 "i-xxxxxxxx" ShouldDecrementDesiredCapacity True