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
227 stars 68 forks source link

Endpoint is not saved for ILM tier when using S3 config #570

Closed george-zubrienko closed 1 week ago

george-zubrienko commented 2 weeks ago

Description

When creating an ILM tier with AWS S3 target, but using the custom endpoint - common case is dualstack endpoint:

s3.dualstack.{region}.amazonaws.com, the endpoint setting is ignored and saved as s3.amazonaws.com, causing drift.

Steps to Reproduce

  1. Create ILM tier:
resource "minio_ilm_tier" "s3" {
  name     = "IA_COLD_STORAGE"
  bucket   = data.aws_s3_bucket.cold_storage.bucket
  type     = "s3"
  endpoint = "https://s3.dualstack.us-east-1.amazonaws.com"

  s3_config {
    access_key    = ...
    secret_key    = ...
    storage_class = "ONEZONE_IA"
  }
}

Expected behavior:

Remote tier is created with s3.dualstack.us-east-1.amazonaws.com endpoint

Actual behavior:

Remote tier is created with s3.amazonaws.com endpoint

Reproduces how often: Always

Versions

2.3.2

Additional Information

Seems to be related to this line https://github.com/aminueza/terraform-provider-minio/blob/main/minio/resource_minio_ilm_tier.go#L192, endpoint is passed for MinIO but not for S3 tier backend

felladrin commented 2 weeks ago

Hi, @george-zubrienko. Would you be willing to open a PR with the fix for this issue? We're looking for more maintainers for this project at this moment, so any extra hand would be greatly appreciated! Thanks!

george-zubrienko commented 2 weeks ago

@felladrin my colleague just submitted a fix - and yes, we'll be happy to help maintain the provider as we are relying on it in our production systems!