AWS Auto scaling without Load Balancer
Tags: linux, devops, aws, asg
Published: 2023-11-27 18:15:37

- Create a instance with Ubuntu OS and with instance type as t2.nano and selected the existing key pair and security group and set 2 instance to create and launch.

- Run the apdt update and install apache webserver and modify the index.html
`sudo apt update`
`sudo apt install apache2 -y`
`sudo rm /var/www/html/index.html`
`sudo vim /var/www/html/index.html`
`<h1>Testing for Auto Scaling Group</h1>`

- Go to Action >Image and Template > Create Image

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/endrfhkuplhgv0knn549.png)

- set as noboot and create image

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/diyv3hup7s6wpnt6d5r0.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzh44jqu3jbcjok8soy1.png)

- Once image created Stop and Terminate the instance which we created

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/er7zw9tzef2ftyxirq6r.png)

- Instance >Launch template >Create the launch template>Select AMI image.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9eyk50vqb9ht3ixo8c26.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vf04b3l1fixc5odi8x8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kr966qewwwpksrj9vn2l.png)

- Instance type s t2.nano>select keypair >Existing security group> Advance Network Configuration >Enable "Auto Assign IP"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xvyg0d3lf3xf78vgck0.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/849zsqow9yrn7udeykay.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akfq6z83ypmjdchs87hz.png)

- Create Auto scaling Group >Select the template >Select all network availability zone >Select No Load balancing.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sav08ej1ct48mz2a4ms5.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w9fgdjki9ycf8c0go9n.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iidp50wmogrt0zuxpb6o.png)

- Group size >Desired capacity as 1 >No scaling policies

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3af0crpcjexd4npk4q0k.png)

- Select instance maintance policy as "Launch before Terminating"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtrvbkwppayxpx26xx1g.png)

- Add Notification >Create a topic and provide name of the topic and email ID to send notification > Unselect "Fail to launch & Terminate"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hdszmdrvf1bfkqjdoxq.png)

- Add Tag 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xz6o9fex2g7dt8i1cdh.png)

- Once done Review all the settings and create a auto scaling group

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bu6hfftfc1hysv6ei5th.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2zh17r86khgdrp10tv2t.png)

- Verify the email and confirm the notification subscription

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5j5n0ot9l3uigcn49jz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzdbp9w1zr682rfxdpzc.png)

- Auto Scaling group has been create and launch the Instance from the AMI Image Template.
 you can monitor on the Activity tab.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nijrtjkqlf4xhjghig60.png)

- Verfiy the instance status 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2uchqvy4p96ydb152ubp.png).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zofsvqq8ix1nwufmoc7.png)

- If you stop the instance ASG-1 it will create the new instance using Auto scaling group monitor the process on the ASG Activity.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn7m6i57jffqd98bfwje.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcy1gau628mmikpt3vgh.png)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gohd6so8tvy2m5um46mw.png)

- These how auto scaling group works without load balancer.