How to use the CredentialProviderChain function from aws-sdk
Find comprehensive JavaScript aws-sdk.CredentialProviderChain code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16 17 18
let credentials = {}; const setAWSCredentials = async () => { try { const credentialProviderChain = new AWS.CredentialProviderChain(); credentials = await credentialProviderChain.resolvePromise(); } catch (e) { console.error('Failed to get AWS credentials'); throw e;
44
71
0
GitHub: aws/graph-explorer
9 10 11 12 13 14 15 16 17 18 19
const fs = require("fs"); const path = require("path"); const getCredentials = async () => { let credentials; let credProvider = new AWS.CredentialProviderChain(); try { credentials = await new Promise((resolve, reject) => { credProvider.resolve(function (err, creds) { if (err) {
21
162
0
GitHub: nulib/work-archiver
49 50 51 52 53 54 55 56 57 58
request.method = "GET"; request.path += `${index}/_doc/${workId}?_source=title,accession_number,file_sets`; request.headers["host"] = elasticsearchEndpoint; request.headers["Content-Type"] = "application/json"; let chain = new AWS.CredentialProviderChain(); chain.resolve((err, credentials) => { if (err) { console.error("Returning unsigned request: ", err); } else {
0
0
0
+ 2 other calls in file
22 23 24 25 26 27 28 29 30 31
// Assumption is that loading only needs to happen once per execution and if refreshing is // needed, credentials object should implement credentials.refresh() callback if (!credentials) { if (useAwsChain) { isAwsCredentials = true credentials = await new AWS.CredentialProviderChain().resolvePromise() } else if (useAwsCredentials) { credentials = { accessKeyId: parent.options.awsAccessKeyId, secretAccessKey: parent.options.awsSecretAccessKey,
0
0
0
GitHub: dgracilieri/aws-to-slack
118 119 120 121 122 123 124 125 126 127
() => new AWS.EnvironmentCredentials("AMAZON"), () => new AWS.SharedIniFileCredentials({ profile: config.profile || "default" }), () => new AWS.EC2MetadataCredentials(), ]; (new AWS.CredentialProviderChain()).resolve((err, cred) => { if (err) { reject(err); } else {
0
0
0
8 9 10 11 12 13 14 15 16 17
() => new AWS.EnvironmentCredentials(prefix), () => new AWS.SharedIniFileCredentials({ profile: config.profile || 'default' }), () => new AWS.EC2MetadataCredentials() ]; const chain = new AWS.CredentialProviderChain(); chain.resolve((err, credentials) => { if (err) { return cb(err);
0
0
1
+ 27 other calls in file
aws-sdk.S3 is the most popular function in aws-sdk (7245 examples)