Add a managing secrets guide - #27
Conversation
Co-Authored-By: brandon <brandon@flightcontrol.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Co-Authored-By: brandon <brandon@flightcontrol.dev>
| - **Cost.** Secrets Manager bills per secret, per month. Forty secrets cost forty times as much as one secret with forty keys. | ||
| - **One place to edit.** Adding a variable is a JSON key edit, not a new AWS resource, a new ARN, and a new config entry pointing at it. | ||
| - **One ARN to remember.** Every reference in `ravion.yaml` shares the same ARN prefix and differs only by the key name, so the config stays readable and diffs stay obvious. | ||
| - **Shared across services.** `DATABASE_URL` is one key that your web service, worker, and pre-deploy migration task all reference — not three copies to keep in sync. |
There was a problem hiding this comment.
This line doesn't make sense in this section in docs.
There was a problem hiding this comment.
Agreed — sharing a value across services works with per-value secrets too, so it isn't an argument for the one-secret pattern. Removed the bullet.
| - **Shared across services.** `DATABASE_URL` is one key that your web service, worker, and pre-deploy migration task all reference — not three copies to keep in sync. | ||
| - **One audit trail.** Secrets Manager versions the whole JSON document, so every change to any variable is a single version you can inspect or roll back. | ||
|
|
||
| Keep secrets that AWS or a module manages for you — RDS master passwords, ElastiCache connection strings — in their own secrets. See [Module-managed secrets](#module-managed-secrets). |
There was a problem hiding this comment.
Added: AWS rotates those secrets in place without touching your environment secret, which is another reason to leave them where they are.
| <Tip> | ||
| If each environment lives in its own AWS account, the secret name can be identical in every |
There was a problem hiding this comment.
This is anti the recommendation to call the secret with /env/app.
There was a problem hiding this comment.
Good catch — it undercut the <env>/<app> naming right above it. Flipped it to say keep the environment in the name even when each environment has its own account, so the ARN identifies its environment on sight in config diffs, task definitions, and IAM policies.
Co-Authored-By: brandon <brandon@flightcontrol.dev>
Co-Authored-By: brandon <brandon@flightcontrol.dev>
Summary
New guide at
guides/managing-secretsdocumenting the pattern we use in the Ravion monorepo's ownravion.yaml: one Secrets Manager secret per environment holding a JSON object of many keys, with each module referencing individual keys via the ARN's JSON-key suffix.Opens with a
<Note>that native secret management in Ravion is coming soon, matching how the custom-domains guide frames its own gap.Beyond the recommendation, it covers the things that actually bite people, verified against the module definitions and terraform rather than inferred:
::is required when a JSON key is present; dropping the key entirely injects the whole secret string.put-secret-valuereplaces the whole document, so adding a key means a merge.execution_role_arnbypasses the generated policy entirely.build_environment_variableswithfromSecretManager/fromParameterStore, plus thedockerfile_inject_env_variablesbuild-arg caveat.The guide deliberately does not enumerate per-module secret behavior or the secrets each module creates — that would go stale against the catalog. It points at the module catalog pages and stack outputs instead.
Also registers the page in
docs.json, links it from the "Managing environment variables through Ravion" gap in the Flightcontrol migration guide, and adds four technical terms to the Vale vocabulary.Link to Devin session: https://app.devin.ai/sessions/851b7a82769844afad6491e5e44d9efa
Requested by: @flybayer