0
0
AWScloud~30 mins

Creating a custom VPC in AWS - Try It Yourself

Choose your learning style9 modes available
Creating a custom VPC
📖 Scenario: You are setting up a new network environment in AWS for a small web application. You want to create a custom Virtual Private Cloud (VPC) to isolate your resources securely.
🎯 Goal: Build a custom VPC with a specific CIDR block, add a subnet, and configure an internet gateway to allow internet access.
📋 What You'll Learn
Create a VPC with CIDR block 10.0.0.0/16
Create a subnet inside the VPC with CIDR block 10.0.1.0/24
Create an internet gateway and attach it to the VPC
Add a route table with a route to the internet gateway for outbound internet access
💡 Why This Matters
🌍 Real World
Custom VPCs are used to isolate and secure cloud resources in a private network, controlling IP ranges and access.
💼 Career
Cloud architects and engineers often create and configure VPCs to design secure and scalable cloud environments.
Progress0 / 4 steps
1
Create a VPC with CIDR block 10.0.0.0/16
Write the AWS CloudFormation YAML code to create a VPC resource named MyVPC with the CIDR block 10.0.0.0/16.
AWS
Need a hint?

Use the AWS::EC2::VPC resource type and set the CidrBlock property.

2
Add a subnet with CIDR block 10.0.1.0/24 inside the VPC
Add a subnet resource named MySubnet with CIDR block 10.0.1.0/24 inside the VPC MyVPC. Use the VpcId property to link it to MyVPC.
AWS
Need a hint?

Use AWS::EC2::Subnet and reference MyVPC with !Ref.

3
Create an internet gateway and attach it to the VPC
Add an internet gateway resource named MyInternetGateway and attach it to the VPC MyVPC using a AWS::EC2::VPCGatewayAttachment resource named AttachGateway.
AWS
Need a hint?

Create an internet gateway and attach it to the VPC using AWS::EC2::VPCGatewayAttachment.

4
Add a route table with a route to the internet gateway
Create a route table resource named MyRouteTable for the VPC MyVPC. Add a route resource named DefaultRoute that sends all traffic (0.0.0.0/0) to the internet gateway MyInternetGateway. Associate the route table with the subnet MySubnet using a SubnetRouteTableAssociation resource named SubnetRouteTableAssoc.
AWS
Need a hint?

Create a route table, add a default route to the internet gateway, and associate it with the subnet.