Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Creating an Application Load Balancer in AWS

Leer en espanol
Creating an Application Load Balancer in AWS

Table of contents

Through this configuration we can horizontally scale the application servers and thus increase the ===

In this example we are going to show how to implement a load balancer using AWS.

Through this configuration we will be able to horizontally scale the application servers and thus increase performance, reduce latency and provide tolerance to failure.

In this example we will see a load balancer with two different subnets in which our instances are hosted, this entry is a series of several. In the next posts we will see how to improve this balancer.

Network diagram:

Diagrama de red

Network settings:

VPC
Name tag: RedOrbita VPC
IPv4 CIDR block: 10.200.0.0/20
Subnet
Name tag: Public Subnet 1
IPv4 CIDR block: 10.200.0.0/24
Name tag: Public Subnet 2
IPv4 CIDR block: 10.200.1.0/24
Route Table
Destination: 0.0.0.0/0
Target: Internet Gateway

We begin with the deployment of the infrastructure

We create the VPC:

To deploy a new server we have to go to Service > VPC > Your VPCs > Create VPC

Selección 001

We create the two public subnets:  Services > VPC > Subnets > Create Subnet

LoadBalancer0002

We generate the Internet Gatewa: Services > VPC > Internet Gateway > Create Internet Gateway

LoadBalancer0003

We attach the Internet Gateway to the VPC. We select the Internet Gateway created > Actions > Attach VPC

LoadBalancer0004

We select the VPC created previously.

LoadBalancer0005

We configure the Security Group with the corresponding permissions: Service > VPC > Security Group > Create Security Group and once created at the bottom we create the corresponding rules

LoadBalancer0006

We create the route table: Service > VPC > Route Tables > Create Route Tables. once created we will Routes and we configure the necessary routes:

LoadBalancer0010

We create the ROLE: Service > IAM > Role > Create Role > We select EC2 LoadBalancer0007

Following

LoadBalancer0008  LoadBalancer0009

We generate two instances in different areas, in order not to lengthen this tutorial I am not going to show how to deploy an instance, for this you can see it in the following link:

Deploy a virtual machine in AWS

Once the two instances have been generated in the different subnets we are going to create the load balancer, to do this we are going to:

Services > EC2 > Load Balancers > Create Load Balancer

LoadBalancer0011

We select the option Application Load balancer (In the case that we want to perform a layer 7 balancing)

LoadBalancer0012

We assign a name, protocol by which load balancing will be carried out (in my case only on port 80) and we select the two subnets created previously

LoadBalancer0013

LoadBalancer0014

Following…

LoadBalancer0015

We configure the Security Group

LoadBalancer0016

Here we can configure the load balancing status check, in my case I leave it by default.

LoadBalancer0017

We select the instances and click: Add to registered

LoadBalancer0018 1

It shows us a brief summary of the configuration made. Create!

LoadBalancer0019

Once the balancer is created, we copy the DNS name of the balancer and access the same URL several times. If everything went correctly it should balance the different instances.

LoadBalancer0020

:wq!

Comments