Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/supersoniko/aws-secrets-dotenv

Easily manage your environment variables on AWS with .env
https://github.com/supersoniko/aws-secrets-dotenv

Last synced: about 4 hours ago
JSON representation

Easily manage your environment variables on AWS with .env

Awesome Lists containing this project

README

        

![npm](https://img.shields.io/npm/v/aws-secrets-dotenv)
![NPM](https://img.shields.io/npm/l/aws-secrets-dotenv)

# aws-secrets-dotenv

aws-secrets-dotenv is a tool that manages your envrionment variables for an application stored in the [AWS Secrets Manager](https://aws.amazon.com/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

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

## Usage
The default stage is `dev`.
```js
// 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.
}
````