Oliver Salzburg Oliver Salzburg - 7 months ago 42
Node.js Question

How can I check if the AWS SDK was provided with credentials?

There are many ways to provide the AWS SDK with credentials to perform operations.

I want to make sure any of the methods were successful in setting up the interface before I try my operation on our continuous deployment system.

How can I check if AWS SDK was able to find credentials?


You can access them via the config.credentials property on the main client. All AWS service libraries included in the SDK have a config property.

Class: AWS.Config

The main configuration class used by all service objects to set the region, credentials, and other options for requests.

By default, credentials and region settings are left unconfigured. This should be configured by the application before using any AWS service APIs.

// Using S3
var s3 = new AWS.S3();