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.

config/app.rb

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

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

Reference

The table below covers each setting. Each option is configured in config/app.rb with config.OPTION. The config. portion is not shown for conciseness. IE: logger.level vs config.logger.level.

Name Description Default
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 {}

See Full Config Reference

More tools: