Default value for variable problem description as of May 04 2022
There was an update to the Terraform Cloud and it now automatically detects Terraform variables without default values in configuration for workspaces that use the VCS workflow.
Because of the above, for each variable in Terraform configuration which does not have a default
value defined, a variable will be created in the respective workspace with an empty value of type HCL
.
Solution/workaround
If one don't want Terraform Cloud to populate the variables you would need to set a default
value for them that could be null
.
Other possible problem manifestations
In case that there is a large mono-repo attached to several workspaces - with configured working directory
new feature seems to not respect the settings and adds the variables present in the root module only.
Additional Information
- For both problems above there is already internal bug reported created and already engineering team creates a fix.
- For more information on variable manipulation in Terraform Cloud, please refer to the https://www.terraform.io/cloud-docs/workspaces/variables/managing-variables#edit-a-variable