feat(secrets): S3 — AWS Secrets Manager + SSM provider via the aws CLI (spec 04) - #64
Merged
Conversation
…I (spec 04) Adds the `aws-sm` and `aws-ssm` provider kinds. It shells out to the `aws` CLI (NOT aws-sdk-go) — the same anti-bloat reasoning that keeps SOPS on its binary (DECISIONS): the SDK would pull a large cloud tree into the CGO_ENABLED=0 static binary. Shelling also inherits the user's AWS config / SSO / IAM-role creds the way git inherits SSH, so no AWS credential passes through devstack. - `aws-sm`: `get-secret-value` per distinct secret id (batched across refs that share an id); a keyless ref takes the raw SecretString, a `#dot.key` ref parses it as JSON and walks the path. - `aws-ssm`: ONE batched `get-parameters --with-decryption` for all referenced names; `--names` kept last (variadic) so `--region` isn't swallowed; any InvalidParameters → a clear error; optional `#key` walks a JSON-valued param. - `--region` from cfg.Region/Opts["region"]; empty lets the CLI resolve it. - Registered in RegisterBuiltins alongside sops; config passes the kind through (no allowlist), so it's declarable in workspace.yaml exactly like sops. Stdlib-only (no new deps). Unit-tested with a fake `aws` runner: SM keyless + JSON-key, per-secret batching (one call), SSM batched + region passthrough, invalid-parameter error, missing-CLI error, builtin registration. Account-gated (decision #3): logic + fakes here; real creds/localstack are a flagged human/integration step, not run in the nightly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the
aws-sm(Secrets Manager) andaws-ssm(SSM Parameter Store) provider kinds.Why the CLI, not aws-sdk-go
Same anti-bloat reasoning that keeps SOPS on its binary (DECISIONS): the AWS SDK would pull a large cloud tree into the
CGO_ENABLED=0static binary. Shelling toawsalso inherits the user's AWS config / SSO / IAM-role credentials the way git inherits SSH — no AWS credential ever passes through devstack. Reuses the existingCmdRunnerseam (likeSopsProvider).Behaviour
aws-sm:get-secret-valueper distinct secret id (batched across refs that share an id). Keyless ref → rawSecretString;#dot.keyref → parse JSON, walk the path.aws-ssm: ONE batchedget-parameters --with-decryptionfor all referenced names.--nameskept last (variadic) so--regionisn't swallowed;InvalidParameters→ clear error; optional#keywalks a JSON-valued parameter.--regionfromcfg.Region/Opts["region"]; empty lets the CLI resolve it.RegisterBuiltinsalongside sops; config passes the kind through (no allowlist) → declarable inworkspace.yamllike sops.Tests
Stdlib-only (no new deps). Fake
awsrunner: SM keyless + JSON-key; per-secret batching (one call); SSM batched + region passthrough; invalid-parameter error; missing-CLI error; builtin registration.make cigreen.Scope
Account-gated (locked decision #3): logic + fakes here; real creds / localstack are a flagged human/integration step, not run in the nightly.
Spec acceptance (spec 04)
secret://refs (batched), values injected only via the up saga's process env (S6), never on disk.🤖 Generated with Claude Code