SSMParameterStore
λ✨Ergonomic SSM Parameter Store wrapper for AWS Lambda designed with ease-of-use in mind, with built-in caching and idempotent preloading, TypeScript compile time checks, and handy autocompletion.
https://www.npmjs.com/package/ssm-parameter-store
Installation
npm install --save ssm-parameter-store
Changelog
3.0.0
- Now uses AWS SDK v3 and supports the Node.js 18.x runtime on AWS Lambda. If you need to use AWS SDK v2, use the
2.1.2
release of this package.
2.1.2
- Take an SSM parameter store instance as a constructor parameter instead of initializing it within the package.
Usage
const { SSMClient } = require('@aws-sdk/client-ssm');
const SSMParameterStore = require('ssm-parameter-store');
const parameters = new SSMParameterStore(new SSMClient(), {
SomeParameter: 'some_parameter',
SomeNestedParameter: '/some/nested/parameter',
NonExistentParameter: 'this_parameter_doesnt_exist_on_ssm'
});
exports.handler = async (event, context) => {
await parameters.preload();
await parameters.getAll();
await parameters.preload({ ignoreCache: true });
await parameters.get('SomeParameter'));
await parameters.get('SomeParameter', { ignoreCache: true });
await parameters.get('UndeclaredParameter');
}