Just trying to get a bit of info on aws asg
.
Here is my scenario;
- launch an
asg
from alaunch config
using a defaultubuntu ami
- provision (install all required packages and config) the instances in the
asg
usingansible
- deploy code to the instances using
python
Happy days, every thing is setup.
The problem is if I should change the metrics of my asg
so that all instances are terminated and then change it back to the original metrics, the new instances come up blank! No packages, No code!
1 - Is this expected behaviour?
2 - Also if the asg
has 2 instances and scales up to 5 will it add 3 blank instances or take a copy of 1 of the running instances with code and packages and spin up the 3 new ones?
If 1 is Yes, how do I go around this? Do I need to use a pre-baked image? But then even that won't have the latest code.
Basically at off peak hours I want to be able to 'zero' out my asg
so no instances are running and then bring then back up again during peak hours. It doesn't make sense to have to provision and deploy code again everyday.
Any help/advice appreciated.