0
0
AWScloud~10 mins

VPC peering concept in AWS - Interactive Code Practice

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

Complete the code to create a VPC peering connection between two VPCs.

AWS
resource "aws_vpc_peering_connection" "peer" {
  vpc_id        = "[1]"
  peer_vpc_id   = "vpc-0a1b2c3d4e5f6g7h8"
  peer_region   = "us-west-2"
}
Drag options to blanks, or click blank then click option'
Avpc-111aaa22
Bvpc-123abc45
Cvpc-0a1b2c3d4e5f6g7h8
Dvpc-987zyx65
Attempts:
3 left
💡 Hint
Common Mistakes
Using the peer VPC ID for the vpc_id field.
Mixing up VPC IDs between requester and peer.
2fill in blank
medium

Complete the code to allow DNS resolution over the VPC peering connection.

AWS
resource "aws_vpc_peering_connection_options" "peer_options" {
  vpc_peering_connection_id = aws_vpc_peering_connection.peer.id
  requester {
    [1] = true
  }
  accepter {
    allow_dns_resolution_from_remote_vpc = true
  }
}
Drag options to blanks, or click blank then click option'
Aallow_dns_resolution_from_remote_vpc
Ballow_classic_link_to_remote_vpc
Callow_vpc_to_remote_classic_link
Dallow_remote_vpc_dns_resolution
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names that do not exist.
Confusing DNS resolution with ClassicLink settings.
3fill in blank
hard

Fix the error in the VPC peering connection resource by completing the missing field.

AWS
resource "aws_vpc_peering_connection" "peer" {
  vpc_id      = "vpc-123abc45"
  peer_vpc_id = "[1]"
  peer_owner_id = "123456789012"
}
Drag options to blanks, or click blank then click option'
Avpc-123abc45
Bvpc-999zzz88
Cvpc-0a1b2c3d4e5f6g7h8
Dvpc-555bbb33
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same VPC ID for both vpc_id and peer_vpc_id.
Leaving out the peer_vpc_id field.
4fill in blank
hard

Fill both blanks to configure route tables to allow traffic over the VPC peering connection.

AWS
resource "aws_route" "peer_route" {
  route_table_id         = "[1]"
  destination_cidr_block = "[2]"
  vpc_peering_connection_id = aws_vpc_peering_connection.peer.id
}
Drag options to blanks, or click blank then click option'
Artb-0a1b2c3d4e5f6g7h8
B10.0.0.0/16
Crtb-123abc45
D192.168.0.0/16
Attempts:
3 left
💡 Hint
Common Mistakes
Using the peer VPC's route table ID instead of the local VPC's.
Mixing up CIDR blocks between local and peer VPCs.
5fill in blank
hard

Fill all three blanks to define a VPC peering connection with tags and accept the peering request.

AWS
resource "aws_vpc_peering_connection" "peer" {
  vpc_id        = "[1]"
  peer_vpc_id   = "[2]"
  auto_accept   = [3]

  tags = {
    Name = "MyVPCPeering"
  }
}
Drag options to blanks, or click blank then click option'
Avpc-abc12345
Bvpc-def67890
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same VPC ID for both vpc_id and peer_vpc_id.
Setting auto_accept to false when automatic acceptance is desired.