This post shows you the step by step procedure of how to create new VPC (Virtual Private Cloud ) in Amazon Web Services (AWS) from scratch along with new subnets, new route tables, internet gateway.
In this post, we will cover,
- How to create a New VPC?
- How to create Internet Gateway and attach to newly created VPC?
- How to create Public Subnet and Private Subnet?
- How to create Route Tables for Public and Private Subnet?
- How to edit Route Tables?
- How to add Internet Gateway route to Public Route Table?
- How to Associate Public and Private Subnets to respective Route Tables?
AWS VPC - Create New VPC, Subnets, Internet Gateway
Before creating all these, we should have some plan about the infrastructure and architecture design like how many ip's we want for our resources, how many subnets? which availability region and zones should we use?. You should have answer for all these.
To make you understand better, lets have a sample VPC architecture as shown in below image and i will show you based on that how to create and configure VPC.
- 1 VPC (10.0.0.0/16)
- 2 Subnets - Public Subnet (10.0.1.0/24) and Private Subnet (10.0.2.0/24)
- 1 Internet Gateway attached to Public Subnet.
Once you have the access, Login into AWS Management Console.
You can select any region as you preferred. But I am logged into US East (N. Virginia) region, Make sure you are in the right region.
How to Create New VPC in AWS?
A virtual private cloud (VPC) is a virtual network dedicated to your AWS account. It is logically isolated from other virtual networks in the AWS Cloud. You can launch your AWS resources, such as Amazon EC2 instances, into your VPC. You can specify an IP address range for the VPC, add subnets, associate security groups, and configure route tables.Go to "Services", type "VPC" in the search box and select the VPC from the search result.
Enter the Name Tag you prefer, i just give "my_demo_vpc".
Enter the range of IP address in the IPv4 CIDR block : 10.0.0.0/16
Select "No IPv6 CIDR Block" in IPv6 CIDR block.
Select "Default" in the tenancy.
Click "Create"
Once you have created new VPC, you will see all VPC available in the region including the newly created one.
How to Create Internet Gateway in AWS?
An internet gateway enables your instances to connect to the internet through the Amazon Network.Go to "Internet Gateway" option from the left side panel and click "Internet gateway".
Select the appropriate VPC and click "Attach", so that it enables the communication with the internet.
How to Create Subnets in AWS?
A subnet is a range of IP addresses in your VPC. You can launch AWS resources into a specified subnet. Use a public subnet for resources that must be connected to the internet, and a private subnet for resources that won't be connected to the internet.As per our requirement, we need to create two subnets ie. Public Subnet and Private Subnet.
Create Public Subnet:
Go to Subnet option from the left side panel and click "Create Subnet".
Create Private Subnet:
Public Subnet is created, now again click "Create Subnet". to create private subnet.
Enter the private subnet details including name, associated vpc, ipv4 cidr block and click create.
Now we have created both public subnet and private subnet in AWS VPC.
That's it for this post, hope you have got an idea on the below topics.
- How to create a New VPC?
- How to create Internet Gateway and attach to newly created VPC?
- How to create Public Subnet and Private Subnet?
Refer the Next Post (AWS VPC | Create Route Tables and Assign Subnets in AWS ) wherewe have covered,
- How to create Route Tables for Public and Private Subnet?
- How to edit Route Tables?
- How to add Internet Gateway route to Public Route Table?
- How to Associate Public and Private Subnets to respective Route Tables?
Also Request you to go through the below recommended tutorial, if you are interested in learning.
DevOps Full Course Tutorial for Beginners - DevOps Free Training Online
Docker Full Course Tutorial for Beginners - Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners - Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners - Ansible Free Training Online
Openstack Full Course Tutorial for Beginners - Openstack Free Training Online
0 Comments