Skip to content

sahil5206/AWS-VPC-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AWS-VPC-Project🚀🚀🚀

This repository provides the approach to build and deploy any application on AWS Virtual Private Cloud (VPC).

We will follow the following diagram for making our VPC Project. Diagram of the VPC Project

1️⃣ FIRST STEP - CREATE THE VPC

  1. Go to the AWS VPC service and click Create VPC .
  2. Select 'VPC and more' and provide the name for your VPC.
  3. Provide the IP Address Range (for 65,536 IPs, enter 10.0.0.0/16).
  4. Enter the number of availability Zones - In this project we have made 2 availability zones.
  5. Then enter the number of subnets - we have 2 public subnets in this project.
  6. Then enter the number of private subnets - we have made 2 private subnets in this project(1 in each public subnet).
  7. Enter the number of NAT gateways - we have not used NAT gatewasy in our project as it is a paid service and does not provide a free-tier.
  8. Then choose the end point (S3 Gateway) - But we used none in this project, we have only the internet gateway(igw) only which is necessary and default.
  9. Enable both DNS options.
  10. Then create Create VPC .

You will get your Resource Map, you can go through it for understanding the flows and connection in your VPC. Resource Map

2️⃣ SECOND STEP - CREATE EC2 INSTANCES

  1. Go to the EC2 service dashboard and create two EC2 instances(private) one in each availability zones and make sure to enable auto scaling in your instances.

  2. you will see that you there is no public IP Address of those private subnet instances.

  3. bu you cannot access those private instances directly, you have to create a public instances named - 'Bastion Host' or 'Jump Server'.EC2 Instances

  4. Use the same 'Key-Pair' for every instance in this VPC project.

  5. Deploy your application in the private Instance - We have the deployed a basic html page(code that i have used is provided in this repository as "index.html"). But you cannot access the private instance directly.

  6. use the following command for connecting your PC with the Bastion Host.

chmod 400 your-key.pem
ssh -i your-key.pem ubuntu@Bastion-Public-IP 

.pem file in Bastion Host

  1. Copy the Key-Pair's .pem file to the Bastion Host Instance manually.
vim your-key.pem
  1. Now your PC is connected with the Bastion Host Instance, the next step is to access the private subnet instances through the Bastion Host. From the Bastion Host, run the following command from the Bastion Host
ssh -i your-key.pem ubuntu@(Private-Instance-Private-IPAddress) 
  1. Make sure to add Security Groups to the instances for the security at the instance level.(You can also add the NACL for the subnet level security).

3️⃣ THIRD STEP - CREATE THE LOAD BALANCER AND TARGET GROUPS

  1. Go to the EC2 and scroll down for the Load Balancer
  2. click on Create Load Balancer, then select and create the 'Application Load Balancer' (We used this load balancer in this project).
  3. while creating the Load Balancer, also create the Target Group.
  4. choose the VPC in which you are currently working.
  5. In the target group, allow the inbound traffic range you want to allow to access your application.

✅ you are all set to access your application, go to your Load Balancer and copy the "DNS name" & paste it in your browser to see your application running on the AWS instances. Screenshot (36)

🛠️If you are facing any errors in any part of the process, please feel free to share your errors and problems i will definitely try to resolve your issues.

📧 All my contact details are in my profile.

Thank you..❤️❤️ Don't Compete...Let's Collaborate🤝🤝

About

This repository provides the approach to build the project on AWS Virtual Private Cloud (VPC).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages