ti fs-vault run-with-secret
Runs a command with one secret injected into its environment. Arguments after -- are passed to the child command.
Each secret field name becomes an environment variable with the same name in the child process. Field names must match [A-Z_][A-Z0-9_]*, so create fields that you intend to inject with uppercase names. The command rejects the entire injection if any field name, including a name that contains lowercase letters, does not match this pattern or if a value contains an unsupported control character.
Syntax
ti fs-vault run-with-secret
--secret-path <string>
[--file-system-id <string>]
[--fs-token <string>]
[--help]
[--vault-token <string>]
[--version]
-- <command> [args...]
Options
--secret-path <string>: Canonical Vault path in the form/n/vault/<secret-name>. For example, the secret created asdb-prodhas the path/n/vault/db-prod. [required]--file-system-id <string>: Select the file system. You can also setTI_FS_FILE_SYSTEM_ID.--fs-token <string>: Set the owner Filesystem token. If omitted, the command uses theTI_FS_TOKENenvironment variable. If neither is provided, the command uses the local token stored for the selected Filesystem. For delegated authentication, use--vault-tokenorTI_VAULT_TOKENinstead.--help: Display help information.--vault-token <string>: Delegatedti fs-vaulttoken; preferTI_VAULT_TOKEN.--version: Display version information.
For options shared by all commands, see Global options.
Examples
Run a process with secret fields:
# Verify that the child process receives DB_URL without printing its value. ti fs-vault run-with-secret --file-system-id <file-system-id> --secret-path /n/vault/db-prod -- sh -c 'test -n "$DB_URL" && printf "DB_URL is set\n"'Run an application with injected fields:
# Make all fields available only to the child process and its descendants. ti fs-vault run-with-secret --file-system-id <file-system-id> --secret-path /n/vault/db-prod -- ./deploy.sh