# @grabvintage/babel-plugin-transform-ssm

> Fetch SSM parameters at compile time and insert them in your code.

Latest version **1.1.0** (published 2021-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @grabvintage/babel-plugin-transform-ssm
pnpm add @grabvintage/babel-plugin-transform-ssm
yarn add @grabvintage/babel-plugin-transform-ssm
bun add @grabvintage/babel-plugin-transform-ssm
```

## 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.0 |
| Published | 2021-01-04 |
| First published | 2020-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Egor Zaitsev |
| Maintainers | heuels |
| Keywords | ssm, aws, babel, babel-plugin, plugin, systems manager |

## Links

- npm: https://www.npmjs.com/package/@grabvintage/babel-plugin-transform-ssm
- Repository: https://github.com/grabvintage/babel-plugin-transform-ssm
- Homepage: https://github.com/grabvintage/babel-plugin-transform-ssm#readme
- Issues: https://github.com/grabvintage/babel-plugin-transform-ssm/issues
- npm.io page: https://npm.io/package/@grabvintage/babel-plugin-transform-ssm

## Dependencies (3)

- [aws4](https://npm.io/package/aws4.md) ^1.11.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.739.0
- [sync-request](https://npm.io/package/sync-request.md) ^6.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-04
- 1.0.0 — 2020-12-22

## README

# `@grabvintage/babel-plugin-transform-ssm`

This Babel plugin looks for imports in your code with `ssm:` prefix and replaces them with actual parameter values from AWS Systems Manager.

### Installation.

```shell
$ npm i @grabvintage/babel-plugin-transform-ssm
```

```shell
$ yarn add @grabvintage/babel-plugin-transform-ssm
```

### Configuration.

The only configurable parameter is `prefix` — a part of the parameter path that's appended to every requested parameter. For example, if you request a parameter `ssm:/test` with prefix `/app`, the plugin will be looking for `/app/test` parameter.

AWS credentials are configured via CLI. Please make sure that `AWS_PROFILE` (or `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`) and `AWS_REGION` environment variables are set.

#### Sample configuration.

`babel.config.js`

```js
module.exports = {
  plugins: [['@grabvintage/babel-plugin-transform-ssm', { prefix: `/grabvintage/${process.env.ENV || 'default'}` }]],
};
```

### Usage.

Currently only `import`s are supported. Open an issue if you need support for any other syntax.

`before`

```ts
import databaseName from 'ssm:/database/name';
```

`after`

```ts
const databaseName = 'grabvintage-default';
```

#### Usage with TypeScript.

TypeScript will be complaining about missing modules on every import that starts with `ssm:` prefix. To mitigate this, add a definition file somewhere in your project with the following content:

`ssm.d.ts`

```ts
declare module 'ssm:/database/name' {
  const parameter: string | undefined;
  export = parameter;
}
```

---
_Source: https://npm.io/package/@grabvintage/babel-plugin-transform-ssm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
