If the user wants to terminate two specific instances to ensure that Auto Scaling launches an instances with the new launch configuration, which command should he run?
as-delete-instance-in-auto-scaling-group
as-terminate-instance-in-auto-scaling-group
as-terminate-instance-in-auto-scaling-group
as-terminate-instance-in-auto-scaling-group
Explanations:
Theas-delete-instance-in-auto-scaling-groupcommand does not exist in AWS CLI. The correct command to terminate an instance in an Auto Scaling group isas-terminate-instance-in-auto-scaling-group.
The option–update-desired-capacityis incorrect. This option is not used with theas-terminate-instance-in-auto-scaling-groupcommand. Terminating instances with this option would not work as expected in terms of updating the group.
The option–decrement-desired-capacityis incorrect for this scenario. It would decrease the desired capacity and would prevent the Auto Scaling group from launching a new instance. The goal is to launch a new instance, not to reduce the capacity.
The option–no-decrement-desired-capacityensures that the desired capacity remains the same when terminating an instance. This allows Auto Scaling to launch a new instance with the updated launch configuration.