Skip to main content

Referencing

This is particularly useful when you have files with secrets. The command would replace the actual secrets with references to SLV secrets and add the SLV secrets to an SLV vault.

General Usage:

slv vault --vault <PATH_TO_VAULT> ref [flags]

Flags:

FlagArgumentsRequiredDefaultDescription
--fileStringTrueNAThe reference YAML/JSON/BLOB file (Needs to be flat)
--nameStringFalseNoneName of the item (key) to reference. References all keys if not provided
--forceNoneNANAOverwrite the item if it already exists
--previewNoneNANADry Run - Show what the referenced file would look like after referencing
--vaultStringTrueNAPath to the SLV Vault file
--helpNoneNANAHelp text for slv vault ref

Usage:

slv vault --vault <PATH_TO_VAULT> ref --file <PATH_TO_FILE_TO_BE_REFERENCED>

Example:

$ cat secrets.yaml 
username: johndoe
password: super_secret_password

$ slv vault --vault test.slv.yaml ref --file secrets.yaml
Auto referenced secrets.yaml (YAML) with vault test.slv.yaml

$ cat secrets.yaml
password: '{{SLV.test.password}}'
username: '{{SLV.test.username}}'