DEV Community

Pranjal Singh
Pranjal Singh

Posted on

My first project on aws using terraform

Introduction

  • I build my first project using terraform it was amazing and cool to start my journey on AWS using terraform
  • I wanted to direct the traffic using the load balancer to both of the instances

**

What is Load Balancer?

**
Load balance helps to distribute the incoming traffic from the internet such as HTTP/HTTPs to multiple targets (i.e. EC2 instances, Container or IP addresses)

So here in my project in have used Application Load Balancer to distribute the incoming traffic

Architecture Diagram

architecture diagram

Folder Structure

Folder Structure

**

Components I have used while doing the project

**
VPC
Subnet (Public/Private)
Internet gateway and NAT gateway (IGW+NAT)
Route Table
Security Groups
EC2 Instances
Application Load Balancer

**

Demo Output

**

  • I installed Apache on the both the public Amazon EC2 instances so whenever we are hitting the URL of Load Balancer it is distributing the traffic to both of my instances currently 50-50

Successful Output
PS- There are few more services I have used while learning so that why there is 29 added
First Instance

Second Instance
**

What Next

**

I wanted to use Variable in the code the Code to increase the modularity.

Top comments (0)