2.0.0 • Published 4 months ago

aws-secrets-dotenv v2.0.0

Weekly downloads
40
License
MIT
Repository
github
Last release
4 months ago

npm NPM

aws-secrets-dotenv

aws-secrets-dotenv is a tool that manages your envrionment variables for an application stored in the AWS Secrets Manager.

The tool can store envrionment variables from the machine it's run on to the AWS Secrets Manager and retrieve secrets from AWS to a .env file which is a standard for a lot of technologies. This tool is typically used in the build pipeline of an application.

NOTE: Always be careful not to leak the .env file. This is a common security concern.

Installation

npm install aws-secrets-dotenv --save-dev
// .secretsrc
{
  "Name": "MyProject",
  "Description": "My super cool project!",
  "LIST_OF_SECRETS": [
    "DATABASE_URI"
  ]
}

Usage

The default stage is dev.

// package.json
  "scripts": {
    "upload-secrets": "aws-secrets-dotenv createOrUpdateSecret prod", // Store the environment variables of this machine to AWS Secrets Manager for prod environment.
    "retrieve-secrets": "aws-secrets-dotenv createLocalEnvironment prod" // Retrieve the environment variables from AWS Secrets Manager prod envrionment to a .env file in the root folder.
  }