I have created ec2 instance and it's part of the auto scaling group and i want to stop this instance so i can save money while this server being not used.Whenever i want to use this server that time i can start the instance.
-
1Did you tried scheduled scaling for ASG? [docs](https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) – Yupik May 25 '21 at 10:05
-
Sadly you can't stop it while in asg. You have to detach it first from asg – Marcin May 25 '21 at 10:06
-
if i'll detach instance then i can attach again the same instance to the asg ? @Marcin – Amin Ali May 25 '21 at 10:13
-
I've noticed that you have lots of questions with answers, yet not a single answer was ever accepted. Accepting good answers is not only a good practice, but it also reduced duplicates and makes your questions more likely to be answered. – Marcin May 28 '21 at 10:41
2 Answers
AutoScaling Group is able to take care of this process for you.
You can change the size of the group manually, or you could schedule custom configurations to scale-up or scale-down as per your needs.
This is all supported through AWS APIs, so you can do this through AWS Console or automating the configuration.

- 1,759
- 16
- 27
Instances in ASG can't be stopped. If you want to stop one instance you have to detach it from ASG. When you are ready to start it, you can attach it again.
But really, you should reconsider how you use ASG. Detaching and re-attaching instances from ASG is meant for mostly troubleshooting purposes, not something you do regulatory just to save cost. Its better to set minimum and desired capacity of ASG to 0 if you don't want any instance in it.

- 215,873
- 14
- 235
- 294