0
0
GCPcloud~20 mins

Resource naming and labels in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Resource Naming and Labeling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding GCP resource naming constraints

Which of the following resource names are valid for a Google Cloud Storage bucket? (Select all that apply)

Amy_bucket_2024
Bmy-bucket-2024
Cmy.bucket.2024
DMyBucket2024
Attempts:
2 left
💡 Hint

Bucket names must contain only lowercase letters, numbers, dashes (-), and dots (.). No uppercase letters or underscores.

Configuration
intermediate
2:00remaining
Applying labels to GCP Compute Engine instances

You want to add labels to a Compute Engine instance to identify its environment and owner. Which of the following gcloud commands correctly applies labels env=prod and owner=alice to an instance named web-server-1?

Agcloud compute instances set-labels web-server-1 --labels=env=prod,owner=alice
Bgcloud compute instances add-labels web-server-1 --labels=env=prod,owner=alice
Cgcloud compute instances update web-server-1 --labels env=prod owner=alice
Dgcloud compute instances set-label web-server-1 env=prod owner=alice
Attempts:
2 left
💡 Hint

Use the set-labels command with the --labels flag and comma-separated key=value pairs.

Architecture
advanced
2:00remaining
Designing label strategy for cost tracking

Your company wants to track cloud costs by project, team, and environment using labels. Which label key set follows GCP best practices for naming and helps avoid conflicts?

Acost_project, cost_team, cost_environment
Bcosting/project, costing/team, costing/environment
Cgcp-project, gcp-team, gcp-environment
Dproject, team, environment
Attempts:
2 left
💡 Hint

Label keys should be simple, lowercase, and avoid special characters like slashes.

security
advanced
2:00remaining
Impact of labels on IAM policy enforcement

You want to restrict access to resources based on labels using IAM conditions. Which statement about using labels in IAM conditions is correct?

ALabels can be used in IAM conditions for any resource, regardless of label support.
BLabels can be used in IAM conditions only if the resource supports labels and the condition uses <code>resource.labels</code> attribute.
CIAM conditions cannot use labels; they only support resource names and types.
DLabels used in IAM conditions must be encrypted before use.
Attempts:
2 left
💡 Hint

Check if the resource supports labels and use the correct attribute in the condition.

service_behavior
expert
2:00remaining
Effect of label changes on billing reports

You update labels on a Google Cloud project resource. How soon will the updated labels appear in the billing reports for cost tracking?

AAfter 24 to 48 hours, due to billing data processing delays.
BWithin a few minutes, as billing data updates in real-time.
CImmediately after the label update is saved.
DOnly after the next monthly billing cycle.
Attempts:
2 left
💡 Hint

Billing data processing can take time before reflecting label changes.