|
1 | 1 | [](https://github.com/netlify/netlify-plugin-secrets-manager/actions)
|
2 | 2 | [](https://www.npmjs.com/package/@netlify/plugin-secrets-manager)
|
3 | 3 |
|
4 |
| -# netlify-plugin-secrets-manager |
| 4 | +# Netlify Plugin Secrets Manager |
5 | 5 |
|
6 |
| -Update me! |
| 6 | +Inject secrets from AWS Secrets Manager into the Netlify build process. |
| 7 | + |
| 8 | +## Prerequisites |
| 9 | + |
| 10 | +- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` set as build environment variables with proper permissions, e.g. |
| 11 | + |
| 12 | +```json |
| 13 | +{ |
| 14 | + "Version": "2012-10-17", |
| 15 | + "Statement": [ |
| 16 | + { |
| 17 | + "Sid": "VisualEditor0", |
| 18 | + "Effect": "Allow", |
| 19 | + "Action": "secretsmanager:GetSecretValue", |
| 20 | + "Resource": "arn:aws:secretsmanager:<region>:<account-id>:secret:<secret-path>" |
| 21 | + }, |
| 22 | + { |
| 23 | + "Sid": "VisualEditor1", |
| 24 | + "Effect": "Allow", |
| 25 | + "Action": "secretsmanager:ListSecrets", |
| 26 | + "Resource": "*" |
| 27 | + } |
| 28 | + ] |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +> You can scope the `GetSecretValue` permission to a path, but the `ListSecrets` must be a wild card `*` |
| 33 | +
|
| 34 | +## Usage |
| 35 | + |
| 36 | +You can install this plugin in the Netlify UI from this |
| 37 | +[direct in-app installation link](https://app.netlify.com/plugins/@netlify/plugin-secrets-manager/install) or from the |
| 38 | +[Plugins directory](https://app.netlify.com/plugins). |
| 39 | + |
| 40 | +You can also install it manually: |
| 41 | + |
| 42 | +From your project's base directory, use npm, yarn, or any other Node.js package manager to add the plugin to |
| 43 | +`devDependencies` in `package.json`. |
| 44 | + |
| 45 | +```bash |
| 46 | +npm install -D @netlify/plugin-secrets-manager |
| 47 | +``` |
| 48 | + |
| 49 | +Then add the plugin to your `netlify.toml` configuration file: |
| 50 | + |
| 51 | +```toml |
| 52 | +[[plugins]] |
| 53 | +package = "@netlify/plugin-secrets-manager" |
| 54 | +``` |
| 55 | + |
| 56 | +## Additional configuration |
| 57 | + |
| 58 | +- By default the plugin injects the secrets with a `AWS_SECRET_` prefix. You can override the default prefix using the |
| 59 | + `AWS_SECRET_PREFIX` environment variable. |
| 60 | +- The plugin defaults to the `us-east-1` region. You can override the default region using the `AWS_DEFAULT_REGION` |
| 61 | + environment variable. |
7 | 62 |
|
8 | 63 | ## Contributors
|
9 | 64 |
|
|
0 commit comments