-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permadiff on google_org_policy_policy resource #12363
Comments
I slept on this and realised I can get the same result with only one rule. This will apply the deny rule UNLESS the tag is present. resource "google_org_policy_policy" "vm_external_ip_access" {
name = "organizations/${local.google_organization_id}/policies/constraints/compute.vmExternalIpAccess"
parent = "organizations/${local.google_organization_id}"
spec {
rules {
deny_all = "TRUE"
condition {
expression = "!resource.matchTagId('tagKeys/123', 'tagValues/456')"
title = "Deny unless compute-external-ip tag is set to allowed"
}
}
}
} But unless I was doing something very wrong beforehand this still feels like a possible bug in the resource. Having multiple rules is permitted and their ordering should not matter, so far as I understand it |
Filed b/244225718 |
Can confirm we have started noticing this on our policies as well. |
Does the condition for this policy constraint even work for you? |
[upstream:161220adfef1dbc0001daaad10c29a87d71ee39e] Signed-off-by: Modular Magician <[email protected]>
[upstream:161220adfef1dbc0001daaad10c29a87d71ee39e] Signed-off-by: Modular Magician <[email protected]>
I've seen this issue recently when testing tag based conditional policy on boolean org constraints. |
@gm-ons We are also encountering the issue with permadiff when using tag-based conditional policies on boolean organization constraints. Terraform consistently attempts to add an empty condition block to the non-tag rule, which causes unexpected behavior. Looking forward to any insights or potential workarounds. ~ rules { |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
1.2.6
Affected Resource(s)
Terraform Configuration Files
Expected behaviour
No changes
Actual behaviour
permadiff - the ordering of the two
rules
are continuously swapped in each plan & applySteps to Reproduce
terraform plan
terraform apply
b/300616619
The text was updated successfully, but these errors were encountered: