Auto-scaling Implementation
Purpose
Adding an auto-scaling Mechanism for a web server
Steps
Create an ELB (how to), but no need to register instances as balancing targets at this moment.
Launch Configuration
On EC2 Dashboard page -> left side "AUTO SCALING" -> "Launch Configurations" -> "Create launch configuration". (Most of the steps are similar to creating EC2.)
On "Configure details" page:
Give configuration name
Grant IAM Role with privileges if needed. (In this example it's "AmazonS3FullAccess".)
Create a web server. (Refer to 3.(3) of this article)
Following constructions to complete settings and click "Create Launch Configuration".
Create Auto Scaling Group
On EC2 Dashboard page -> left side "AUTO SCALING" -> "Auto Scaling Group" -> "Create Auto Scaling Group":
Give a group name
Add subnet items (each subnet maps to an AZ).
"Advanced Details":
Tick "Receive traffic from one or more load balancers", and select target groups created in step 1.
Set "Health Check Grace Period" seconds with appropriate time for instances to initialize.
On "Configure scaling policies" page, choose to keep a fixed number of instances or criteria to increase / decrease group size.
On "Configure Notifications" page, set up notification criteria.
Follow instructions to complete auto scaling group setting, and go back to EC2 dashboard or browse to ELB DNS name to see the result.
Last updated