Skip to content

feat(secrets): S3 — AWS Secrets Manager + SSM provider via the aws CLI (spec 04) - #64

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/S3-aws
Jun 29, 2026
Merged

feat(secrets): S3 — AWS Secrets Manager + SSM provider via the aws CLI (spec 04)#64
gustavobertoi merged 1 commit into
mainfrom
nightly/S3-aws

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

What

Adds the aws-sm (Secrets Manager) and aws-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=0 static binary. Shelling to aws also inherits the user's AWS config / SSO / IAM-role credentials the way git inherits SSH — no AWS credential ever passes through devstack. Reuses the existing CmdRunner seam (like SopsProvider).

Behaviour

  • aws-sm: get-secret-value per distinct secret id (batched across refs that share an id). Keyless ref → raw SecretString; #dot.key ref → parse JSON, walk the path.
  • aws-ssm: ONE batched get-parameters --with-decryption for all referenced names. --names kept last (variadic) so --region isn't swallowed; InvalidParameters → clear error; optional #key walks a JSON-valued parameter.
  • --region from cfg.Region/Opts["region"]; empty lets the CLI resolve it.
  • Registered in RegisterBuiltins alongside sops; config passes the kind through (no allowlist) → declarable in workspace.yaml like sops.

Tests

Stdlib-only (no new deps). Fake aws runner: SM keyless + JSON-key; per-secret batching (one call); SSM batched + region passthrough; invalid-parameter error; missing-CLI error; builtin registration. make ci green.

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)

  • AWS SM + SSM resolve secret:// refs (batched), values injected only via the up saga's process env (S6), never on disk.

🤖 Generated with Claude Code

…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>
@gustavobertoi
gustavobertoi merged commit 7b9b8f6 into main Jun 29, 2026
3 of 4 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/S3-aws branch June 29, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant