Create a VPC with a CIDR Range and Two Subnets with Terraform

Create a VPC with a CIDR Range and Two Subnets with Terraform

Takes 45 mins

The Amazon Virtual Private Cloud (Amazon VPC) is a service used to launch AWS resources inside a virtual environment. It is highly secure and extremely customizable, helping to monitor all the traffic but also restricting access to some resources inside the virtual network.

In this Cloud Lab, you’ll create a virtual private cloud (VPC) and a whole architecture where each subnet is connected to a routing table and an internet gateway using Terraform.

Lab steps

  • Create an EC2 Instance

  • Install Terraform

  • Create VPC architecture

  • Clean Up

Architecture diagram

The following is the high-level architecture diagram of how to create a VPC with CIDR range and two subnets using Terraform: