serverless-s3-local
serverless-s3-local copied to clipboard
AWS SDK V3
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);
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);
Hi there ! Thanks for your comments. I added an example of using AWS SDK V3.