Skip to content

bhavukm/webapp-asg-alb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

webapp-asg-alb

Webapp Deployment with an AWS AutoScaling Group, an Application Load Balancer, and a Dynamic Scaling policy (metric: CPU Utilization) configured using a CloudWatch Alarm, SNS and IAM.

YouTube Video URL: https://youtu.be/dMUQTQS1l3g

YouTube Channel: https://www.youtube.com/@techapricate

Please follow the below steps to configure a WebApp running on an AWS EC2 instance (part of AutoScaling Group attached to an Application LB).

  1. Create an IAM user (example: adminjohn with Administrator access).
  2. Create a Security Group for LT (Launch Template) and ALB (Application Load balancer).
  3. Create a LT and an ASG (AutoScaling Group).
  4. Launch an EC2 instance from LT.
  5. SSH to the EC2 Instance and register a custom AMI (Amazon Machine Image) with WebApp Configuration.

WebApp configuration steps:

sudo su -

yum install httpd -y

git clone https://github.com/bhavukm/webapp-asg-alb.git

cp -r webapp-asg-alb/* /var/www/html

systemctl start httpd

systemctl enable httpd

  1. Update the LT with new AMI.
  2. Perform ASG Instance Refresh.
  3. Create a TG (Target Group)) and an ALB.
  4. Attach the ALB with ASG.
  5. Create a Dynamic Scaling Policy with a CloudWatch Alarm and SNS (Simple Notification Service).
  6. Run CPU stress test on the ASG and check if scaling event triggers.

Steps to install and configure stress utility on Amazon Linux:-

amazon-linux-extras install epel –y

yum install stress -y

stress --cpu 1 --timeout 800 &

Architectural Diagram:-

image

AWS SNS:

image

AWS CloudWatch:

image

About

Webapp with AWS ASG and ALB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors