Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dsandor/aws-secret-manager

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dsandor/aws-secret-manager

A simple way to get a secret from AWS Secrets Manager.

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

aws-secret-manager

A simple way to get a secret from AWS Secrets Manager.

Assumes that AWS credentials are set in .aws or as Environment Variables.

install

yarn add @dsandor\aws-secret-manager

usage

const SecretManager = require('@dsandor\aws-secret-manager');

const secretManager = new SecretManager('my-secret-id');
const secret = await secretManager.getSecrets();

You can also pass the secret id on the getSecrets call.

const SecretManager = require('@dsandor\aws-secret-manager');

const secretManager = new SecretManager();
const secret = await secretManager.getSecrets('my-secret-id');

Or one line if you wish;

const SecretManager = require('@dsandor\aws-secret-manager');

const secret = await new SecretManager().getSecrets('my-secret-id');

Constructor

  /**
   * .ctor
   * @param secretName - optionally set the secret to retrieve.
   * @param region - the AWS region where the secret exists. Defaults: AWS_REGION, AWS_DEFAULT_REGION, us-east-1
   */
  SecretManager(secretName, region = process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION'] || 'us-east-1')

getSecrets

 /**
   * Get's the secrets for an environment.
   * @param secretName - the name (or id) of the secret in AWS.
   * @returns {Promise<string|any>} - Returns a JS Object if the results can be parsed otherwise it returns the raw string.
   */
  async getSecrets(secretName = this.secretName)

FAQs

Package last updated on 29 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc