Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save takahirohonda/986d2b28ef28064fbc00923cf9d13cae to your computer and use it in GitHub Desktop.

Select an option

Save takahirohonda/986d2b28ef28064fbc00923cf9d13cae to your computer and use it in GitHub Desktop.
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-2.js
'use strict';
const { getParameters } = require('@mdhnpm/aws-ssm-parameters');
// Input is an array of parameter names
const parameterNames = [
'my.db.endpoint',
'my.db.name',
'my.db.password',
'my.db.username'
];
const getParams = async () => {
// Argument is (1) an array of parameter name & (2) AWS region
const parameters = await getParameters(parameterNames, 'ap-southeast-2');
console.log(parameters);
}
// The module creates a Json object
// with parameter name as key and actual value as value
// Decrypt option is enabled. It works on secure string.
// {
// my.db.endpoint:'endpoint-url',
// my.db.name: 'database-name',
// my.db.password: 'database-pw',
// my.db.usernme: 'database-username'
// }
getParams()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment