0
0
AWScloud~30 mins

Default VPC overview in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Default VPC overview
📖 Scenario: You are starting to learn about AWS networking. Every AWS account has a default Virtual Private Cloud (VPC) that lets you launch resources easily without extra setup.Think of the default VPC as a ready-made neighborhood where your cloud computers can live and talk to each other right away.
🎯 Goal: Build a simple AWS CloudFormation template that defines a default VPC with its main components: subnets, internet gateway, and route table. This will help you understand how a default VPC is structured.
📋 What You'll Learn
Create a VPC resource with the default CIDR block 172.31.0.0/16
Add two public subnets in different availability zones
Attach an Internet Gateway to the VPC
Create a route table with a route to the Internet Gateway
Associate the route table with the public subnets
💡 Why This Matters
🌍 Real World
Default VPCs let you quickly launch cloud resources without manual network setup. Understanding their structure helps you customize your cloud network safely.
💼 Career
Cloud engineers and architects often work with VPCs to design secure and scalable cloud networks. Knowing default VPC components is foundational.
Progress0 / 4 steps
1
Create the VPC resource
Create a resource called DefaultVPC of type AWS::EC2::VPC with the property CidrBlock set to "172.31.0.0/16".
AWS
Need a hint?

The VPC resource needs a CidrBlock property with the value "172.31.0.0/16".

2
Add two public subnets
Add two resources called PublicSubnet1 and PublicSubnet2 of type AWS::EC2::Subnet. Set their VpcId to { Ref: DefaultVPC }. Use CidrBlock values "172.31.0.0/20" and "172.31.16.0/20" respectively. Set AvailabilityZone to "us-east-1a" and "us-east-1b" respectively.
AWS
Need a hint?

Each subnet needs VpcId, CidrBlock, and AvailabilityZone properties.

3
Add Internet Gateway and Route Table
Add a resource called InternetGateway of type AWS::EC2::InternetGateway. Then add a resource called VPCGatewayAttachment of type AWS::EC2::VPCGatewayAttachment that attaches InternetGateway to DefaultVPC. Next, add a resource called PublicRouteTable of type AWS::EC2::RouteTable with VpcId set to { Ref: DefaultVPC }. Finally, add a resource called PublicRoute of type AWS::EC2::Route with RouteTableId set to { Ref: PublicRouteTable }, DestinationCidrBlock set to "0.0.0.0/0", and GatewayId set to { Ref: InternetGateway }.
AWS
Need a hint?

Remember to attach the Internet Gateway to the VPC and create a route to allow internet traffic.

4
Associate route table with public subnets
Add two resources called SubnetRouteTableAssociation1 and SubnetRouteTableAssociation2 of type AWS::EC2::SubnetRouteTableAssociation. Set their SubnetId to { Ref: PublicSubnet1 } and { Ref: PublicSubnet2 } respectively. Set their RouteTableId to { Ref: PublicRouteTable }.
AWS
Need a hint?

Each subnet needs to be associated with the public route table to enable internet access.