Terraform Cloud Config

When using Terraform Cloud, Terraspace performs additional convenience logic to make it easier to use Terraform Cloud Workspaces. Some of the processing behavior can be configured.

Terraform Cloud Variables Behavior

Whenever a terraspace up is ran, terraspace reads the config/terraform/tfc/vars.json file and uses it to create Terraform Cloud Variables.

Terraspace will overwrite TFC variables by default. The behavior is configurable. Non-sensitive and sensitive variables can be finely controlled with different overwrite behavior.


Terraspace.configure do |config|
  config.cloud.overwrite = true # non-sensitive variables
  config.cloud.overwrite_sensitive = true

Here’s a table with the cloud related config settings:

Name Description Default
build.clean_cache Disable cleaning the .terraspace-cache entirely. Terrspace generally tries to only remove the cache files in a way to allow the TFC VCS-Driven workflow to work. But it may not work for your needs, depending on Terraspace is configured. This setting keeps the cache. You can manually delete items from the .terraspace-cache manually. true
tfc.auto_sync Enables auto-syncing of config/cloud settings to TFC/TFE. Useful to disable if you do not have permission to manage workspaces. true
tfc.working_dir_prefix Add additional prefix to add the relative root that is set on TFC nil
tfc.hostname Hostname used for TFE Terraform token used for authenticated API calls. See: Terraform Login nil
tfc.vars.overwrite Whether or not to overwrite non-sensitive variables. true
tfc.vars.overwrite_sensitive Whether or not to overwrite sensitive variables. true
tfc.vars.show_message Normally, only “Creating” variable messages are shown. Can be set to: all, update, create, none create
tfc.workspace.attrs Custom workspace attributes to set as part of the sync to TFC. Can be useful for vcs-repo. See TFC API Workspace Docs {}

More tools: