# @reapit/config-manager

> Node package for managing configuration and environment variables in AWS Systems Manager Parameter Store

Latest version **2.1.0** (published 2021-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reapit/config-manager
pnpm add @reapit/config-manager
yarn add @reapit/config-manager
bun add @reapit/config-manager
```

Provides the commands `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`.

## 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 | 2.1.0 |
| Published | 2021-03-02 |
| First published | 2019-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 16.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | wmcvay@reapit.com |
| Maintainers | wmcvayreapit, dawsonscott |

## Links

- npm: https://www.npmjs.com/package/@reapit/config-manager
- Repository: https://github.com/reapit/foundations
- Homepage: https://github.com/reapit/foundations#readme
- Issues: https://github.com/reapit/foundations/issues
- npm.io page: https://npm.io/package/@reapit/config-manager

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [yargs](https://npm.io/package/yargs.md) ^16.2.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.853.0
- [prompts](https://npm.io/package/prompts.md) ^2.4.0
- [prettier](https://npm.io/package/prettier.md) ^2.2.1
- [ansi-styles](https://npm.io/package/ansi-styles.md) ^5.1.0
- [change-case](https://npm.io/package/change-case.md) ^4.1.2

## Recent versions

- 2.1.0 (latest) — 2021-03-02
- 2.0.8 — 2020-08-12
- 2.0.7 — 2020-08-11
- 2.0.6 — 2020-08-11
- 2.0.5 — 2020-08-11
- 2.0.4 — 2020-08-11
- 2.0.3 — 2020-08-11
- 2.0.2 — 2020-08-11
- 2.0.1 — 2020-08-10
- 2.0.0 — 2020-08-10
- 1.1.1 — 2020-01-14
- 1.1.0 — 2019-12-16
- 1.0.3 — 2019-12-16
- 1.0.2 — 2019-12-16
- 1.0.1 — 2019-12-12
- … 1 more at https://npm.io/package/@reapit/config-manager/versions

## README

# Config Manager

A thin wrapper around AWS Systems Mananger, Parameter Store for keeping remote config secure. For usage visit [here](https://foundations-documentation.reapit.cloud/app-development#config-manager).

The package is intended to act as a convenient CLI tool for updating remote configuration in AWS and for use in a CI environment for pulling configuration into build processes.

## Pre-Requisites:

You should have an AWS Access Key Id and AWS Secret Access Key in your bash / shell profile. For instructions on this [visit here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).

## Usage:

For basic usage, with NodeJS installed, run `npm install -g @reapit/config-manager`.

You will need to create a source file for your parameter if creating or updating. The default source file is `config.json` in your current working directory however, it is likely you will want to provide a custom source file. See below `--file-path` flag for more information.

Then with either yarn run `yarn config-manager` or with NPM run `npx config-manager`.

This will load a CLI that will walk you through the process of config management.

For CI usage, you will need to pass flags and values to the Yarn or NPM task as below:

`--mode` Either `create`, `update`, `delete` or `fetch`. Each mode will select the corresponding CRUD method in Parameter Store.

`--namespace` The base key of your parameter - e.g. name of team or owner. Will be PascalCased by the lib.

`--entity` The next level key of your parameter - e.g. application, service name, db-name. Will be PascalCased by the lib.

`--name` Optional next level key of your parameter - e.g. enviroment name or a specific variable name.

`--file-path` A relative or absolute path to your source file if you are updating or creating a parameter. If you are fetching a parameter, this is desired target file for the returned resource. Defaults to `./config.json` for JSON format and `./config.txt` for strings (see format below) however, it can be any filetype that can be parsed by Node / CommonJS as a string.

`--format` Either `string` or `json`, defaults to `json`. Parameter store considers any value to be a string but if you provide an object or JSON as your source file, we will `JSON.stringify` it before saving. If fetching, we will `JSON.parse` the returned value before writing to target file.

## Examples

A sample query to fetch a parameter in the format of `/CloudTeam/DeveloperPortal/Production` writing to a custom JSON file would look like `yarn config-manger --mode fetch --namespace cloudTeam --entity developerPortal --name production --file-path ./custom.json --format json`

You can also override values by adding additional flags, useful if you want to pass in a different filename or variable name based on a CI enviroment. To do this, just add an additional named flag and the library will apply the last value specified eg `yarn config-manger --mode fetch --namespace cloud --entity marketplace --name production --name local` will return a parameter in the format `/Cloud/Marketplace/Local`

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