Last chance! 50% off unlimited learning
Sale ends in
Attaches one or more EC2 instances to the specified Auto Scaling group.
autoscaling_attach_instances(InstanceIds, AutoScalingGroupName)
The IDs of the instances. You can specify up to 20 instances.
[required] The name of the Auto Scaling group.
svc$attach_instances( InstanceIds = list( "string" ), AutoScalingGroupName = "string" )
When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.
If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.
For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Amazon EC2 Auto Scaling User Guide.
# NOT RUN {
# This example attaches the specified instance to the specified Auto
# Scaling group.
# }
# NOT RUN {
svc$attach_instances(
AutoScalingGroupName = "my-auto-scaling-group",
InstanceIds = list(
"i-93633f9b"
)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab