0
0
GCPcloud~10 mins

Subnet modes (auto, custom) 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 create a VPC network with automatic subnet creation.

GCP
resource "google_compute_network" "vpc_network" {
  name                    = "auto-subnet-network"
  auto_create_subnetworks = [1]
}
Drag options to blanks, or click blank then click option'
A"custom"
Btrue
C"auto"
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of boolean
Setting auto_create_subnetworks to false for auto mode
2fill in blank
medium

Complete the code to create a custom subnet in a VPC network.

GCP
resource "google_compute_subnetwork" "custom_subnet" {
  name          = "custom-subnet"
  ip_cidr_range = "10.0.0.0/24"
  network       = google_compute_network.vpc_network.[1]
  region        = "us-central1"
}
Drag options to blanks, or click blank then click option'
Aself_link
Bid
Cname
Dnetwork
Attempts:
3 left
💡 Hint
Common Mistakes
Using the network name instead of its ID
Using an undefined attribute
3fill in blank
hard

Fix the error in the network creation code to specify a custom subnet mode.

GCP
resource "google_compute_network" "custom_network" {
  name                    = "custom-network"
  auto_create_subnetworks = [1]
}
Drag options to blanks, or click blank then click option'
Atrue
B"auto"
C"custom"
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting auto_create_subnetworks to true for custom mode
Using string values instead of boolean
4fill in blank
hard

Fill both blanks to create a custom subnet with the correct network reference and IP range.

GCP
resource "google_compute_subnetwork" "custom_subnet" {
  name          = "custom-subnet"
  ip_cidr_range = [1]
  network       = google_compute_network.custom_network.[2]
  region        = "europe-west1"
}
Drag options to blanks, or click blank then click option'
A"10.1.0.0/16"
Bid
Cname
D"192.168.1.0/24"
Attempts:
3 left
💡 Hint
Common Mistakes
Using network name instead of ID
Using invalid IP range format
5fill in blank
hard

Fill all three blanks to define a VPC network in custom mode and create a subnet with a specific IP range and region.

GCP
resource "google_compute_network" "custom_network" {
  name                    = [1]
  auto_create_subnetworks = [2]
}

resource "google_compute_subnetwork" "custom_subnet" {
  name          = "custom-subnet"
  ip_cidr_range = [3]
  network       = google_compute_network.custom_network.id
  region        = "asia-east1"
}
Drag options to blanks, or click blank then click option'
A"custom-vpc-network"
Bfalse
C"10.2.0.0/20"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Setting auto_create_subnetworks to true for custom mode
Using invalid IP range format
Using network name incorrectly