i have an aws asg -> config : min=2 , max=2 , desired capacity =2 I did this
set an instance with scale-in protection.
suspended process of launch and ReplaceUnhealthy to avoid creation of new instancetermination of stopped instance.
aws autoscaling set-instance-protection --instance-ids i-xxxxxxxxxxxx --auto-scaling-group-name xxxxxxxxxxxxxxxx --protected-from-scale-in aws autoscaling suspend-processes --auto-scaling-group-name xxxxxxxxxxxxxxxxxxx --scaling-processes Launch ReplaceUnhealthy aws ec2 stop-instances --instance-ids i-xxxxxxxxxxxxxx
all good so far. now to revert back the changes i did
aws ec2 start-instances --instance-ids xxxxxxxxxxxxxxxxxxx
instance is started again
aws autoscaling resume-processes --auto-scaling-group-name xxxxxxxxxxxxxxxxxxxxxxxxxx --scaling-processes Launch ReplaceUnhealthy
- Now after this command asg launches a new instance which makes it 3 and then delete the old instance which should not happen, new instance should not be launched, and just old instance should be started again.
- so that means scale-in protection is not working.
why scale-in doesn't work, what condition it needs to fulfill to protect that instance which was started again to prevent getting terminated and prevent the new instance from being launched.