Creating Auto Scaling group using Ec2

Auto Scaling with Ec2

You will need the following to complete this lab.

  • An AWS account
  • AWS Management Console

The first objective I will complete is the creation of a VPC. Choose VPC w/Subnets,etc. and give the VPC a name and CIDR address. I will be using 10.10.0.0/16 as my starting point for IP Addressing.

Name and IP starting point added

Preview the resources that will created below.

Chart of VPC/ Subnets
VPC Details

Launch Configuration:

Go to EC2 console and click on Launch Configuration from Auto Scaling group. Name the launch configuration and give it a description. Check the box below to have guidance with creating Auto Scaling.

Auto Scaling Launch Template

Choose AMI, select the Amazon Machine Image from AMI catalog tab, which is used to create the image for your web application. Then, select the instances type which is suitable for your web application and click Next: Configure details.

OS Image

Next, under network I will create the security groups Inbound/ Outbound rules

Security group creation

Next, the bootstrap script that runs just once to startup Apache Web Server.

Boot Strap to create the Apache Web Server
Availability zones/ Public Subnets added us-east-1a 10.10.0.0/20 and us-east-1b 10.16.0.0/20 added to configuration.

Here I have configured the settings for the minimum and maximum size for the Auto Scaling group.

group size

Scaling Policies

Scaling Policies

Now we will view the scaling group in the AWS console.

Scaling group creation
Above is the instance summary you can see at the bottom of window auto scaling group has been created.
The bootstrap ran successfully as evidenced by the Apache Web page being available.

As you can see below CloudWatch has been created to monitor the cpu activity on the Auto Scaling group that is now up and running.

CloudWatch alarm created for Auto Scaling group.
Auto Scaling group alarm history

The Auto Scaling project has been a success; as evidenced by all of the infrastructure that has been created and the CloudWatch tracking of the Auto Scaling groups metrics.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store