paws.management (version 0.1.0)

autoscaling_detach_instances: Removes one or more instances from the specified Auto Scaling group

Description

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

Usage

autoscaling_detach_instances(InstanceIds, AutoScalingGroupName,
  ShouldDecrementDesiredCapacity)

Arguments

InstanceIds

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

AutoScalingGroupName

[required] The name of the Auto Scaling group.

ShouldDecrementDesiredCapacity

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

Request syntax

svc$detach_instances(
  InstanceIds = list(
    "string"
  ),
  AutoScalingGroupName = "string",
  ShouldDecrementDesiredCapacity = TRUE|FALSE
)

Details

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.

Examples

Run this code
# NOT RUN {
# This example detaches the specified instance from the specified Auto
# Scaling group.
# }
# NOT RUN {
svc$detach_instances(
  AutoScalingGroupName = "my-auto-scaling-group",
  InstanceIds = list(
    "i-93633f9b"
  ),
  ShouldDecrementDesiredCapacity = TRUE
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace