0
0
GCPcloud~10 mins

Why advanced networking matters 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 Virtual Private Cloud (VPC) network in GCP.

GCP
resource "google_compute_network" "vpc_network" {
  name = "my-vpc-network"
  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 or false.
Setting auto_create_subnetworks to true when custom control is needed.
2fill in blank
medium

Complete the code to create a subnet in a specific region within the VPC.

GCP
resource "google_compute_subnetwork" "subnet" {
  name          = "my-subnet"
  ip_cidr_range = "10.0.0.0/24"
  region        = [1]
  network       = google_compute_network.vpc_network.id
}
Drag options to blanks, or click blank then click option'
A"europe-west1"
B"global"
C"us-central1"
D"asia-east1"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "global" as a region, which is invalid for subnetworks.
Using incorrect region names or missing quotes.
3fill in blank
hard

Fix the error in the firewall rule to allow HTTP traffic on port 80.

GCP
resource "google_compute_firewall" "allow_http" {
  name    = "allow-http"
  network = google_compute_network.vpc_network.id

  allow {
    protocol = [1]
    ports    = ["80"]
  }

  direction = "INGRESS"
  source_ranges = ["0.0.0.0/0"]
}
Drag options to blanks, or click blank then click option'
A"icmp"
B"udp"
C"http"
D"tcp"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "http" as protocol instead of "tcp".
Using "udp" or "icmp" which do not apply to HTTP traffic.
4fill in blank
hard

Fill both blanks to configure a firewall rule that allows SSH access only from a specific IP range.

GCP
resource "google_compute_firewall" "allow_ssh" {
  name    = "allow-ssh"
  network = google_compute_network.vpc_network.id

  allow {
    protocol = [1]
    ports    = [[2]]
  }

  direction     = "INGRESS"
  source_ranges = ["203.0.113.0/24"]
}
Drag options to blanks, or click blank then click option'
A"tcp"
B"22"
C"80"
D"icmp"
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 80 or icmp protocol for SSH.
Not putting the port number as a string inside the list.
5fill in blank
hard

Fill all three blanks to create a forwarding rule for HTTP traffic to a target proxy.

GCP
resource "google_compute_global_forwarding_rule" "http_forwarding_rule" {
  name                  = "http-forwarding-rule"
  load_balancing_scheme = [1]
  port_range            = [2]
  target                = [3]
  ip_protocol           = "TCP"
}
Drag options to blanks, or click blank then click option'
A"EXTERNAL"
B"80"
Cgoogle_compute_target_http_proxy.http_proxy.id
D"INTERNAL"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "INTERNAL" scheme for external HTTP traffic.
Using wrong port or missing the target resource reference.