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

Import minio_ilm_tier resource #578

Closed george-zubrienko closed 3 months ago

george-zubrienko commented 3 months ago

Description

Import of minio_ilm_tier fails with resource not found, while resource id seems to be equal to tier name.

Steps to Reproduce

  1. Create an ILM tier (s3) through tenant UI, name IA_COLD_STORAGE
  2. atlantis/terraform import -d ... -w .. 'minio_ilm_tier.s3' 'IA_COLD_STORAGE'

Expected behavior: Successful import

Actual behavior:

minio_ilm_tier.s3: Importing from ID "IA_COLD_STORAGE"...
minio_ilm_tier.s3: Import prepared!
  Prepared minio_ilm_tier for import
minio_ilm_tier.s3: Refreshing state... [id=IA_COLD_STORAGE]
╷
│ Error: Cannot import non-existent remote object
│ 
│ While attempting to import an existing object to "minio_ilm_tier.s3", the
│ provider detected that no object exists with the given id. Only
│ pre-existing objects can be imported; check that the id is correct and that
│ it is associated with the provider's configured region or endpoint, or use
│ "terraform apply" to create a new remote object for this resource.
╵

Reproduces how often: I haven't found a workaround :(

On read, id is set to tier name, but import doesn't like that for some reason:

https://github.com/aminueza/terraform-provider-minio/blob/main/minio/resource_minio_ilm_tier.go#L284

Versions

2.4.2

george-zubrienko commented 3 months ago

@s-vitaliy fyi - maybe you or Adelina can quick fix