Complete the code to define a new VPC with a CIDR block.
resource "aws_vpc" "main" { cidr_block = "[1]" }
The CIDR block 10.0.0.0/16 is a valid private IP range commonly used for VPCs.
Complete the code to enable DNS support in the VPC.
resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" enable_dns_support = [1] }
The enable_dns_support attribute expects a boolean value true or false, not a string.
Fix the error in the subnet resource by completing the missing VPC ID reference.
resource "aws_subnet" "subnet1" { vpc_id = [1] cidr_block = "10.0.1.0/24" }
The vpc_id must reference the VPC resource ID without quotes to link the subnet correctly.
Fill both blanks to create a route table and associate it with the subnet.
resource "aws_route_table" "rt" { vpc_id = [1] } resource "aws_route_table_association" "rta" { subnet_id = [2] route_table_id = aws_route_table.rt.id }
The route table must be linked to the VPC ID, and the association must use the subnet's ID.
Fill all three blanks to create an internet gateway, attach it to the VPC, and add a route to the route table.
resource "aws_internet_gateway" "igw" { vpc_id = [1] } resource "aws_route" "default_route" { route_table_id = aws_route_table.rt.id destination_cidr_block = [2] gateway_id = [3] }
The internet gateway must be attached to the VPC ID. The route destination for internet traffic is 0.0.0.0/0. The gateway ID in the route is the internet gateway's ID.