Skip to main content

Defining Variable Sets as Text Files

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

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.