Variables

Terrakube workspace variables let you customize configurations and store information like static provider credentials. You can also reference this variables inside your Templates.

You can set variables specifically for each workspace or you can create Global Variables to reuse the same variables across multiple workspaces.

Workspace-Specific Variables

To view and manage a workspace's variables, go to the workspace and click the Variables tab.

The Variables page appears, showing all workspace-specific variables. This is where you can add, edit, and delete workspace-specific variables.

There are 2 kinds of Variables:

Terraform Variables

These Terraform variables are set using a terraform.tfvars file. To use interpolation or set a non-string value for a variable, click its HCL checkbox.

Add a Terraform Variable

Go to the workspace Variables page and in the Terraform Variables section click the Add variable button.

In the popup, provide the required values. Use the below table as reference:

Finally click the Save variable button and the variable will be created.

Edit a Terraform Variable

Click the Edit button next to the variable you want to edit.

Make any desired changes and click Save variable.

Delete a Terraform Variable

Click the Delete button next to the variable you want to delete.

Click Yes to confirm your action.

Environment Variables

These variables are set in Terraform's shell environment using export.

Add an Environment Variable

Go to the workspace Variables page and in the Environment Variables section click the Add variable button.

In the popup, provide the required values. Use the below table as reference:

Finally click the Save variable button and the variable will be created.

Edit an Environment Variable

Click the Edit button next to the variable you want to edit.

Make any desired changes and click Save variable.

Delete an Environment Variable

Click the Delete button next to the variable you want to delete.

Click Yes to confirm your action.

Last updated