AWS Auto Scaling Group, How to create and configure it? | Clickittech

AWS Auto Scaling Group, How to create and configure it?

By AWS Leave a comment
AWS Auto Scaling Group

The creation of an AWS AutoScaling Group is just the final step to accomplish the creation and configuration of a High-Performance WordPress with AutoScaling. This blog post will help you to create and configure an AWS AutoScaling Group; a collection of Amazon Ec2 instances with similar characteristics among them in just a group. These instances are treated as a logical group for porpuses of scaling and management.

Keep in mind that this is the 6th, and final, Part of the sequence How to create a High-Performance WordPress with Autoscaling on AWS.

Requirements:

  • Account in AWS

Step by step:

  1. Log in to the AWS account, it is recommended with a user with certain permissions, not with root user. Use the user’s access link (for example, https://xxxxxxxxxxxx.signin.aws.amazon.com/console).

 

aws-autoscaling-group-01

*Note: The account should be self-completed with a 12-digit number, change your username and password.

  1. Verify the region in which the infrastructure will be created. In the upper right corner, click on the button with the city name and choose the region, in this case, it will be Virginia.

 

aws-autoscaling-group-02

 

  1. Select the EC2 service.

 

aws autoscaling group-03

 

  1. First, you must create an image of the instance (AMI), select “Instances”.

 

aws autoscaling group-04

 

  1. Select the instance.

 

aws autoscaling group-05

 

  1. Press “Actions”> “Image”> “Create Image”.

 

aws autoscaling group-06

 

7. Assign a name to the AMI, description and activate the option “No reboot”, the latter to prevent the instance from restarting when creating the AMI.

 

 

aws autoscaling group-07

 

8. Verify that the AMI has been created successfully, select “AMIs” from the side menu.

 

aws autoscaling group-08

 

  1. Check that the “Status” is “available”.

 

aws autoscaling group-09

 

10. The next step is to create the Auto Scaling Group; select “Launch Configurations” from the side menu.

 

aws autoscaling group-10

 

  1. Click on “Create AWS Auto Scaling Group”.

 

aws autoscaling group-11

 

  1. Press “Create Launch Configuration”.

 

aws autoscaling group-12

 

  1. Select “My AMIs” and the previously created AMI.

 

aws-autoscaling-group-13

 

14. Select the type of instance desired for the slave instances (slaves) created by the Auto Scaling Group and press “Next: Configure details”.

 

aws-autoscaling-group-14

 

15. Assign a name to the launch configuration (Launch configuration).

 

aws autoscaling group-15

 

16. In advanced details, in the “User data” section write the commands to mount the EFS and select the option where no public IP is assigned to any instance. Finally press “Next: Add Storage”.

 

aws autoscaling group-16

 

*Note: The MOUNT command is the same that AWS provided when mounting the EFS on the master instance, be sure to mount the desired one.

  1. The volume (disk) that will be assigned to the instances created by the Auto Scaling group will have a copy of the volume of the master instance. Press “Next: Configure Security group”.

 

aws-autoscaling-group-17

 

18. Select the option “Select an existing security group” to assign the same Security Group of the master instance, in this case, it will be sg-78920606.

 

aws autoscaling group-18
aws-autoscaling-group-18.1

 

19. Check that the settings are correct and create the launch configuration by pressing “Create launch configuration”.

 

aws-autoscaling-group-20

 

*Note: The warning is caused by the Security Groups because it can ensure even more to the instances and infrastructure in general, but taking this tutorial as a basic one can be advanced in this way.

  1. Choose an existing key and accept that you have access to it; create the launch configuration.

 

aws-autoscaling-group-20

 

  1. The next thing is to configure the Auto Scaling group; Name the group of instances, determine the number of instances with which it will start, select the VPC and the private subnet, you must also specify that the traffic will come from a Load Balancer so that the “slave” instances are automatically added to it. Press “Next: Configure scaling policies.”

 

aws-autoscalin-group-21
aws autoscalin group-21.1

 

22. Adjust group policies.

    1. Determine the maximum number of possible instances in the group.
aws autoscalin group-22.1

 

2. Add a new alarm for the increase of instances:

Create a topic (topic) to which name is assigned and emails to which they will be notified (if they are two or more, separate them with commas), establish the maximum percentage in a period of time, name the alarm and create it.

 

aws-autoscalin-group-22.2

 

3. In “Take the action” we establish that it increases the number of instances by 1 in 1.

 

aws-autoscalin-group-22.3

 

4. Add a new alarm for the decrement of instances:

Create a topic (topic) to which name is assigned and emails to which they will be notified (if they are two or more, separate them with commas), establish the minimum percentage in a period of time, name the alarm and create it.

 

aws-autoscalin-group-22.4

 

*Note: Change the “> =” (greater or equal) by a “<=” (less or equal) in the alarm to decrease the number of instances.

5. In “Take the action” we establish that the number of instances should decrease from 1 to 1; press “Next: Configure Notifications”.

aws-autoscalin-group-22.5

 

23. If you want to receive notifications when an instance is created or deleted, add a notification. On this occasion, you will not configure an extra alarm. Press “Next: Configure Tags”.

aws-autoscalin-group-23

 

  1. Optionally you can add a name to the Auto Scaling group, as shown in the following screenshot.

 

aws-autoscalin-group-24

 

  1. Review the configuration and create the Auto Scaling group.

 

aws-autoscalin-group-25

 

  1. In a few minutes, you can see in “Instances” the instance that is created automatically.

 

aws-autoscalin-group-26

 

*Note: Wait until your state is “running”.

Conclusion

Those are all the steps that you need to follow to create an AWS AutoScaling Group. The creation of an AutoScaling Group was the final step to accomplish a High-Performance and Auto scalable WordPress. Do not forget to see the complete process of How to create a high-performance and Auto-scalable WordPress, and the other previous tutorials we have prepared for you (IIIIIIIV, V).

Implement a high-performance and AutoScalable WordPress with us!

  • Speed ​​of server for loading pages.
  • Low probability of WordPress failure.
  • It modifies the number of instances it needs.

Tagged under: