/aws-secret-manager-fetcher

Get secrets from AWS secret manager

Primary LanguageJavaScriptApache License 2.0Apache-2.0

AWS Secret Manager Fetcher JavaScript Style Guide

A dead simple module to fetch secrets from AWS secret manager.

Install

> npm install --save aws-secret-manager-fetcher

Usage

const { fetchSecrets } = require('aws-secret-manager-fetcher')

async function init () {
  try {
    let secrets = await fetchSecrets('my-secret-name')
  } catch (e) {
    console.log('Error getting secrets ', e)
  }
}

API

fetchSecrets(secretName, [, awsParams])

  • secretName (String) - name of your secret.
  • awsParams (Object) - AWS SecretManager constructor params. If empty or missing a region property, the default will be: { region: 'us-east-1' }