serverless-offline-secrets-manager-simulator
This plugin exposes a secrets manager compatible API on a configurable port whenever
Serverless Offline is started. Secrets are stored in-memory and
will be lost when the server is stopped
Supported API Calls
Installation
npm install serverless-offline-secrets-manager-simulator
In your serverless.yml:
plugins:
- serverless-offline-secrets-manager-simulator
Configuration
custom:
secrets-manager-simulator:
port: 8007
enableDebugEndpoint: true
secretsFile: /tmp/secrets.json
secrets:
- key: Secret1
value: I-Am-A-Secret
- key: Secret2
value: I-Am-Another-Secret
Usage
Simply send appropriately formatted POST requests to http://127.0.0.1:[PORT]
where PORT is specified in the configuration
(or use the default 8007)
When using the AWS sdk, create your client with a custom endpoint specified:
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager"
const client = new SecretsManagerClient({ endpoint: "http://127.0.0.1:8007" })
The plugin provides a debug endpoint at /list
which will list all secrets currently contained within the store