Oliver Salzburg
Oliver Salzburg

Reputation: 22099

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?

Upvotes: 5

Views: 5136

Answers (1)

peteb
peteb

Reputation: 19418

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();
console.log(s3.config.credentials);

Upvotes: 7

Related Questions