-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Resource Changes Triggering Unrelated Data Reads & Resource Replacements #8767
Comments
@sam-humphreys can you share the plan after you modified the label on the project? You did not provide project in below resource. Is that on purpose? resource "google_storage_bucket_iam_member" "stj-gmex-ex-20210325-state-reader" {
bucket = "gmex-ex-20210325-state"
role = "roles/storage.admin"
member = "serviceAccount:${data.google_storage_transfer_project_service_account.stj-gmex-ex-20210325-state.email}"
depends_on = [ google_storage_bucket.gmex-ex-20210325-state ]
} |
I have since deleted the project, so the debug plan in this Gist refers to project
As for the missing project on the |
@sam-humphreys I can't repro with below config. resource "google_project" "project" {
name = "issue8767"
project_id = "issue8767"
org_id = "xxxxxxxxx"
labels = {
"project_owner" = "samhumphreys"
"test" = "no"
}
}
data "google_storage_transfer_project_service_account" "stj-gmex-ex-20210325-state" {
project = google_project.project.project_id
} What did you do below plan? Can you post the plan after only a single change is made in the label field?
|
I did only make a single change, I added a label (
|
@sam-humphreys from this plan, I don't see other resources besides
I am not super clear what creates this plan. Can you give a simple config that we can repro the issue? I understood before call tf plan |
I included the plan in the original and in this comment, my previous comment just showed the change I was making. Okay for clarity, firstly create the resources in the config below. Once complete, add an extra label (e.g. Simplified config:
|
Interesting. I can repro it now. It only happens with Terraform v0.14.x. It is fine with v0.13.x. |
I get the same issue with google_kms_secret data reads. It seems to be related to the module dependency - if I add an index to the module dependency, i.e. change it from |
Happens with terraform v1.0.2 as well. |
Also, this bug is marked with label |
Signed-off-by: Modular Magician <[email protected]>
Signed-off-by: Modular Magician <[email protected]>
Verified this is a byproduct of intended upstream Terraform behavior -- the data source read is unavoidable due to it being implicitly |
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. |
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
╰─ terraform -v
Terraform v0.14.7
Affected Resource(s)
google_storage_transfer_project_service_account (data)
google_storage_bucket_iam_member (resource)
Terraform Configuration Files
Debug Output
Gist
Expected Behavior
Just a label should have been added, no other changes.
Actual Behavior
Label gets added. google_storage_transfer_project_service_account is read and google_storage_bucket_iam_member is forced to be replaced - no change is made here.
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
MY_BILLING_ACCOUNT
in terraform code and Gist logb/302672921
The text was updated successfully, but these errors were encountered: