Skip to content

Instantly share code, notes, and snippets.

@raphaellondner-mongodb
Last active February 6, 2018 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphaellondner-mongodb/5ad3a4c9d017aef99f36f11f80c2f20c to your computer and use it in GitHub Desktop.
Save raphaellondner-mongodb/5ad3a4c9d017aef99f36f11f80c2f20c to your computer and use it in GitHub Desktop.
AWS KMS code to decrypt the encrypted connection string
const kms = new AWS.KMS();
kms.decrypt({ CiphertextBlob: new Buffer(uri, 'base64') }, (err, data) => {
if (err) {
console.log('Decrypt error:', err);
return callback(err);
}
atlas_connection_uri = data.Plaintext.toString('ascii');
processEvent(event, context, callback);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment