Open sblask opened 3 years ago
@sblask This is an interesting diff situation. I agree with you that there should be no update in place if there are no changes. In other words, with we would hope that using foreach
would be equivalent to duplicating the configuration for each of the users, which would not cause a diff with the existing users. Off the bat, nothing jumps out why this would happen.
Hopefully we'll have a chance to dig into this before too long. I'll update the title a little so if others are having the issue we can hopefully figure out what's going on.
Related #14447 Related #18035
My solution was to stop using the datasource and just generate the json inside the aws_aim_policy
, this also might work with a local so you can reuse it
My solution was to stop using the datasource and just generate the json inside the
aws_aim_policy
, this also might work with a local so you can reuse it
@albertorm95 Can you please post the code that worked for you?
Is there any update on this issue? I am facing the same
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform 15.0 and AWS 3.36
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/sblask/6e24b1b5489f39fc96b181f98282804b
Expected Behavior
When local.users is modified only added/removed user resources should appear in the plan
Actual Behavior
For each user in local.users a aws_iam_policy_document is shown with
will be read during apply
and a aws_iam_policy withwill be updated in-place
even though there are no changes to policy.Steps to Reproduce
Start with
and run
terraform apply
Add "baz" to the list and run
terraform plan