Terraform v0.12.18
Idempotency of google_iam_policy
The google_iam_policy is broken, not idempotent, shows that it wants to do changes over and over.
My code is:
data "google_iam_policy" "storage" {
depends_on = [google_project_iam_custom_role.new_storage_role]
binding {
role = "projects/${var.project_name}/roles/JupyterHubStorageAdmin.${var.environment}"
members = [ "serviceAccount:${google_service_account.jupyterhub_service_account.email}" ]
}
}
On any terraform apply it will try to make changes again and again:
Terraform will perform the following actions:
# data.google_iam_policy.storage will be read during apply
# (config refers to values not yet known)
<= data "google_iam_policy" "storage" {
+ id = (known after apply)
+ policy_data = (known after apply)
+ binding {
+ members = [
+ "serviceAccount:[email protected]",
]
+ role = "projects/mydomain/roles/JupyterHubStorageAdmin.production"
}
}
Any ideas if it's a bug or I am doing something wrong? (possibly)
Thanks in advance!
@Dmitry1987 you are using data which does not modify resources. Also I see below output when to call tf plan and tf apply.
Plan: 0 to add, 0 to change, 0 to destroy.
I am closing this issue. If you think otherwise, please reopen it for further discussion. Thanks
@edwardmedia got it, thanks! My mistake...
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
@Dmitry1987 you are using
datawhich does not modify resources. Also I see below output when to calltf planandtf apply.I am closing this issue. If you think otherwise, please reopen it for further discussion. Thanks