Skip to content
Cloud Governance Tools

Deny deleting projects tagged prod

Deny deleting projects tagged prod is a Google Cloud guardrail written in iAM deny policies. Denies the projects.delete permission to everyone except the project-admins group for projects tagged prod. What it breaks: google documents that the denial condition must use the CEL functions for evaluating resource tags, and other functions and operators are not supported.

More organization integrity guardrails ยท About IAM deny policies

{
 "displayName": "Only project admins can delete production projects.",
 "rules": [
  {
   "denyRule": {
    "deniedPrincipals": [
     "principalSet://goog/public:all"
    ],
    "exceptionPrincipals": [
     "principalSet://goog/group/project-admins@example.com"
    ],
    "deniedPermissions": [
     "cloudresourcemanager.googleapis.com/projects.delete"
    ],
    "denialCondition": {
     "title": "Only for prod projects",
     "expression": "resource.matchTag('12345678/env', 'prod')"
    }
   }
  }
 ]
}
Blocks
Denies the projects.delete permission to everyone except the project-admins group for projects tagged prod.
Breaks
Google documents that the denial condition must use the CEL functions for evaluating resource tags, and other functions and operators are not supported. (source)
Test before applying
Google documents troubleshooting deny policies with Policy Troubleshooter, which examines the allow, deny and Principal Access Boundary policies that affect a principal; it does not enforce in a preview mode. (source)
Mechanism
IAM deny policies: Principals named in the deny rules, on the resource the policy is attached to and its descendants.
Taken from
provider documentation, provider documentation

What the source says

"To solve this problem, you create a deny rule that denies the cloudresourcemanager.googleapis.com/projects.delete permission to everyone except the project-admins group for resources that are tagged prod :" (read 10 Nov 2026).

On what it breaks: "Other functions and operators are not supported."

Sources

  1. Deny deleting projects tagged prod, read 10 Nov 2026
  2. What it breaks, read 10 Nov 2026
  3. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.