-
Notifications
You must be signed in to change notification settings - Fork 69
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
minio_iam_policy order keeps shifting #117
Comments
This is caused by these being stored as terraform-provider-minio/minio/payload.go Lines 97 to 101 in b2774a1
https://pkg.go.dev/github.com/minio/minio-go/v7/pkg/set#StringSet encoding/json would sort the keys of maps, but it's being overridden to get the list-like marshaling: If terraform can't be taught a smarter comparison mechanism, then ToSlice should alphabetize the list, on both sides (data fetched from minio, data created from *.tf). |
It looks like the most straightforward place to address this might be the terraform-provider-minio/minio/resource_minio_iam_policy.go Lines 163 to 170 in b2d72d6
It looks like this is a wrapper around jen20/awspolicyequivalence which seems to require the order to be the same. It looks like there's a hashicorp fork here hashicorp/awspolicyequivalence that fixes this issue. I'll put in a PR replacing this to see if it works |
I don't know if this problem originates from this code, or if minio itself keeps shuffling this (and the provider should just somehow cope with it), but I keep getting output like this from
terraform plan
:Updating the *.tf to match the order here doesn't really matter; in a couple of runs, it'll show a different order.
All the lists seem to be getting shuffled, observing
Resource
,Action
.And in the end, terraform thinks that there are no changes to apply, so something seems to be doing an order-independent comparison, but the diffs are distractingly long.
The text was updated successfully, but these errors were encountered: