0
0
GCPcloud~10 mins

Resource naming and labels 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 GCP resource with a valid name.

GCP
resource_name = "my-project-[1]"
Drag options to blanks, or click blank then click option'
AMyProject
Bproject-1
Cproject_1
D123
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters in the resource name.
Including underscores instead of hyphens.
2fill in blank
medium

Complete the code to add a label to a GCP resource.

GCP
labels = {"env": "[1]"}
Drag options to blanks, or click blank then click option'
Aproduction
BProduction
CProd-1
Dprod_env
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters in label values.
Including spaces or special characters in labels.
3fill in blank
hard

Fix the error in the resource name to comply with GCP naming rules.

GCP
resource_name = "[1]-zone-1"
Drag options to blanks, or click blank then click option'
AMyProject
Bmy_project
Cmy-project
Dmyproject!
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores in resource names.
Including special characters like exclamation marks.
4fill in blank
hard

Fill both blanks to create a label dictionary with a valid key and value.

GCP
labels = {"[1]": "[2]"}
Drag options to blanks, or click blank then click option'
Aenvironment
BEnv
Cproduction
DProd
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters in label keys or values.
Using short or unclear label keys.
5fill in blank
hard

Fill all three blanks to define a resource name and labels following GCP best practices.

GCP
resource_name = "[1]-service"
labels = {"[2]": "[3]"}
Drag options to blanks, or click blank then click option'
Awebapp
Benv
Cstaging
DWebApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters in resource names or labels.
Using ambiguous or unclear label keys.