0
0
GCPcloud~10 mins

Why VPC provides network isolation in GCP - Test Your Understanding

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

Complete the code to create a VPC network in GCP.

GCP
resource "google_compute_network" "vpc_network" {
  name = "my-vpc"
  auto_create_subnetworks = [1]
}
Drag options to blanks, or click blank then click option'
Afalse
Btrue
C"yes"
D"no"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "yes" or "no" instead of boolean true/false.
Setting auto_create_subnetworks to true creates default subnets, reducing isolation.
2fill in blank
medium

Complete the code to define a subnet within a VPC network.

GCP
resource "google_compute_subnetwork" "subnet" {
  name          = "my-subnet"
  ip_cidr_range = "10.0.0.0/24"
  network       = [1]
  region        = "us-central1"
}
Drag options to blanks, or click blank then click option'
Agoogle_compute_network.vpc_network.id
B"global"
C"default"
Dgoogle_compute_network.vpc_network.name
Attempts:
3 left
💡 Hint
Common Mistakes
Using just the network name string instead of the resource ID.
Using an incorrect region or global value for the network.
3fill in blank
hard

Fix the error in the firewall rule to allow internal traffic within the VPC.

GCP
resource "google_compute_firewall" "internal_allow" {
  name    = "allow-internal"
  network = google_compute_network.vpc_network.id

  allow {
    protocol = [1]
    ports    = ["0-65535"]
  }

  source_ranges = ["10.0.0.0/8"]
}
Drag options to blanks, or click blank then click option'
A"udp"
B"icmp"
C"all"
D"tcp"
Attempts:
3 left
💡 Hint
Common Mistakes
Using only tcp or udp limits allowed traffic.
Using icmp only allows ping, not all internal traffic.
4fill in blank
hard

Fill both blanks to define a route that directs traffic to the internet gateway.

GCP
resource "google_compute_route" "default_internet_route" {
  name       = "default-internet-route"
  network    = [1]
  dest_range = [2]
  next_hop_internet = true
}
Drag options to blanks, or click blank then click option'
Agoogle_compute_network.vpc_network.id
B"0.0.0.0/0"
C"10.0.0.0/24"
Dgoogle_compute_subnetwork.subnet.name
Attempts:
3 left
💡 Hint
Common Mistakes
Using subnet name instead of network ID.
Using a subnet CIDR block instead of 0.0.0.0/0 for internet traffic.
5fill in blank
hard

Fill all three blanks to create a VPC peering connection between two networks.

GCP
resource "google_compute_network_peering" "peer" {
  name         = [1]
  network      = [2]
  peer_network = [3]
  auto_create_routes = true
}
Drag options to blanks, or click blank then click option'
A"peer-connection-1"
Bgoogle_compute_network.vpc_network.id
Cgoogle_compute_network.peer_vpc.id
D"peer-connection-2"
Attempts:
3 left
💡 Hint
Common Mistakes
Using peer connection names as network IDs.
Mixing up network and peer_network values.