0

I am using minio client to access S3. The S3 storage I am using has two endpoints - one (say EP1) which is accessible from a private network and other (say EP2) from the internet. My application creates a presigned URL for downloading an S3 object using EP1 since it cannot access EP2. This URL is used by another application which is not on this private network and hence has access only to EP2. This URL is (obviously) not working when used by the application outside the network since this URL has EP1 in it.

I have gone through minio documentation but did not find anything which help me specify alternate endpoints.

So my question is -

  1. Is there anything which I have missed from minio that can help me?
  2. Is there any S3 feature which allows generating presigned URL for an object with EP2 in it?
  3. Or is this not solvable without changing current network layout?
aniztar
  • 2,443
  • 4
  • 18
  • 24

1 Answers1

0

You can use minio-js to manage this

Here is an example that you can use

var Minio = require('minio')

var s3Client = new Minio.Client({
 endPoint: "EP2",
  port: 9000,
  useSSL: false,
  accessKey: "minio",
  secretKey: "minio123",
  region: "us-east-1"
})

var presignedUrl = s3Client.presignedPutObject('my-bucketname', 'my-objectname', 1000, function(e, presignedUrl) {
  if (e) return console.log(e)
  console.log(presignedUrl)
})

This will not contact the server at all. The only thing here is that you need to know the region that bucket belongs to. If you have not set any location in minio, then you can use us-east-1 by default.

r1j1m1n1
  • 345
  • 1
  • 4