Skip to main content

Defining Variable Sets as Text Files

This page showcases how to create and edit variable sets with the CLI.

info

For details on creating and editing variable sets in the Web UI, please visit Web UI Creating Variable Sets.

Just like Data Stores, you can also manage your variable sets using the CLI and definition files.

A definition file looks like the following:

type: VariableSet
spec:
name: Production
description: Production env variables
values:
- key: URL
value: https://app-production.company.com
- key: API_KEY
value: mysecret

In order to apply this configuration to your Tracetest instance, make sure to have your CLI configured and run:

tracetest apply variableset -f <variableset.yaml>

If the file contains the property spec.id, the operation will be considered a variable set update. If you try to apply a variable set and you get the error: could not apply variableset: 404 Not Found, it means the provided ID doesn't exist. Either update the ID to reference an existing variable set or remove the property from the file. Tracetest will create a new variable set and a new ID.

Using Secrets in Variable Sets​

A VariableSet with a secret values can be registered via the CLI like this:

type: VariableSet
spec:
id: test-1
name: Test 1
description: test
values:
- key: SOME_SECRET
value: my-precious
type: secret
- key: NO_SO_SECRET
value: aha!
type: raw