AWS VPC — Create New VPC, Subnets, Internet Gateway

Cloud Guru
5 min readJun 25, 2023

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,

  1. How to create a New VPC?
  2. How to create Internet Gateway and attach to newly created VPC?
  3. How to create Public Subnet and Private Subnet?

Refer the Next Post (Create Route Tables and Assign Subnets in AWS ) wherewe have covered,

  1. How to create Route Tables for Public and Private Subnet?
  2. How to edit Route Tables?
  3. How to add Internet Gateway route to Public Route Table?
  4. 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.

In order to create and manage any AWS Services, we must have some valid users created with IAM policy defined. Else you wont have a access to these AWS services.

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.

Go to “Your VPC” from the left side panel.

Click “Create VPC”.

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”

You will get the confirmation message like this, just close the message.

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”.

Enter the Name of the Internet Gateway “my-igw” and click “Create”.

Once it is created, just right click the newly created internet gateway and click “Attach to VPC”.

Select the appropriate VPC and click “Attach”, so that it enables the communication with the internet.

Now it will list the available Internet gateway.

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”.

Enter the public subnet details including name, associated vpc, ipv4 cidr block and click create.

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.

  1. How to create a New VPC?
  2. How to create Internet Gateway and attach to newly created VPC?
  3. How to create Public Subnet and Private Subnet?

Refer the Next Post (AWS VPC | Create Route Tables and Assign Subnets in AWS ) where we have covered,

  1. How to create Route Tables for Public and Private Subnet?
  2. How to edit Route Tables?
  3. How to add Internet Gateway route to Public Route Table?
  4. 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.

Keep practicing and have fun. Leave your comments if any.

--

--

Cloud Guru

Join us to follow the latest news & announcements around Cloud, DevOps, Artificial intelligence, Machine learning, Internet of things and Big data & analytics.