AWS Autoscaling

Overview

Lets go over a series of steps to setup AWS Autoscaling. Please refer here for a complete tutorial

Custom AMI

AMI refers to Amazon Machine Image and we can create a custom AMI from an existing instance where our required softwares are installed. Create it from EC2 instances page.

Give a name and create:

You can view the AMIs from the left menu or selecting My AMIs while launching a new Image.

Load Balancer

Select Load Balancer from left menu and click on Create Load Balancer

Select Application Loadbalancer

Next screen, add name, port and VPC details. Select Joan VPC and select both subnets we have. Click Next and Next

Create an new Security Group for the load balancer in next page and click Next

Create a target group in next page, use the same port and add a health check api details if necessary. Then click Next

Next page, add the instances as Registered Targets and click Review and then Create

Enable Stickiness

Lets enable stickiness so that Load balancer routes the request from same user to same instance. Click on Target Groups. and open the target group.

Click on Edit next to Attributes, check the Stickiness and click "Save Changes"

Auto Scaling

Launch Configuration

Goto left menu in EC2 dashboard and select Launch Configuration. Then click "Create a launch configuration". You can create Launch templates, but here we will create Launch configuration itself.

Click on Advanced Details for docker container startup information. add the bash terminal commands

Select existing ec2 security group

Choose existing ec2 keypair and click Create launch configuration and Launch cofiguration would be created

Auto Scaling Group

Goto Ec2 dashboard and click on Auto Scaling Groups on left Menu. The click "Create an Auto Scaling group". Click on Switch to launch configuration

Enter name and select launch configuration, click Next

Next page, select early created VPC and select both subnets so that the traffic would be routed to both of them

Enable Load balancing in next page and select previously created appropriate target group. then click Next

Next page, specify the grouping size

Next page, you may add a Notification or Skip it. After review, click Create Auto Scaling Group

The Auto Scaling Group is now created

You can see the instance details from Instance Management

Click on Target Groups and open Targets in the desired target group. You can see the instances

Click on the Load Balancers from left menu and open the desired load balancer. Then use the DNS name to access the application.

Similar Posts

  • |

    AWS Create an EC2 Instance

    Overview Create an EC2 instance for Spring boot application Create EC2 Lets create an EC2 instance. Goto EC2 dashboard and click on “Launch Instance” Select the Instance Type and click Next. We are going with free tier here: Next screen : Start with 1 instanceNetwork – select joan-vpcSubet – Either oneOther options leave for now…

  • | | |

    Deploying a Docker (Java Spring Boot) application to AWS

    Overview Here we will deploy a Java Spring Boot Docker application into AWS infrastructure Create a VPC Create a VPC first as described here EC2 Create an instance and associate an elastic IP address here Docker Install Docker for Amazon Linux 2 sudo amazon-linux-extras install docker Start the docker sudo service docker start Add the ec2-user to…

  • |

    Aws Core Services

    Overview To identify some of the most commonly used services by developers Elastic Cloud Compute (EC2) Amazon EC2 is a web service that provides secure, resizable compute capacity in the cloud. https://aws.amazon.com/ec2/ Simple Storage Service (S3) Amazon S3 is an object storage service that offers scalability, data availability, security, and performance. https://aws.amazon.com/s3/ Relational Database Service…

  • |

    AWS Cloudwatch

    Overview AWS Cloudwatch is a monitoring tool that let you sleep peacefully while doing the watch for you. You can use it set Alarms & Notifications and do actions in response to events, You can get alerts regarding your EC2 instance, Billing updates or other resources. You can also set actions in response to CloudWatch…

Leave a Reply

Your email address will not be published. Required fields are marked *