0
0
GCPcloud~10 mins

VPC Service Controls 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 Service Controls perimeter with the correct resource type.

GCP
resource "google_access_context_manager_service_perimeter" "example" {
  name        = "accessPolicies/123/servicePerimeters/example"
  title       = "Example Perimeter"
  perimeter_type = "[1]"
}
Drag options to blanks, or click blank then click option'
APERIMETER_TYPE_REGULAR
BPERIMETER_TYPE_BRIDGE
CPERIMETER_TYPE_CUSTOM
DPERIMETER_TYPE_DEFAULT
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid perimeter_type value causes deployment errors.
Confusing bridge perimeter with regular perimeter.
2fill in blank
medium

Complete the code to specify the access policy ID in the perimeter resource.

GCP
resource "google_access_context_manager_service_perimeter" "example" {
  name        = "accessPolicies/[1]/servicePerimeters/example"
  title       = "Example Perimeter"
  perimeter_type = "PERIMETER_TYPE_REGULAR"
}
Drag options to blanks, or click blank then click option'
A123
BaccessPolicy123
Cpolicy123
Dpolicy-123
Attempts:
3 left
💡 Hint
Common Mistakes
Including extra words or prefixes in the policy ID.
Using the full policy name instead of just the ID.
3fill in blank
hard

Fix the error in the resource block by completing the list of resources inside the perimeter.

GCP
resource "google_access_context_manager_service_perimeter" "example" {
  name        = "accessPolicies/123/servicePerimeters/example"
  title       = "Example Perimeter"
  perimeter_type = "PERIMETER_TYPE_REGULAR"
  spec {
    resources = ["[1]"]
  }
}
Drag options to blanks, or click blank then click option'
Ayour-project-id
Bprojects/123
Cproject/your-project-id
Dprojects/your-project-id
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the project ID without the 'projects/' prefix.
Using incorrect resource path formats.
4fill in blank
hard

Fill both blanks to specify the access levels and restricted services in the perimeter spec.

GCP
resource "google_access_context_manager_service_perimeter" "example" {
  name        = "accessPolicies/123/servicePerimeters/example"
  title       = "Example Perimeter"
  perimeter_type = "PERIMETER_TYPE_REGULAR"
  spec {
    access_levels = ["[1]"]
    restricted_services = ["[2]"]
  }
}
Drag options to blanks, or click blank then click option'
AaccessPolicies/123/accessLevels/level1
BaccessPolicies/123/accessLevels/level2
Cstorage.googleapis.com
Dbigquery.googleapis.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using incomplete access level names.
Using service names without the domain suffix.
5fill in blank
hard

Fill all three blanks to define a VPC Service Controls perimeter with title, perimeter type, and resource.

GCP
resource "google_access_context_manager_service_perimeter" "example" {
  name          = "accessPolicies/123/servicePerimeters/example"
  title         = "[1]"
  perimeter_type = "[2]"
  spec {
    resources = ["[3]"]
  }
}
Drag options to blanks, or click blank then click option'
AMy Perimeter
BPERIMETER_TYPE_REGULAR
Cprojects/my-project-id
DPERIMETER_TYPE_BRIDGE
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect perimeter types.
Using incomplete resource names.
Leaving title blank or generic.