Skip to content

Conversation

benclapp
Copy link

Adding the new ap-southeast-6 region to awsS3EndpointMap

@shaneday
Copy link

This endpoint is active now. Unfortunately, some software using minio-go is unable to access AWS endpoints unless they are in here. There was a PR that included this change 5 months ago, but these lines were rejected because the domains didn't resolve yet.

Can someone with write access please approve this so it can get into release, and in turn get into the next release of applications.

@harshavardhana
Copy link
Member

This endpoint is active now. Unfortunately, some software using minio-go is unable to access AWS endpoints unless they are in here. There was a PR that included this change 5 months ago, but these lines were rejected because the domains didn't resolve yet.

Can someone with write access please approve this so it can get into release, and in turn get into the next release of applications.

@shaneday as an application you should do your own thing if you want more dynamism in your application.

  func geographicRegionMapper(u url.URL) string {
      hostname := u.Hostname()

      // Map geographic identifiers to AWS-compatible regions
      regionMap := map[string]string{
          "us-storage.example.com":     "us-east-1",
          "eu-storage.example.com":     "eu-west-1",
          "asia-storage.example.com":   "ap-southeast-1",
          "local-storage.example.com":  "us-west-2",
      }

      if region, found := regionMap[hostname]; found {
          return region
      }

      return "us-east-1" // default
  }

  func main() {
      minioClient, err := minio.New("eu-storage.example.com", &minio.Options{
          Creds:              credentials.NewStaticV4("key", "secret", ""),
          CustomRegionViaURL: geographicRegionMapper,
      })
      // Client will use "eu-west-1" region
  }

You don't have to rely on us anymore to keep this updated.

@benclapp
Copy link
Author

benclapp commented Oct 4, 2025

Hey @harshavardhana , thanks for having a look! Apologies for the delayed response - life 😅

For context I was adding this new region to eventually update the use of this client for the Thanos project. However to my understanding this issue might be the same with other consumers too.

I had a spin with your suggested alternative, using a custom CustomRegionViaURL function. However I couldn't get this to work. I think it is because CustomRegionViaURL is only used if the Region is not set in the minio options when creating the client. https://github.com/minio/minio-go/blob/master/api.go#L278-L285

With Thanos, both the region and endpoint are provided and the client is successfully created. It's the first request with the new client that actually fails. Tracing through it's because getS3Endpoint() is eventually called as part of the executeMethod() for Amazon endpoints.

Given this, would you be open to reconsidering this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants