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:

SubcommandDescription
lsLists all secrets in the project.
rm NAMEDeletes a secret.
set NAME VALUECreates or updates a secret.

tb secret ls

Lists secrets.

OptionDescription
--match TEXTRetrieves any resource matching the pattern.
Updated