tb secret¶
Manage secrets in datafiles, like connection credentials. Secrets consists of a name and a value.
You can add a secret to your workspace like this:
tb --cloud secret set KAFKA_USERNAME 12345
You can then use the secret in a datafile like this:
TYPE kafka KAFKA_KEY {{ tb_secret("KAFKA_USERNAME", "") }}
In the datafile syntax, first argument is the name of the secret, and the second is the default value that's used when the secret is not set.
Secrets are only replaced in your resources when you deploy. If you change a secret, you need to deploy for the changes to take effect.
Subcommands¶
The following subcommands are available:
Subcommand | Description |
---|---|
ls | Lists all secrets in the project. |
rm NAME | Deletes a secret. |
set NAME VALUE | Creates or updates a secret. |
tb secret ls¶
Lists secrets.
Option | Description |
---|---|
--match TEXT | Retrieves any resource matching the pattern. |