Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to use instead of aws.Endpoint in AWS SDK v3?

I have started migration of AWS SDK from v2 to v3. Can`t figure out what to use to create endpoint for S3.

In v2 I have: const aws = require('aws-sdk'); const ep = new aws.Endpoint(s3.region.amazonaws.com); What package need to use in V3 for this ?

like image 589
Vadim Khismatov Avatar asked Oct 14 '25 23:10

Vadim Khismatov


1 Answers

did you try this?

const { S3Client } = require('@aws-sdk/client-s3');

const s3 = new S3Client({ region: 'region' });

for custom endpoint, try this:

const s3 = new S3Client({ endpoint: 'https://s3.region.yourendpoint', region: 'region' });

like image 60
walid nsiri Avatar answered Oct 18 '25 04:10

walid nsiri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!