Created
August 19, 2019 12:36
-
-
Save takahirohonda/986d2b28ef28064fbc00923cf9d13cae to your computer and use it in GitHub Desktop.
node-module-to-retrieve-multiple-parameters-from-aws-parameter-store-2.js
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
| '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