0
0
GCPcloud~10 mins

Private Google Access in GCP - Interactive Code Practice

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

Complete the code to enable Private Google Access on a subnet.

GCP
resource "google_compute_subnetwork" "example" {
  name          = "example-subnet"
  ip_cidr_range = "10.0.0.0/24"
  region        = "us-central1"
  network       = "[1]"
  private_ip_google_access = true
}
Drag options to blanks, or click blank then click option'
Adefault-vpc
Bdefault-network
Cdefault-net
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect network names like 'default-vpc' or 'default-network' which do not exist.
Forgetting to set private_ip_google_access to true.
2fill in blank
medium

Complete the command to enable Private Google Access on an existing subnet.

GCP
gcloud compute networks subnets update example-subnet --region=us-central1 --[1]
Drag options to blanks, or click blank then click option'
Aenable-private-google-access
Bset-private-google-access
Cprivate-google-access
Denable-private-google
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or incomplete flags like '--set-private-google-access'.
Omitting the region parameter.
3fill in blank
hard

Fix the error in the Terraform snippet to correctly enable Private Google Access.

GCP
resource "google_compute_subnetwork" "example" {
  name          = "example-subnet"
  ip_cidr_range = "10.0.0.0/24"
  region        = "us-central1"
  network       = "default"
  private_ip_google_access = [1]
}
Drag options to blanks, or click blank then click option'
A"true"
BTrue
Ctrue
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around true, making it a string.
Using capitalized True which is invalid in Terraform.
4fill in blank
hard

Fill both blanks to create a firewall rule allowing Private Google Access traffic.

GCP
resource "google_compute_firewall" "private-google-access" {
  name    = "allow-private-google-access"
  network = "default"
  direction = "INGRESS"
  [1] = ["35.191.0.0/16", "130.211.0.0/22"]
  [2] = ["tcp:443"]
}
Drag options to blanks, or click blank then click option'
Asource_ranges
Bdestination_ranges
Callowed
Ddenied
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'destination_ranges' instead of 'source_ranges'.
Using 'denied' instead of 'allowed'.
5fill in blank
hard

Fill all three blanks to configure a subnet with Private Google Access and a route to Google APIs.

GCP
resource "google_compute_subnetwork" "example" {
  name                     = "example-subnet"
  ip_cidr_range            = "10.1.0.0/24"
  region                   = "us-east1"
  network                  = "default"
  private_ip_google_access = [1]
}

resource "google_compute_route" "to-google-apis" {
  name       = "route-to-google-apis"
  network    = "default"
  dest_range = [2]
  next_hop   = [3]
}
Drag options to blanks, or click blank then click option'
Atrue
B"199.36.153.4/30"
C"default-internet-gateway"
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting private_ip_google_access to false.
Using incorrect destination ranges.
Using an invalid next hop value.