Coder Social home page Coder Social logo

ec2-alb-asg's Introduction

Terraform -Implement Application Load Balancer with Auto Scaling Group & EC2

Introduction

This repo implements the provisions the following infrastructure on the AWS:

  • VPC.
  • Security Group.
  • Subnets.
  • Route Table.
  • Internet Gateway.
  • Launch Configuration (with custom AMI).
  • Application Load Balancer:
    • Load Balancer.
    • Target Group.
  • Auto Scaling Group.
  • Auto Scaling Policies.
    • Predictive Auto Scaling.
    • Horizontal Auto Scaling.

Pre Requisites

You must have the following programs installed & configured properly on your machine:

  • Terraform.
  • AWS CLI.

Installation

Clone the repo using the following:

# Using HTTPS

git clone https://github.com/srmklive/ec2-alb-asg.git

# Using SSH
git clone [email protected]:srmklive/ec2-alb-asg.git

Configuring the code

Important

You should also rename the infrastructure being provisioned as per your liking.

Caution

You must update the values mentioned below. The prefilled values referring to AMI & S3 buckets are really removed.

Set AMI for Launch configuration

To do this, open the terraform.tfvars file in the root folder, and change the value to the AMI ID you need to use.

Set S3 Bucket for Terraform State

Important

If you want to save Terraform state locally, just comment out the lines 10-14 in the providers.tf file.

If you intend to use S3 for saving your Terraform state, open the providers.tf file and change the lines 10-13 as per your own liking. Most probably you just need to update the bucket & region values.

Running the code

terraform init
terraform plan -out="tf.plan"
terraform apply "tf.plan"

ec2-alb-asg's People

Contributors

srmklive avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.