Workspace Variables¶
There are two ways through which we can apply variable to a workspace. One way is to create a Variable Set which can be applied to a workspace and the other one is to create variables inside the workspace only.
Create variable inside the workspace¶
- Once the workspace is created we need to configure the variables for it.
- Click on Go to workspace overview.
- Go inside the workspace and click on Configure Variables.
- Click on Add Variable.
- Write the
key
and thevalue
in the respective fields. All the variables are consideredstring
by default. - There are two options which we need to keep in mind.
- If we select
HCL
check box then thevalue
will not be considerd as a string. It is generally used for integers or JSON objects. The type of the variable will be defined in the terraform file. - If we select
Sensitive
thenvalue
becomes write-only.
- If we select
- We can create environment variables also by selecting
Environment Variable
radio button in theSelect variable category
.