Create A Private Subnet

Create A Private Subnet

Create a private subnet

Hello Everyone

Welcome to CloudAffaire and this is Debjeet

In the last blog post, we have manually created one VPC and explored different components that automatically comes with a new VPC.

https://cloudaffaire.com/create-a-vpc-manually/

In this blog post we are going to create a private subnet inside this VPC and will also create one instance on the newly created private subnet. Below is the configuration diagram for this demo.

Create A Private Subnet

We are going to create our private subnet using 10.0.1.0/24 IPv4 CIDR.

Create a private subnet

Step 1: Login to AWS console and navigate to ‘VPC’.

Create A Private Subnet

Step 2: Click ‘Create subnet’ located under ‘Subnets’.

Create A Private Subnet

Step 3: Provide your subnet name, VPC and IPv4 CIDR block. Click ‘Create’.

Create A Private Subnet

Note: You can also choose availability zone for your subnet.

One success message will be displayed, click ‘Close’.

Create A Private Subnet

We have successfully created a private subnet.

Create A Private Subnet

Next, we are going to create an EC2 instance on this private subnet.

Step 4: Click ‘EC2’ located under ‘Services’ and create a new EC2 instance using this VPC and subnet.

Create A Private Subnet

Create A Private Subnet

Create A Private Subnet

Note: One new EC2 instance is created with only private IP address in the range 10.0.1.*. The instance and subnet don’t have access to the internet hence we are calling it private. However, it’s accessible within your VPC. In order to connect to the internet, we need a public IP address along with an Internet Gateway and subsequent entry in the route table.

Cleanup: Delete the EC2 instance first and then navigate to ‘Your VPCs’, select your VPC and from action click ‘Delete’.

Create A Private Subnet

Note: We will use this same VPC and existing configuration in upcoming blogs, hence if you wish to continue then don’t delete your VPC.

Currently, our VPC don’t have internet access. In the next couple of blogs, we are going to configure our VPC for internet access.

To get more details on VPC, please refer below AWS documentation

https://docs.aws.amazon.com/vpc/index.html

 

Leave a Reply

Close Menu