Aws Project Used in Production PDF
Aws Project Used in Production PDF
2. Load Balancer:
A Load Balancer is used to distribute incoming traffic across multiple servers to ensure efficient
utilization and prevent overloading any single server. Additionally, it supports path-based and host-
based routing, allowing requests to be directed to specific targets based on the URL path or hostname.
When EC2 instances are created in a private subnet, they do not have public IP addresses, meaning you
cannot SSH into these instances directly. This is done to enhance security by avoiding public exposure.
Instead, a Bastion Host (or Jump Host) is created in the public subnet. Using the Bastion Host, you can
securely connect to EC2 instances in the private subnet. This approach allows for proper auditing of
who is accessing the private subnet. Additionally, you can configure a set of rules on the Bastion Host
to control and monitor the traffic that flows to the private subnet.
Project Implementation
Here are Following list of steps that are used to implement this project.
1. Click on create VPC
4. Choose the subnet block. In my case I chose by default which is giving me 65536 IP addresses.
5. Set the number of availability zone to 2 that we require in our project and one NAT gateway in 1
availability zone
6. For VPC endpoint click on none, You will notice in the diagram that there is no endpoint For S3
bucket.
11. click on launch template. Autoscaling in AWS cannot be created directly. For this you can use the
launch template. You can use that template in multiple autoscaling groups and acts as a reference
16. Create the Key value pair and save it as .pem file
26. Click on no load balancer, we will create the load balancer in the public subnet
32. Make sure to add a security group that has access to ssh and make sure that bastion host is created
in the same VPC
Now you can see that the .pem file is available in the bastion host.
With this setup, I will proceed to deploy a straightforward application on one of the instances we created
within the private subnet. To accomplish this, we will establish an SSH connection to one of the instances,
utilizing the same terminal environment for seamless access and control.
38. Take the private ip address of any of instances and ssh into it, In my case I am taking
10.0.149.135
43. Now run the python server by using the following command python3 -m http.server 8000
45. In our used case, go with application load balancer which is L7 load balancer.
The Application Load Balancer distributes incoming HTTP and HTTPS traffic across multiple targets
such as Amazon EC2 instances, microservices, and containers, based on request attributes. When
the load balancer receives a connection request, it evaluates the listener rules in priority order to
determine which rule to apply, and if applicable, it selects a target from the target group for the rule
action.
50. Create a target group which instances should be accessible. For this, click on target group
52. Select the instances of private subnet. One has the application and other doesn’t and click on
create target group
Adding target group to the load balancer:
53. Click on create load balancer and add the target group and port 80 which is default
Now load balancer with the attached target group has been created successfully
Accessing the application from outside world:
Let’s try to access the load balancer and you will see that the load balancer is not accessible because the
subnet that you attached to the load balancer does not expose port 80 so we have to explicitly add the rule