-
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
Conflict with dataset updates #20995
Comments
I tried to replicate this issue with the following steps:
But after looking in the This is the used code, you could check it and see if you have something similar:
I suggest you try again without using variables and modules to detect what is happening in your environment and then ensure your module configuration and variables are correct. If after this you are still having issues try with basic troubleshooting restarting everything on your environment |
Hi @ggtisc, The point is to make these changes at the same time:
As I posted, the Terraform output shows both changes, but finally it generates a conflict and the final tfstate does not show the deletion of iam members. |
Hi @ggtisc, An additional point, the Google Support Team gave us this explanation: "We have inspected the logs which you have provided and could see the permissions got added back because Terraform updated the google_bigquery_datasets with the old access lists after the corresponding iam_member was deleted. Thanks in advance |
Thanks @angelavargas00 that helps so much As the message suggests and according to the shared error message, this is orchestrated by your module configuration, Which means this is a mistake in the configuration but not a bug. I suggest you check that configuration, because terraform by itself doesn't inherently support applying such changes within a single configuration. However, you can achieve this using a two-step approach:
By applying these configurations sequentially (destroy the IAM member first, then update the dataset name), you can achieve the intended outcome. In a resume this is a bad configuration, not a bug because resources works as expected with the standard usage, for more information you could read the official documentation to know how Google Cloud services (link here) and terraform resources works (link here) Alternatively you can do it with sample commands or with a 3rd party script, but we cannot take actions in these cases because it is out of terraform scope and the configuration of the modules depends on users. In any case both |
Community Note
Terraform Version & Provider Version(s)
Terraform v1.2.9
Affected Resource(s)
google_bigquery_dataset
Terraform Configuration
Bigquery Module
App configuration
Debug Output
Expected Behavior
The iam member should be removed and the dataset friendly_name should be updated.
Actual Behavior
However, the iam member persists in the dataset configuration after the Terraform execution. Analyzing the GCP Logging, we can observe that immediately after the deletion of the iam member, there is another addition of the same resource.
The explanation of this behaviour: If we update the dataset (in any of their variables) at the same time we add/remove iam members on this dataset, Terraform gets a conflict and the deletion is not working.
Steps to reproduce
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: