This package has been deprecated

Author message:

WARNING: This project has been renamed to @laconia/ssm-config. Install using @laconia/ssm-config to get the latest version.

@laconia/ssm

0.6.0 • Public • Published

@laconia/ssm

CircleCI Coverage Status Apache License

🛡️ Laconia SSM - Retrieves parameters and secrets from AWS SSM.

Features

  • Convention over configuration: Set environment variables and your parameters and secrets will be made available in LaconiaContext

Install

npm install --save @laconia/ssm

Usage

Set your lambda environment variable:

LACONIA_SSM_MY_SECRET: /path/to/my/secret

@laconia/ssm will scan all environment variables that start with LACONIA_SSM and inject the retrieved SSM parameters to LaconiaContext. The name of the instances will be extracted from the environment variable name, then converted to camel case. The instance you'll get in your LaconiaContext from the above configuration will be mySecret:

const ssm = require("@laconia/ssm");
const laconia = require("@laconia/core");

const handler = async ({ mySecret }) => {
  // use mySecret
};

module.exports.handler = laconia(handler).register(ssm.envVarInstances());

All SSM parameters are decrypted by default.

API

ssm.envVarInstances

Scans environment variables set in the current Lambda and automatically retrieves parameters from SSM. SSM#getParameters is used to retrieve the parameters. All parameters are decrypted by default.

Example:

const ssm = require("@laconia/ssm");
const laconia = require("@laconia/core");

const handler = async ({ someSecret }) => {
  /* logic */
};

module.exports.handler = laconia(handler).register(ssm.envVarInstances());

Package Sidebar

Install

npm i @laconia/ssm

Weekly Downloads

0

Version

0.6.0

License

Apache-2.0

Unpacked Size

3.83 kB

Total Files

4

Last publish

Collaborators

  • tschoffelen
  • ceilfors