UNPKG

399 BPlain TextView Raw
1import * as ssm from './ssm';
2
3/**
4 * Fetches the encrypted config from SSM and returns
5 * the decrypted and parsed JSON object
6 * @param {String} configName [description]
7 * @return {[type]} [description]
8 */
9export function getConfig<T>(configName: string = 'dev-config'): Promise<T> {
10 return ssm.getEncryptedParameter(configName).then(data => JSON.parse(data.Parameter.Value));
11}