aminueza / terraform-provider-minio

Terraform provider for managing MinIO S3 buckets and IAM Users.
https://registry.terraform.io/providers/aminueza/minio
GNU Affero General Public License v3.0
234 stars 69 forks source link

'minio_iam_group_policy' policy changes are said to be applied but don't really change w/o policy recreation #510

Open nixargh opened 1 year ago

nixargh commented 1 year ago

I see that change of group policy doesn't work.

Steps to Reproduce

  1. Create group policy.
  2. Change actions.
  3. Re-apply terraform.
  4. Check policy description at UI.

I expect policy to be changed. But it didn't.

Provider version: 1.17.2.

Screenshots: 2023-09-06_10-43 2023-09-06_10-43_1

nixargh commented 1 year ago

Some debug information:

module.minio-objects.minio_iam_group_policy.viewer["test3"]: Modifying... [id=test3-viewers:test3-viewer]
2023-09-11T10:23:50.726+0300 [INFO]  Starting apply for module.minio-objects.minio_iam_group_policy.viewer["test3"]
2023-09-11T10:23:50.726+0300 [DEBUG] module.minio-objects.minio_iam_group_policy.viewer["test3"]: applying the planned Update change
2023-09-11T10:23:50.727+0300 [INFO]  provider.terraform-provider-minio_v1.17.2: 2023/09/11 10:23:50 [DEBUG] Getting IAM Group Policy: test3-viewers:test3-viewer: timestamp=2023-09-11T10:23:50.727+0300
2023-09-11T10:23:50.764+0300 [WARN]  Provider "provider[\"registry.terraform.io/aminueza/minio\"]" produced an unexpected new value for module.minio-objects.minio_iam_group_policy.viewer["test3"], but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .policy: was cty.StringVal("{\"Statement\":[{\"Action\":[\"s3:GetObject\",\"s3:GetBucketLocation\",\"s3:ListBucket\",\"s3:ListBucketVersions\",\"s3:GetBucketVersioning\",\"s3:GetObjectVersionTagging\",\"s3:GetObjectVersion\",\"s3:GetObjectRetention\",\"s3:GetLifecycleConfiguration\"],\"Effect\":\"Allow\",\"Principal\":\"*\",\"Resource\":\"arn:aws:s3:::test3/*\",\"Sid\":\"Viewer\"}],\"Version\":\"2012-10-17\"}"), but now cty.StringVal("{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n  {\n   \"Sid\": \"Viewer\",\n   \"Effect\": \"Allow\",\n   \"Action\": [\n    \"s3:GetBucketLocation\",\n    \"s3:GetObject\",\n    \"s3:ListBucket\"\n   ],\n   \"Resource\": [\n    \"arn:aws:s3:::test3/*\"\n   ]\n  }\n ]\n}")
module.minio-objects.minio_iam_group_policy.viewer["test3"]: Modifications complete after 0s [id=test3-viewers:test3-viewer]
nixargh commented 11 months ago

Guys, please, say something to let me know whether you care about or not.