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/cloud/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.

config/app.rb

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

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
cloud.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
cloud.working_dir_prefix Add additional prefix to add the relative root that is set on TFC nil
cloud.hostname Hostname used for TFE Terraform token used for authenticated API calls. See: Terraform Login nil
cloud.vars.overwrite Whether or not to overwrite non-sensitive variables. true
cloud.vars.overwrite_sensitive Whether or not to overwrite sensitive variables. true
cloud.vars.show_message Normally, only “Creating” variable messages are shown. Can be set to: all, update, create, none create
cloud.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 {}