Skip to content

stratumctl secrets

Customer Secrets Manager

Terminal window
stratumctl secrets [flags]

Create a secret (metadata; put a value next with put-value)

Terminal window
stratumctl secrets create <name> [flags]
Terminal window
stratumctl secrets create prod/db/password --description "Postgres primary" --recovery-window-days 7 --tag env=prod
Flag Type Default Description
--description string Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--recovery-window-days int 0 Default recovery window for a later delete (7-30; server default 30)
--region string Region (defaults to the install’s)
--tag stringArray Tag key=value (repeatable)

Schedule a secret for deletion (soft; restore inside the window)

Terminal window
stratumctl secrets delete <secret-id> [flags]
Terminal window
stratumctl secrets delete s-4k8m2x7q9a --recovery-window-days 7
stratumctl secrets delete s-4k8m2x7q9a --force
Flag Type Default Description
--force bool false Purge now, skipping the recovery window (needs secrets:ForceDeleteSecret)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--recovery-window-days int 0 Recovery window for this delete (7-30; default: the secret’s own)

Delete an unlabeled version (ciphertext first, then the row)

Terminal window
stratumctl secrets delete-version <secret-id> <version-id> [flags]
Terminal window
stratumctl secrets delete-version s-4k8m2x7q9a sv-8k2m4x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a secret (never its value; see get-value)

Terminal window
stratumctl secrets get <secret-id> [flags]
Terminal window
stratumctl secrets get s-4k8m2x7q9a
stratumctl secrets get s-4k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Print a secret’s value (only the value, so it composes)

Terminal window
stratumctl secrets get-value <secret-id> [flags]

Prints the plaintext value and nothing else on stdout (a trailing newline is added only when stdout is a terminal). With –output json the full GetSecretValue response is printed. Every call is audited server-side.

Terminal window
stratumctl secrets get-value s-4k8m2x7q9a
stratumctl secrets get-value s-4k8m2x7q9a --stage PREVIOUS
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--stage string Stage label (default CURRENT)
--version-id string Specific version id

List a project’s secrets (metadata only)

Terminal window
stratumctl secrets list [flags]
Terminal window
stratumctl secrets list
stratumctl secrets list --limit 50 --output json
Flag Type Default Description
--limit int 0 Page size (server default 100, max 500); setting it (or –page-token) returns one page and prints the next token instead of listing everything
--page-token string Cursor from a previous page; returns that one page
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Store a new version of a secret’s value (from –file or stdin, never an argument)

Terminal window
stratumctl secrets put-value <secret-id> [flags]

Reads the value from –file, or from stdin when –file is “-” or omitted, so the value never appears in shell history or a process listing. The new version becomes CURRENT (or PENDING with –stage PENDING).

Terminal window
printf '%s' "$PASS" | stratumctl secrets put-value s-4k8m2x7q9a
stratumctl secrets put-value s-4k8m2x7q9a --file./credentials.json --kind key_value_json
Flag Type Default Description
--file string File holding the value (“-” or omitted = stdin)
--kind string Value kind: string (default) or key_value_json
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--stage string Stage for the new version: CURRENT (default) or PENDING

Cancel a pending deletion inside the recovery window

Terminal window
stratumctl secrets restore <secret-id> [flags]
Terminal window
stratumctl secrets restore s-4k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Rotate now (the reconciler runs it on its next pass; check with rotation get)

Terminal window
stratumctl secrets rotate <secret-id> [flags]
Terminal window
stratumctl secrets rotate s-4k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Manage a secret’s rotation schedule (built-in rotators,)

Terminal window
stratumctl secrets rotation [flags]

Remove the rotation schedule (an in-flight rotation completes)

Terminal window
stratumctl secrets rotation clear <secret-id> [flags]
Terminal window
stratumctl secrets rotation clear s-4k8m2x7q9a
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Show a secret’s rotation schedule and last result

Terminal window
stratumctl secrets rotation get <secret-id> [flags]
Terminal window
stratumctl secrets rotation get s-4k8m2x7q9a
stratumctl secrets rotation get s-4k8m2x7q9a --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Create or replace the rotation schedule

Terminal window
stratumctl secrets rotation set <secret-id> [flags]

–type names a built-in rotator (iam_access_key, s3_access_key); –target is the credential owner it acts on (a service account id or ARN for iam_access_key) and must belong to the secret’s project; –cron is a 5-field cron.

Terminal window
stratumctl secrets rotation set s-4k8m2x7q9a --type iam_access_key --target sa-7k2m9x4q8a --cron "0 3 1 * *" --window-hours 24
stratumctl secrets rotation set s-4k8m2x7q9a --type db_master --target db-3k8m2x7q9a --cron "0 3 * * 0"
Flag Type Default Description
--cron string 5-field cron, e.g. “0 3 1 * *”
--disabled bool false Create the schedule disabled
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--target string Credential owner (service account id/ARN for iam_access_key; the db instance id for db_master)
--type string Rotator: iam_access_key | s3_access_key | db_master
--window-hours int 0 Hours the previous credential stays valid after a promote (1-168; default 6)

Move or remove a stage label (UpdateSecretVersionStage)

Terminal window
stratumctl secrets stage <secret-id> [flags]

–move-to <version> moves –label onto that version; with –remove-from the move is guarded (that version must hold the label). –remove-from alone removes a custom label. Moving CURRENT gives the displaced version PREVIOUS — the rotation promote step.

Terminal window
stratumctl secrets stage s-4k8m2x7q9a --label CURRENT --move-to sv-8k2m4x7q9a --remove-from sv-5k8m2x7q9a
Flag Type Default Description
--label string Stage label (CURRENT, PENDING, PREVIOUS or custom)
--move-to string Version id to move the label onto
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--remove-from string Version id the label must currently be on (guard), or to remove a custom label from

Update a secret’s description, recovery window or tags

Terminal window
stratumctl secrets update <secret-id> [flags]
Terminal window
stratumctl secrets update s-4k8m2x7q9a --description "Postgres primary (prod)"
stratumctl secrets update s-4k8m2x7q9a --tag env=prod --tag team=a
Flag Type Default Description
--clear-tags bool false Remove every tag
--description string New description (pass an empty string to clear)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--recovery-window-days int 0 New default recovery window (7-30)
--tag stringArray Replace the tag set with these key=value pairs (repeatable)

List a secret’s versions, newest first (metadata only)

Terminal window
stratumctl secrets versions <secret-id> [flags]
Terminal window
stratumctl secrets versions s-4k8m2x7q9a
stratumctl secrets versions s-4k8m2x7q9a --output json
Flag Type Default Description
--limit int 0 Page size; setting it (or –page-token) returns one page and prints the next token instead of listing everything
--page-token string Cursor from a previous page; returns that one page
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)