0
0
GCPcloud~10 mins

Cloud VPN for hybrid connectivity 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 Cloud VPN gateway in GCP.

GCP
resource "google_compute_ha_vpn_gateway" "vpn_gateway" {
  name    = "my-vpn-gateway"
  network = "[1]"
  region  = "us-central1"
}
Drag options to blanks, or click blank then click option'
Adefault
Bglobal
Cvpn-network
Dmy-network
Attempts:
3 left
💡 Hint
Common Mistakes
Using a region name instead of a network name.
Using 'global' which is not a network name.
Leaving the network field empty.
2fill in blank
medium

Complete the code to define a VPN tunnel with the correct peer IP address.

GCP
resource "google_compute_vpn_tunnel" "vpn_tunnel" {
  name          = "my-vpn-tunnel"
  region        = "us-central1"
  vpn_gateway   = google_compute_ha_vpn_gateway.vpn_gateway.id
  peer_ip       = "[1]"
  shared_secret = "my-secret"
}
Drag options to blanks, or click blank then click option'
A10.0.0.1
Bvpn-peer-ip
C35.192.0.1
D192.168.1.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a private IP address instead of a public IP.
Using a placeholder string instead of an IP address.
Leaving the peer_ip field empty.
3fill in blank
hard

Fix the error in the firewall rule to allow VPN traffic.

GCP
resource "google_compute_firewall" "vpn_firewall" {
  name    = "allow-vpn-traffic"
  network = "my-network"
  direction = "INGRESS"
  priority  = 1000
  [1] = [
    {
      protocol = "udp"
    },
    {
      protocol = "esp"
    },
    {
      protocol = "ah"
    }
  ]
  source_ranges = ["0.0.0.0/0"]
}
Drag options to blanks, or click blank then click option'
Aallowed
Ballow
Cprotocols
Dports
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'allow' instead of 'allowed'.
Using 'protocols' which is not a valid attribute.
Using 'ports' when specifying protocols.
4fill in blank
hard

Fill both blanks to configure the VPN tunnel with correct IKE version and routing options.

GCP
resource "google_compute_vpn_tunnel" "vpn_tunnel" {
  name          = "my-vpn-tunnel"
  region        = "us-central1"
  vpn_gateway   = google_compute_ha_vpn_gateway.vpn_gateway.id
  peer_ip       = "35.192.0.1"
  shared_secret = "my-secret"
  ike_version   = [1]
  routing_type  = [2]
}
Drag options to blanks, or click blank then click option'
A2
B1
C"BGP"
D"STATIC"
Attempts:
3 left
💡 Hint
Common Mistakes
Using IKE version 1 instead of 2.
Using routing type without quotes.
Mixing routing types.
5fill in blank
hard

Fill all three blanks to create a VPN tunnel with correct fields for peer IP, shared secret, and local traffic selector.

GCP
resource "google_compute_vpn_tunnel" "vpn_tunnel" {
  name                   = "my-vpn-tunnel"
  region                 = "us-central1"
  vpn_gateway            = google_compute_ha_vpn_gateway.vpn_gateway.id
  peer_ip                = "[1]"
  shared_secret          = "[2]"
  local_traffic_selector = ["[3]"]
}
Drag options to blanks, or click blank then click option'
A35.192.0.1
Bmy-secret
C10.0.0.0/16
D192.168.1.0/24
Attempts:
3 left
💡 Hint
Common Mistakes
Using private IP for peer_ip.
Leaving shared_secret empty.
Using incorrect CIDR notation for local_traffic_selector.