Hi, we’ve been using Terraspace since 0.6.x, and its been great. However, in our efforts to upgrade to 1.x, we have discovered that our use of custom cache directory is not compatible with terraspace 1.0.x and remote backends (TF Cloud). We use AWS and the “terraspace_plugin_aws” 0.3.6.
Our app.rb has the customization:
class CustomBuildDir
def call(mod)
":CACHE_ROOT/:NAMESPACE/:REGION/:ENV/:BUILD_DIR" # String is returned
end
end
Terraspace.configure do |config|
config.logger.level = :info
config.test_framework = "rspec"
config.build.cache_dir = CustomBuildDir
...
When the build is executed by terraspace (i.e. terraspace build etc.) the directory name within .terraspace-cache is not “expanded”, i.e. it has the namespace expander var, :NAMESPACE/dev/stacks/lambda. And the AWS Account expansion ERB calls also don’t work. We’ve localized this behavior to the config/terraform/backend.tf file… We use remote backends to operate with Terraform Cloud. IF we change the “remote” keyword back to “s3”, everything works great. So is “remote” backends with expansion no longer supportable?
terraform {
backend "remote" {
organization = "<%= ENV['TFC_ORG'] %>"
workspaces {
name = "<%= expansion('my-engine-:MOD_NAME-:ENV-:REGION-:ACCOUNT') %>"
}
}
}