Open Bibz87 opened 1 month ago
same on my side -first run after pass change error and user deleted -second run user recreated as new user
'''2024-09-19T01:29:21.657+0200 [INFO] backend/local: apply calling Apply 2024-09-19T01:29:21.657+0200 [DEBUG] Building and walking apply graph for NormalMode plan 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_s3_bucket.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_group_policy_attachment.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_user.test" (terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_group.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_group_membership.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_ilm_policy.bucket_lifecycle_rules (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_policy.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_user.this (expand)" (terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.658+0200 [DEBUG] ProviderTransformer: "minio_iam_user.test (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/aminueza/minio"] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_user.test" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_user.test (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_group.this (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "local.filtered_bucket_names (expand)" references: [local.new_names (expand)] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "local.bucket_names (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_group_membership.this (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_s3_bucket.this (expand)" references: [local.bucket_names (expand)] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_ilm_policy.bucket_lifecycle_rules (expand)" references: [local.bucket_names (expand)] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/aminueza/minio\"]" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_policy.this (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_group_policy_attachment.this (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "local.new_names (expand)" references: [] 2024-09-19T01:29:21.659+0200 [DEBUG] ReferenceTransformer: "minio_iam_user.this (expand)" references: [local.bucket_names (expand)] 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_iam_group.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: local.filtered_bucket_names (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_iam_group_membership.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_s3_bucket.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_ilm_policy.bucket_lifecycle_rules (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_iam_user.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: local.new_names (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_iam_group_policy_attachment.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: local.bucket_names (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] pruneUnusedNodes: minio_iam_policy.this (expand) is no longer needed, removing 2024-09-19T01:29:21.660+0200 [DEBUG] Starting graph walk: walkApply 2024-09-19T01:29:21.661+0200 [DEBUG] created provider logger: level=debug 2024-09-19T01:29:21.661+0200 [INFO] provider: configuring client automatic mTLS 2024-09-19T01:29:21.669+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/aminueza/minio/2.5.0/darwin_arm64/terraform-provider-minio_v2.5.0 args=[.terraform/providers/registry.terraform.io/aminueza/minio/2.5.0/darwin_arm64/terraform-provider-minio_v2.5.0] 2024-09-19T01:29:21.673+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/aminueza/minio/2.5.0/darwin_arm64/terraform-provider-minio_v2.5.0 pid=89079 2024-09-19T01:29:21.673+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/aminueza/minio/2.5.0/darwin_arm64/terraform-provider-minio_v2.5.0 2024-09-19T01:29:21.689+0200 [INFO] provider.terraform-provider-minio_v2.5.0: configuring server automatic mTLS: timestamp=2024-09-19T01:29:21.688+0200 2024-09-19T01:29:21.696+0200 [DEBUG] provider: using plugin: version=5 2024-09-19T01:29:21.696+0200 [DEBUG] provider.terraform-provider-minio_v2.5.0: plugin address: address=/var/folders/ps/lcq6km7x6ts2kwg1ntf09frm0000gn/T/plugin2125986001 network=unix timestamp=2024-09-19T01:29:21.696+0200 2024-09-19T01:29:21.706+0200 [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/aminueza/minio\"]" changed the config value, but that value is unused 2024-09-19T01:29:21.708+0200 [WARN] Provider "registry.terraform.io/aminueza/minio" produced an invalid plan for minio_iam_user.test, 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:
It seems that the root cause of the issue is the following: if force_destroy = true
was set and user modification was requested, the provider deletes the user which leads to inconsistent result in terraform apply.
The bug was introduced in #141 and it can be reproduced with any resource referring the user resource created with force_destroy = true
.
It makes impossible to modify any attributes of the user if force_destroy was set to true.
Thanks for investigating it, @s-vitaliy!
Do you think it's possible to fix this bug without a breaking change?
Hi, @felladrin.
My team is very interested in fixing this issue, as it can lead to the Terraform state breaking which would be a nightmare to fix.
Could you please elaborate on the user scenario behind the force_destroy
property? It's not very clear to me from the minio_iam_user
documentation, in which cases a user can utilize this property?
It seems that we can remove the following code from the minioUpdateUser
function:
if iamUserConfig.MinioForceDestroy {
return minioDeleteUser(ctx, d, meta)
}
This change could lead to behavior changes visible to the users: if force_destroy = true
is set and a modification of user properties has been requested, the user will no longer be deleted.
Anyway, to be honest, it's hard to imagine that someone expects the user to be deleted if terraform plan says that the user object should be modified.
I agree with the removal of force_destroy
while updating the user. I don't remember why it was added, but I thought it would be a good moment to remove it, considering we'll need to release a v3 of the provider, due to this change.
Description
Attempting to change a user's password results in this error:
Sample configuration
Steps to Reproduce
terraform init
terraform apply
(use any 8+ characters password)terraform apply
(use a different password from previous step)Expected behavior: Terraform updates the user's password
Actual behavior: Terraform deleted the user
Reproduces how often: 100%
Versions
Additional Information
Looks like the provider also doesn't like having a user being deleted outside Terraform when referenced in other resources. Attempting to do anything with the configuration (
plan
,apply
ordestroy
) results in this error: