VPC is the backbone of the AWS cloud platform. In order to become the AWS expert, you must have the good understanding of the AWS VPC and its components. If you are from the networking background, managing VPC might be very easier for you. However, candidates from the developing background should spend a good amount of time to get familiarized with AWS Cloud.
VPC is a separate, isolated, private network in the AWS cloud. By default, the instances from one VPC to another VPC cannot communicate to each other. For some reason, we may need to have multiple VPCs in the AWS cloud. Here, we will see how to create, manage, and delete VPCs.
For the more details of AWS VPC and its components, please visit the following link.
Creating VPC in AWS Cloud
In order to create a VPC, you need to perform the following steps:
- In the AWS console, search and open the VPC dashboard.
- Click the Start VPC Wizard option as shown in the following figure.
- On the Select a VPN Configuration page, click each of the options and review the description of the features provided by them.
- Depending on your requirement, select the appropriate VPC configuration. Here, we will select the VPC with Public Subnet option as shown in the following figure.Note: You can later add more subnets in the VPC and can customize your VPC options.
- On the next page, specify the VPC name, subnet range, and Availability Zone etc. Here we are going to specify the following values:
- IPv4 CIDR Block: 10.50.0.0/16
- VPC Name: My_Test_VPC
- Public Subnet CIDR: 10.50.1.0/24
- Availability Zone: Select the first availability zone.
- Subnet Name: Public_Subnet1
- Click the Create VPC button to proceed next. The VPC will be created and available in the VPC list as shown in the following figure.
Creating and Adding Private Subnet in Existing VPC
Since we have selected the VPC with Public Subnet option, so we need to create Private subnets separately. Private subnet does not have direct access from outside network and requires NAT gateway to access the Internet. Typically, back-end and database servers should always belong to the private subnets.
If you are interested, you can visit the following link to know more about the AWS VPC and subnets.
To create a private subnet, you need to perform the following steps:
- Select the Subnets option in the navigation pane and then click Create Subnet.
- On the Create Subnet page, specify the following values:
- Name tag: Name of the subnet
- VPC: Select the VPC in which you want to create subnet
- Availability Zone: Select the zone in which you want to create subnet
- IPv4 CIDR block: Specify the subnet IP range
- We will go with the following values:
- Name tag: Private_Subnet1
- VPC: My_Test_VPC
- Availability Zone: ap-southeast-2b
- IPv4 CIDR block: 10.50.2.0/24
4. Click the Yes Create button to proceed. A new private subnet will be added to your existing VPC.
Deleting AWS VPC
If you no longer required any VPC for any reason, you can delete it anytime. For this, just select the VPC you want to delete, click Actions and then select Delete VPC to delete it as shown in the following figure.
Note: Deleting VPC will also delete its associated components such as Subnets, NAT Gateway, Routing Table, Internet Gateways etc. So we aware about the resources that are going to be deleted.
That’s all you need to create VPC in AWS cloud. Next, we will look how to configure VPC peering between two VPCs.