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
243 stars 73 forks source link

Recreate deleted (missing) resources instead of [FATAL]ing #511

Closed deefdragon closed 1 year ago

deefdragon commented 1 year ago

Description

Due to a series of mistakes, a large number of resources were unintentionally deleted manually from minio via the console. When attempting to re-create these resources via terraform, terraform produces a [FATAL] error ie failed to load user Infos (username): The specified user does not exist. (Specified user does not exist)

In this case, the only solution was to terraform state rm for every resource manually, and then re-run terraform creation.

At minimum, running a terraform refresh to manually update the state should not fatal, as that would allow the user to manually update most resources and re-create them later.

Steps to Reproduce

  1. create user in minio.
  2. delete user manually from terraform console
  3. attempt terraform refresh or other command with that user.

Expected behavior: [What you expect to happen]

terraform apply would mark the resource as requiring replacement, or to be created during refresh step.

Actual behavior: [What actually happens] [FATAL] errors until state removed via terraform state rm <RESOURCE ID>.

Reproduces how often: [What percentage of the time does it reproduce?] [FATAL] errors until state removed.