admin管理员组

文章数量:1295863

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?

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?

Share Improve this question asked Nov 1, 2016 at 18:37 logideliclogidelic 1,69521 silver badges46 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 14

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'});

本文标签: javascriptNodejs amp awssdk Simultaneous access to multiple regionsStack Overflow