Which of the following resource names are valid for a Google Cloud Storage bucket? (Select all that apply)
Bucket names must contain only lowercase letters, numbers, dashes (-), and dots (.). No uppercase letters or underscores.
Google Cloud Storage bucket names must be globally unique, 3-63 characters long, lowercase, and can include letters, numbers, dashes, and dots. Underscores are not allowed. Options B and C follow these rules. Option A contains underscores, which are invalid. Option D has uppercase letters.
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?
Use the set-labels command with the --labels flag and comma-separated key=value pairs.
The correct command to apply labels is gcloud compute instances set-labels with the --labels flag. Option A uses the correct syntax.
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?
Label keys should be simple, lowercase, and avoid special characters like slashes.
GCP recommends label keys to be lowercase, start with a letter, and contain only letters, numbers, underscores, and dashes. Option D uses simple keys without special characters or prefixes, which is best practice.
You want to restrict access to resources based on labels using IAM conditions. Which statement about using labels in IAM conditions is correct?
Check if the resource supports labels and use the correct attribute in the condition.
IAM conditions can use labels only if the resource supports them, and the condition must reference resource.labels. Option B correctly states this.
You update labels on a Google Cloud project resource. How soon will the updated labels appear in the billing reports for cost tracking?
Billing data processing can take time before reflecting label changes.
Billing data and reports typically update with a delay of 24 to 48 hours after label changes due to batch processing. Option A is correct.