Created
April 6, 2020 19:10
-
-
Save blasterpal/8de7bc5a6b800df05c1129035e7ba414 to your computer and use it in GitHub Desktop.
Test JS Secret in Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: process.env.AWS_ACCESS_KEY_ID, | |
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | |
region: process.env.AWS_REGION | |
}); | |
var secretsmanager = new AWS.SecretsManager(); | |
var params = { | |
SecretId: "api-xxxxxxx" | |
}; | |
secretsmanager.getSecretValue(params, function(err, data) { | |
if (err) console.log(err, err.stack); // an error occurred | |
else console.log(data); // successful response | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment