Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodejs & aws-sdk: Simultaneous access to multiple regions?

Currently setup my S3 access in Node using:

var AWS = require('aws-sdk');
AWS.config.region       = 'us-west-1';
AWS.config.credentials  = new AWS.SharedIniFileCredentials({profile: 'default'});
var s3 = new AWS.S3();

Now I would also like access to SES. Unfortunately, SES does not exist on us-west-1, so I had to setup SES on a different region.

How can I proceed? If I alter AWS.config, will that affect my previously instantiated s3?

like image 687
logidelic Avatar asked Oct 19 '25 09:10

logidelic


1 Answers

Figured out that there are other ways to specify the region. This seems to do the trick:

var AWS = require('aws-sdk');
AWS.config.credentials = new AWS.SharedIniFileCredentials({profile: 'default'});
var s3  = new AWS.S3({region:'us-west-1'});
var ses = new AWS.SES({region:'us-west-2'});
like image 104
logidelic Avatar answered Oct 21 '25 22:10

logidelic



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!