# @dre/aws-env

> Secure way to handle environment variables in Docker with AWS Parameter Store

Latest version **1.1.3** (published 2019-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dre/aws-env
pnpm add @dre/aws-env
yarn add @dre/aws-env
bun add @dre/aws-env
```

Provides the command `aws-env`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-01-10 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | @dre |
| Maintainers | filipeforattini |
| Keywords | aws, env, aws-env, ssm, docker |

## Links

- npm: https://www.npmjs.com/package/@dre/aws-env
- Repository: https://github.com/drentrega/aws-env
- Homepage: https://github.com/drentrega/aws-env#readme
- Issues: https://github.com/drentrega/aws-env/issues
- npm.io page: https://npm.io/package/@dre/aws-env

## Dependencies (2)

- [args](https://npm.io/package/args.md) ^4.0.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.228.1

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.1.3 (latest) — 2019-01-10
- 1.1.2 — 2019-01-10
- 1.1.1 — 2018-10-02
- 1.1.0 — 2018-10-02
- 1.0.13 — 2018-09-30
- 1.0.12 — 2018-09-21
- 1.0.11 — 2018-09-21
- 1.0.10 — 2018-09-21
- 1.0.8 — 2018-09-21
- 1.0.7 — 2018-09-21
- 1.0.6 — 2018-09-21

## README

# @dre/aws-env

A secure way to handle environment variables in Docker with AWS Parameter Store.

This project is just a fork, the original project you can find at [developers-vitta/awsenv](https://github.com/developers-vitta/awsenv).

## Install

```bash
$ npm i -g @dre/aws-env
```

## Usage ways

### Simple

#### First suggestion:

```bash
$ aws-env -r sa-east-1 \
  -n /staging/my-app

# this will result as:
export NODE_ENV=staging
export DB_USERNAME=root
export DB_PASSWORD=mysecretpassword

# so, you may use as:
$ $(aws-env -r sa-east-1 -n /staging/my-app)
```

#### Second suggestion:

With a combination of [dotenv](https://www.npmjs.com/package/dotenv), this is another solution at build stage:

```bash
$ aws-env -p "" \
  -r sa-east-1 \
  -n /staging/my-app

# this will result as:
NODE_ENV=staging
DB_USERNAME=root
DB_PASSWORD=mysecretpassword

# so, you may use as:
$ aws-env -p "" \
  -r sa-east-1 \
  -n /staging/my-app > /app/myapp/.env
$ cat /dre/mysapp/.env
NODE_ENV=staging
DB_USERNAME=root
DB_PASSWORD=mysecretpassword

# or with output option:
$ aws-env -p "" \
  -r sa-east-1 \
  -n /staging/my-app \
  -o /app/myapp/.env
$ cat /dre/mysapp/.env
NODE_ENV=staging
DB_USERNAME=root
DB_PASSWORD=mysecretpassword
```

### Using Environment Variables

```bash
# first you set your variables
export AWS_REGION=sa-east-1
export AWSENV_NAMESPACE=/staging/my-app
export AWSENV_OUT=/app/mysapp/.env

# exec it
$ aws-env

# this will result as:
export NODE_ENV=staging
export DB_USERNAME=root
export DB_PASSWORD=mysecretpassword

# or
$ aws-env --prefix "" \
  --out /app/myapp/.env
$ cat /app/mysapp/.env
NODE_ENV=staging
DB_USERNAME=root
DB_PASSWORD=mysecretpassword
```

## Contribuiting

Fork-it first, and:

```bash
$ npm link
$ aws-env version
```

Make your magic!

---
_Source: https://npm.io/package/@dre/aws-env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
