“Create a Virtual Private Cloud (VPC) in AWS to Securely Host Your Resources”
“Learn How to Easily Set Up and Configure Your VPC with AWS’s Simple Step-by-Step Guide”
Create one AWS free tier account.
- Go to the VPC service and click on the Create VPC icon.
2. Select the VPC only , then give the name you prefer in the “name tag” , select the IPv4 CIDR block (this ip adress range will your VPC will use) , tenancy keep it as default, tags is optional fill if you wish. lastly click on the create VPC. wow.. now you create your own VPC.
3. Now you will see VPC created in the VPC dash board.
4. Now we will assign subnet to our VPC. Go to subnet under the VPC , then click on the create subnet.
5. Select the VPC you created before in the VPC ID .
6. Scroll down, under the subnet section give the subnet name as your wish(mysubnet1), choose availability zone as per your region. then create CIDR block. if you select 10.0.0.0/8 means you can create up to (1,67,77,216 this IP adress in the subnet, like wise 10.0.0.0/16 = 65,536 IP adress, lastly 10.0.0.0/24 = 256 IP adress we can host in the subnet). you can create multiple subnet in different subnet in one VPC. finally click create subnet.
7. Finally we create subnet under the name “mysubnet1”.
8. Now we can create route table , which contains a set of default routes that allow traffic to flow within the VPC. go to the routetable below the subnet . you will get window like below, there click on the create route table.
9. Give the route table name as per your wish, then select the VPC you created before. in the tag section give any name , lastly click on the create route tabel.. yessss you did it,,,
10. Now we will associate our route table to the subnet created before, for that select the the route table we created before then below that choose the subnet association, under that select the edit route table.
11. After enter to the edit subnet association you can select the your subnet then click on the save association.
12. Now you can see the subnet is associate with the route tabel..
13. Now we create IGW( internet gateway) . Here is a brief theory of IGW, An Internet Gateway serves as the entry and exit point for all traffic going into or out of a VPC. When an EC2 instance in a VPC needs to communicate with a resource on the Internet, the traffic is directed to the IGW, which forwards it to the appropriate destination on the Internet. Likewise, when an external resource wants to communicate with an EC2 instance in a VPC, the traffic is routed through the IGW to the instance. Go to the internet gateway under VPC. click on the create internet gateway.
14. Here you give name in the name tag. then click on the create internet gateway.
15. After creating IGW go to the action icon click on dropdown menu there select the attach to vpc , there you attach your vpc to the IGW.
16. Here you select your VPC then click on the attach internet gateway. ohhh….. wait….you did it most of the job.. …
17. Now we attach the IGW to routetabel. go the routetabel — edit route table here undre the destination select the ip range then under the target group select your IGW then click save changes.
18. Here you are in the last part of creation, go the EC2 instance give the instance name as per your wish then select the AMI, then the instace type here I selected free tier i.e t2micro , then select the key pair .
18. here is the crucial part in the network setting select the vpc you create it earlier …here you enable the “auto assign public ip”. then finally click on the lunch instace…
19. GREAT JOB BUDDY ……….. YOU DID IT……… FINALLY CONNECT THE INSTANCE . HERE IS THE OUTPUT….
Here is the Architecture
THANKS FOR READING
HAPPY LEARNING…