Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
Your enterprise organization manages multiple environments across staging and production folders in Google Cloud. To prevent data exfiltration and enforce infrastructure standards across all development teams, your DevOps team must implement a Policy-as-Code guardrail with the following requirements:
How should you define and enforce this guardrail using Google Cloud Organization Policy custom constraints?
resource.config CEL expressions, and enforce it using gcloud projects set-iam-policy.IAM Conditions allow administrators to define conditional access controls on IAM role bindings based on contextual attributes such as request time, originating IP/VPC Service Controls perimeters, resource types, or resource tags.
resource.config or custom subfields) during resource creation.set-iam-policy does not create an organization-wide constraint definition and requires repetitive maintenance across every individual project.request.time, resource.type, resource.name, resource.TagKeys).You needed temporary or attribute-based role activation, such as granting a user access to a specific resource only during business hours or when specific resource tags match.
gcloud iam deny-policies create.IAM Deny Policies allow organizations to set guardrails that prevent principals from exercising specific IAM permissions regardless of their granted roles. They act as an authorization barrier evaluated before grant policies.
compute.instances.create), and IAM condition attributes. They cannot parse or validate detailed request body fields, specifications, or internal resource configurations (such as network tiers or machine types).resourceTypes, methodTypes, and resource-level CEL schemas.gcloud iam deny-policies manages IAM access boundaries, not Organization Policy custom constraints.You needed to prevent specific principals, groups, or service accounts from calling administrative APIs across a folder or project regardless of project-level role grants.
resourceTypes, methodTypes, a CEL condition, and actionType. Register it using gcloud org-policies set-custom-constraint, then create a policy YAML referencing the constraint and apply it using gcloud org-policies set-policy.Custom organization policy constraints allow organization administrators to define granular, programmatic guardrails based on specific resource attributes and fields. Unlike legacy managed constraints that have predefined, fixed behaviors, custom constraints use Common Expression Language (CEL) expressions to evaluate REST resource payloads during operations.
resourceTypes), supported operations such as CREATE or UPDATE (under methodTypes), a CEL expression (under condition), and an action (ALLOW or DENY under actionType).description and displayName fields within the constraint definition are returned as descriptive error messages when an API call is blocked by policy evaluation.gcloud org-policies set-custom-constraint.gcloud org-policies set-policy.This approach uses the native Google Cloud Organization Policy Service, providing preventive, control-plane enforcement directly at the Cloud Resource Manager layer without needing third-party admission controllers or post-deployment remediation loops.
gcloud org-policies set-policy.This option attempts to merge the constraint definition schema (the custom constraint) and the policy binding (the organization policy enforcement rule) into a single operational command.
gcloud org-policies set-policy only accepts policy files referencing an existing constraint ID (such as custom.constraintName or a managed constraint). It cannot parse or create a custom constraint definition on the fly.gcloud org-policies set-custom-constraint.You were applying a built-in Google-managed constraint where the constraint definition already exists natively across all Google Cloud environments.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated