I want to create an org policy to deny the creation of all external load balancers:
I am referring to the following documentation:
https://cloud.google.com/load-balancing/docs/org-policy-constraints
-
Deny all external load balancers
{ "constraint": "constraints/compute.restrictLoadBalancerCreationForTypes", "listPolicy": { "deniedValues": [ "in:EXTERNAL" ] } }
The following is my workflow:
-
Created the following org policy in my project:
constraints/compute.restrictLoadBalancerCreationForTypesusing the instructions in the following: https://cloud.google.com/resource-manager/docs/organization-policy/creating-managing-policies#boolean_constraints -
When i try to create a load balancer, i get the following, which is expected:
Constraint constraints/compute.restrictLoadBalancerCreationForTypes violated for projects/org-policy-12345. Forwarding Rule projects/xxxxxx/global/forwardingRules/frontend-5 of type GLOBAL_EXTERNAL_MANAGED_HTTP_HTTPS is not allowed.
But now i want to update this org policy to only deny creation of external load balancers:
-
In the “Organization Policies” page in the Google Cloud Console, i select the constraint
constraints/compute.restrictLoadBalancerCreationForTypesfrom the list and clickedManage Policy. -
I then went to Add a rule > Add condition > Condition Editor, and entered the following, but i get an error:
What am i missing in my understanding please?



