Scaling an application based on demand
In this section, we are going to see some real-time dynamic scaling. In this example, you will see how to dynamically scale by modifying an existing scaling group. These are the steps you need to follow:
- Go back to the Auto Scaling console and click on an existing auto-scaling group (for example, prod-asg):
- Click on Automatic scaling and then Add policy:
- In the next step, we need to create a scaling policy that will add an additional instance based on demand. Fill in the following details:
- Policy type: From the dropdown, select Step scaling.
- Scaling policy name: Give a meaningful name to your policy (for example,
asg-scale-in
).- CloudWatch alarm: We are going to come back to this shortly.
- Take the action: From the dropdown, select Add and in the box, choose 1 (this is going to add one instance based on the CloudWatch trigger):