0
0
AWScloud~10 mins

Creating a custom VPC in AWS - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a new VPC with a CIDR block.

AWS
resource "aws_vpc" "main" {
  cidr_block = "[1]"
}
Drag options to blanks, or click blank then click option'
A10.0.0.0/16
B256.0.0.0/16
C172.16.0.0/12
D192.168.0.0/24
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid CIDR block like 256.0.0.0/16
Using a public IP range
2fill in blank
medium

Complete the code to enable DNS support in the VPC.

AWS
resource "aws_vpc" "main" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_support   = [1]
}
Drag options to blanks, or click blank then click option'
A"true"
Btrue
Cyes
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around boolean values
Using strings like 'yes' instead of boolean true
3fill in blank
hard

Fix the error in the subnet resource by completing the missing VPC ID reference.

AWS
resource "aws_subnet" "subnet1" {
  vpc_id     = [1]
  cidr_block = "10.0.1.0/24"
}
Drag options to blanks, or click blank then click option'
A"aws_vpc.main.id"
Bmain.id
Caws_vpc.main.id
Dvpc_id
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the reference in quotes, making it a string literal
Using undefined variables
4fill in blank
hard

Fill both blanks to create a route table and associate it with the subnet.

AWS
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
}
Drag options to blanks, or click blank then click option'
Aaws_vpc.main.id
Baws_subnet.subnet1.id
Csubnet1.id
Dmain.id
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or incomplete resource references
Mixing resource names and IDs
5fill in blank
hard

Fill all three blanks to create an internet gateway, attach it to the VPC, and add a route to the route table.

AWS
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]
}
Drag options to blanks, or click blank then click option'
Aaws_vpc.main.id
B"0.0.0.0/0"
Caws_internet_gateway.igw.id
D"10.0.0.0/16"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong CIDR block for the route
Referencing the internet gateway ID incorrectly