Overview
Introduction
Moving a secret out of a .env file and into a real secrets backend, AWS Secrets Manager, Kubernetes External Secrets, or Vault, means learning that backend's specific CLI syntax or YAML shape, which varies significantly between the three.
This tool generates the correct output for whichever backend you're targeting from the same simple input: a secret name and a list of key/value pairs.
What Is Secrets Manager Config Generator?
A generator that takes one secret name and a repeatable list of key/value pairs, then produces backend-specific output: AWS Secrets Manager CLI commands, a Kubernetes External Secrets Operator YAML pair, or HashiCorp Vault CLI commands, depending on which backend you select.
Each backend's output is meant to be copy-pasted and run (with your real secret values substituted in) against your actual AWS account, Kubernetes cluster, or Vault instance.
How Secrets Manager Config Generator Works
For AWS, the key/value pairs are combined into a single JSON object and embedded as the `--secret-string` argument to both `create-secret` and `put-secret-value` commands.
For Kubernetes, a `SecretStore` (pointing at AWS Secrets Manager via JWT/IRSA auth) and an `ExternalSecret` (mapping each key to a `remoteRef` on the named secret) are built as JS objects and serialized with the `yaml` package into two YAML documents joined by `---`.
For Vault, each pair becomes a `KEY="value"` argument appended to `vault kv put secret/<name>`, plus a matching `vault kv get` command to read it back.
When To Use Secrets Manager Config Generator
Use it when migrating a secret out of a .env file or hardcoded config into a proper secrets backend, and you need the exact command or YAML syntax for that backend.
It's also useful for quickly drafting the Kubernetes ExternalSecret manifest for a new AWS Secrets Manager secret your application needs synced into the cluster.
Often used alongside Environment Variable Encryptor and .env File Generator.
Features
Advantages
- Covers three of the most commonly used secrets backends from one consistent input shape.
- Produces both the create and read-back commands for AWS and Vault, not just the write side.
- Generates syntactically valid YAML for the Kubernetes External Secrets Operator's two required resource types.
Limitations
- The Kubernetes output assumes the External Secrets Operator and an AWS-backed SecretStore; other operators or backends (GCP Secret Manager, Azure Key Vault) need manual adaptation.
- The Vault output assumes the default KV v2 mount path (`secret/`); custom mount paths need manual adjustment.
Examples
Best Practices & Notes
Best Practices
- Never paste real production secret values into a browser tool and leave the tab open longer than necessary; treat generated commands as templates to fill in locally.
- Scope IAM/Vault policies narrowly around the specific secret path rather than granting broad read/write access to all secrets.
- Use hierarchical secret names (e.g. `my-app/prod/db`, `my-app/staging/db`) to keep environments cleanly separated in the backend.
Developer Notes
The AWS and Vault outputs are built with plain string templating, while the Kubernetes output constructs two plain JS objects (SecretStore and ExternalSecret) and serializes them with the `yaml` package's `stringify`, joined by a `---` document separator, so the resulting file is a valid multi-document YAML manifest ready for `kubectl apply -f`. Kubernetes resource names are sanitized from the secret name (lowercased, non-alphanumeric runs collapsed to a single hyphen, leading/trailing hyphens trimmed) since Kubernetes object names have stricter character rules than AWS secret names or Vault paths.
Secrets Manager Config Generator Use Cases
- Migrating a database credential or API key from a .env file into AWS Secrets Manager
- Generating the ExternalSecret manifest to sync an existing AWS-managed secret into a Kubernetes namespace
- Producing the Vault CLI commands to write and verify a new secret during a migration to Vault-backed configuration
Common Mistakes
- Assuming the External Secrets Operator is already installed and configured in the cluster; the generated YAML assumes both the operator and appropriate IAM/IRSA setup already exist.
- Using the default Vault KV mount path in the generated command when the actual Vault instance uses a custom mount, causing a 404 on `vault kv put`.
Tips
- Use the Environment Variable Encryptor first if you want an extra layer of encryption on the value itself before it goes into whichever secrets backend you choose here.