We are trying to limit our consumption of AWS resources. We could stop and start our EC2 instances at night and start them in the morning using a lambda function.
The function works very well for all EC2 except those in an automatic scaling group. They will restart after the function has stopped them.
We are thinking of setting the desired capacity value of the automatic scaling group to 0 at night and resetting the old value in the morning.
My question:
Where can I save the old value of the auto scaling group for reuse ?
Is there a better way to do it?