How to configure the region in Node.js AWS SDK?

Sometimes, we want to configure the region in Node.js AWS SDK.

In this article, we’ll look at how to configure the region in Node.js AWS SDK.

How to configure the region in Node.js AWS SDK?

To configure the region in Node.js AWS SDK, we can call the aws.config.update method.

For instance, we write

const AWS = require('aws-sdk');
AWS.config.update({
  region: 'us-east-1'
});

const dd = new AWS.DynamoDB();
const s3 = new AWS.S3();

to set the region to 'us-east-1' with AWS.config.update.

Conclusion

To configure the region in Node.js AWS SDK, we can call the aws.config.update method.