serverless-s3-local icon indicating copy to clipboard operation
serverless-s3-local copied to clipboard

AWS SDK V3

Open jlgouwyapizr opened this issue 4 years ago • 2 comments

Hey there,

Since I use SDK V3 and the client-s3, I always receive :

getaddrinfo ENOTFOUND local-my-name-bucket.localhost

Do you have an example which work ? or is not compatible at all ?

I tried different configuration, but seems not working :

if(process.env.IS_OFFLINE) {
  awsParams = {
    credentials: {
      accessKeyId: 'S3RVER', 
      secretAccessKey: 'S3RVER',
    },
    endpoint: 'http://localhost:4569',
  }
}
const s3 = new S3(awsParams);

jlgouwyapizr avatar Nov 08 '21 18:11 jlgouwyapizr

In my environment, I added forcePathStyle and it succeeded 😄

if(process.env.IS_OFFLINE) {
  awsParams = {
    credentials: {
      accessKeyId: 'S3RVER', 
      secretAccessKey: 'S3RVER',
    },
+   forcePathStyle: true,
    endpoint: 'http://localhost:4569',
  }
}
const s3 = new S3(awsParams);

kuronekomichael avatar Feb 07 '22 07:02 kuronekomichael

Hi there ! Thanks for your comments. I added an example of using AWS SDK V3.

ar90n avatar Mar 08 '22 09:03 ar90n