@distinction-dev/serverless-dynamic-secrets v1.1.0
Serverless Dynamic Secrets Plugin
š Automate Parameter & Secret Management in Serverless Framework
š Why We Introduced This Plugin
Managing secrets and parameters in AWS while working with the Serverless Framework can be tedious and error-prone. Developers often need to:
- Manually define parameters and secrets in
serverless.yml. - Ensure sensitive information isn't exposed.
- Handle dynamic secrets without hardcoding values.
- Simplify overrides and updates without modifying multiple files.
To solve these problems, we built Serverless Dynamic Secrets Plugin, which automates secret and parameter creation, ensuring secure, efficient, and scalable deployments.
š Overview
Serverless Dynamic Secrets Plugin is a custom Serverless Framework plugin that:
- Automatically creates CloudFormation parameters from a JSON file.
- Generates AWS Secrets Manager resources dynamically using parameter values.
- Supports parameter overrides via CLI and files.
- Prevents secret exposure by setting
NoEcho: true. - Supports encryption using AWS KMS (future roadmap feature).
- Allows secret fetching from AWS S3 (future roadmap feature).
This eliminates the manual effort of defining parameters and secrets in your serverless.yml and ensures better security practices.
š Installation
Using npm
npm install --save-dev @distinction-dev/serverless-dynamic-secretsUsing yarn
yarn add -D @distinction-dev/serverless-dynamic-secretsš How to Use
1ļøā£ Define Your Secrets and Parameters
Create a params.json file with the structure:
{
"DB_PASSWORD": "supersecurepassword",
"API_KEY": "your-api-key"
}2ļøā£ Add the Plugin to serverless.yml
plugins:
- '@distinction-dev/serverless-dynamic-secrets'3ļøā£ Deploy with Secrets Management
npx serverless deploy --parameter-file params.jsonš Features (Roadmap)
ā Automatic CloudFormation Parameter & Secrets Manager Resource Creation (Completed) š Custom Config for File Name (Planned) š Secret Metadata Support (Planned) š Override Existing Secrets (Planned) š Conflict Handling with Prefixes (Planned) š KMS Encryption Support (Planned) š S3-Based Secret Management (Planned) š Cross-Account Secret Access (Planned) š SSM Parameter Store Support (Planned) š Generalization for Masked/Unmasked Values (Planned)
šÆ Why Use This Plugin?
ā Saves Time ā No more manually defining parameters and secrets.
ā Secure by Default ā Prevents secret exposure using NoEcho: true.
ā Flexible & Scalable ā Works with any Serverless project.
ā Easy to Use ā Just add a JSON file and deploy!
š¬ Need Help?
Have questions or suggestions? Join our dev community or open an issue on GitHub! Let's make serverless development smarter together. šŖš„