aws setting up autoscaling group - to scale your instance


To create autoscaling, first we need to 

- Create launch template 

- Create EC2 Autoscaling group

To create your launch template, please goto your AWS Ec3 page and then select Launch template -> Create launch template. 

Provide a name for your template. 

Then under Auto scaling guidance select the checkbox. 

Select your Image - Amazon Linux 2 (HVM) would be good. As for instance type, select the free tier for testing purposes. 

Select your key pair 

Under network settings - this is a quite tricky part - Add network interface. 

In the section Auto-assign public ip -> choose disable. 

For security group id -> select the VPC for Auto-scaling group.

And for Delete on termination, choose "Yes". 

Skip to review and the choose Create Auto scaling group.


2. Crate single instance Auto scaling group.

In Ec2 select Create Autoscaling group. Enter a name for it. 

Choose instance launch option

In the network, select default VPC for your AWS region. 

As for Availability Zones and subnet, you can select multiple. In the instance type, ensure you're using the template (not overriding it). 

You can configure the min and max for group autoscaling. Also possible to configure the networks before it scales up.

Skip to review. 

Click "Create Auto scaling group". 

Once you hit create, you can see your instance being provision under "Autoscaling group" -> check the autoscaling group name and look under Activity. The status should be "Successful" if everything is good. Otherwise it would be in pending state. 


Try to remove the current instance. It takes about 2 min for new instance to be re-created. Not a really fun time when you're in a P1 incident. 

You can also goto Ec2 -> Instances -> Instance to see the history of what's being deleted and re-provisioned as shown below

























Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm