In this exercise, we will focus on manually building a simple VPC-subnet infrastructure on the AWS Console. This includes creating a VPC, two subnets (one public and one private), an Internet Gateway, and a public route table. By creating these elements manually, we will gain a deeper understanding of how intricate and challenging the process of creating and managing infrastructure can be. This will provide a foundation for appreciating the benefits of Infrastructure as Code (IaC) in automating these tasks and maintaining consistency across environments.
If you wish to give it a shot before looking at the detailed step-by-step and the solution videos, here is an overview of what the created solution should deploy:
- A VPC with a CIDR block of
10.0.0.0/16
. - One public subnet with a CIDR block of
10.0.0.0/24
. - One private subnet with a CIDR block of
10.0.1.0/24
. - One Internet Gateway.
- One public route table with a route to the Internet Gateway, and the correct association between the public subnet and the public route table.
- Login to your AWS console.
- Navigate to the VPC Dashboard.
- Click on "Your VPCs" then "Create VPC".
- Enter a Name tag and the CIDR block
10.0.0.0/16
then click "Create". - Go back to the VPC Dashboard and click on "Subnets".
- Click "Create subnet".
- Fill in the Name tag, select the VPC you just created, and enter the CIDR block
10.0.0.0/24
to create the public subnet. - Repeat this process with the CIDR block
10.0.1.0/24
to create the private subnet. - Go back to the VPC Dashboard and click on "Internet Gateways".
- Click "Create internet gateway", give it a Name tag, then click "Create".
- Select the Internet Gateway you just created and click "Actions", then "Attach to VPC", and select your VPC.
- Go back to the VPC Dashboard and click on "Route Tables".
- Click "Create route table", enter a Name tag, select your VPC, then click "Create".
- Select the Route Table you just created and click on the "Routes" tab, then click "Edit routes".
- Click "Add route", for the Destination enter
0.0.0.0/0
, for the Target select the Internet Gateway you created, then click "Save routes". - Click on the "Subnet Associations" tab, then click "Edit subnet associations".
- Select the public subnet, then click "Save".
Congratulations on successfully completing this challenging exercise! You've manually built a VPC-subnet infrastructure on the AWS Console, and this hands-on experience has given you valuable insight into the process and complexity of creating and managing infrastructure. We hope this exercise has helped you appreciate the benefits of Infrastructure as Code (IaC) in automating these tasks and maintaining consistency across environments. Keep up the great work!