v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14130373603.9 KB

Removes one or more instances from the specified Auto Scaling group.

After the instances are detached, you can manage them independent of the Auto Scaling group.

If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are detached.

If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups.

For more information, see Detach EC2 instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

get/#Action=DetachInstances

Query parameters

InstanceIdsXmlStringMaxLen19[]

The IDs of the instances. You can specify up to 20 instances.

AutoScalingGroupNamestring required

The name of the Auto Scaling group.

ShouldDecrementDesiredCapacityboolean required

Indicates whether the Auto Scaling group decrements the desired capacity value by the number of instances detached.

Action'DetachInstances' required
Version'2011-01-01' required

Response

Success