Auto Scaling Deployment Basics
Auto Scaling groups can be created in many ways:
- AWS console
- AWS CLI
- AWS APIs
Life Cycle Hooks
Auto Scaling Life Cycle Hooks allow you to control the timing of launch and termination of your auto scaling instances.
Launch Configurations allow us to set details regarding the creation of your AutoScaling instances.
Let's create a Launch Configuration in the console:
First, navigate to EC2 inside the AWS console. In the left side bar scroll down to the Auto Scaling section. There you will find Launch Configuration.
Next we will click the 'Create launch configuration' button:
We will then then to select the AWS AMI that we want to use for our Launch Configuration:
You will then need to select the size of instance you want, then your Configuration Details:
Lets look carefully at this page: - Name: This is your one shoot to name your Launch Configuration, you can't change it latter! I have found this out the hard way! :( - IAM role: This is useful if you want to assign a role to the EC2 instances in the group, for example you may want the instances to have access to S3 storage, or you may need an application on the instances to have the ability to access SQS to create messages. - Monitoring: If you want AWS CloudWatch enabled on the machines make sure to check this box.
- Advanced Details: There are two options I want to point out in here.
- User Data: This is where you would put any bash scripting that you want you machines to run on start up. I don't know why AWS calls it this. They could have called it any number of things: Start up script, Start up commands...but they didn't. User Data it is.
- IP Address Type: this is where you select whether the instances should have a public IP address or not. Most of the time you will setup your auto scaling group behind a load balancer, but there may be times especially when testing configurations that you want a public IP so that you can ssh into the machines directly.