Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

org policy - disable error - Policy and Constraint must be of the same type

when i try to disable an org policy:

gcloud resource-manager org-policies disable-enforce constraints/compute.vmExternalIpAccess --organization=xxxxxxxxxx

i get the error:

Policy and Constraint must be of the same type

Can you please help me understand what does this mean?

--

Org policy constraints page:

https://cloud.google.com/load-balancing/docs/org-policy-constraints#disable_global_load_balancing

0 1 386
1 REPLY 1

Hi @mountaincode2,

I haven’t encountered this error before but gcloud resource-manager org-policies disable-enforce is for boolean Organization Policy while constraints/compute.vmExternalIpAccess is a List constraint hence the error message “Policy and Constraint must be of the same type” you are getting.

zSoYQMK5hPKatPp.png

For reference, see this overview of org-policies. If I understand it correctly, the gcloud resource-manager org-policies deny is for List policy.

I hope this helps.