UNPKG

@adikari/config-manager

Version:

Tool to deploy configs to different stores

24 lines (19 loc) 802 B
'use strict'; const DataLoader = require('dataloader') const { makeUpdateConfigs } = require('./make-update-configs'); const { makeUpdateSecrets } = require('./make-update-secrets'); const { getBatchParameters } = require('./get-batch-parameters'); const { makeGetAllParameters } = require('./make-get-all-parameters'); const makeSsmStore = () => { const ssmLoader = new DataLoader(keys => getBatchParameters({ parameterNames: keys })); const getAllParameters = makeGetAllParameters({ loader: ssmLoader }); const getLatestVersion = key => ssmLoader.load(key); return { getAllParameters, updateConfigs: makeUpdateConfigs({ getAllParameters, getLatestVersion }), updateSecrets: makeUpdateSecrets({ getAllParameters, getLatestVersion }) }; } module.exports = { makeSsmStore };