Skip to content

siddheshafc/Infrastructure-as-Code-for-AWS-ASG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure as Code using Terraform - AWS

Automating Auto Scaling Group in AWS Using Terraform

This project demonstrates how to deploy an AWS Auto Scaling Group (ASG) behind an Application Load Balancer (ALB) using Terraform. It provisions web servers using an EC2 Launch Template with an Ubuntu 22.04 image, managed by an Auto Scaling Group. The web servers are accessible through an ALB, and they serve a basic webpage using apache httpd.

Architecture

  • Auto Scaling Group with a minimum of 1 instance, maximum of 3 instances.
  • Launch Template for EC2 instances running Ubuntu 22.04.
  • Application Load Balancer to distribute traffic across EC2 instances.
  • Security Groups to allow traffic from the internet on port 80 (HTTP).
  • Health Checks for monitoring instance health within the Auto Scaling Group.

image

Components Deployed:

  • EC2 instances with Apache web server.
  • Auto Scaling Group with scaling policies.
  • Application Load Balancer.
  • Target Group for load balancing traffic.
  • Security Group to allow HTTP access.

  • Plan the Infrastructure
  • Initialize Terraform with your cloud provider
  • Write provisioning in terraform
  • Apply the configuration

image

Succesfully Setup image

EC2 Instances with the Terraform configured AMI ID

image

Public IP and IP shown in browser for the webpage

image image

Auto-Scaling Group

image

Load Balancer with configured VPC and subnets

image

Launch Template

image

Target Group

image

To save AWS costs - Destroy the Infra by terraform destory

image

About

Automating Auto Scaling Group in AWS Using Terraform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages