When on-prem support was added, it changed the auto-detection to be only based what was parsed from config/terraform/backend.tf. So a remote backend would result in on-prem being detected, and the expansion variables would not be expanded correctly. Even though users would have terraspace_plugin_aws in their Gemfile and want to use the aws plugin expander, it would use the on-prem generic expander.
Before on-prem support, it was assumed that if the aws terraspace plugin was installed it would just use the aws plugin expander. That's why it previously worked.
But with on-prem support, the backend can be http, remote, etc and the terraspace plugin and its expander cannot be detected based on that.
Instead, this fix improves auto-detection so that Terraspace auto-detects based on:
config.autodetect.expander - config setting that allows override of the auto-detection entirely.
backend.tf parsing - will try to find the s3, azurerm, gcs backend and use the right terraspace plugin based on that.
Gemfile: check what plugins are loaded in the Gemfile and auto-detect based on that.
3 will solve the issue for users who were on 0.6 and had everything working. So there is no need to configure #1. It should just work.
1 is provided as another configuration option if you need to override default auto-detection behavior.
This is a 🐞 bug fix. This is a 🙋♂️ feature or enhancement.
bundle exec rspec
to verify this)Summary
Fixes expander auto-detection bug with remote backend and a terraspace cloud plugin like aws. IE:
config/teraform/backend.tf
When on-prem support was added, it changed the auto-detection to be only based what was parsed from
config/terraform/backend.tf
. So aremote
backend would result in on-prem being detected, and the expansion variables would not be expanded correctly. Even though users would haveterraspace_plugin_aws
in their Gemfile and want to use the aws plugin expander, it would use the on-prem generic expander.Before on-prem support, it was assumed that if the aws terraspace plugin was installed it would just use the aws plugin expander. That's why it previously worked.
But with on-prem support, the backend can be
http
,remote
, etc and the terraspace plugin and its expander cannot be detected based on that.Instead, this fix improves auto-detection so that Terraspace auto-detects based on:
3 will solve the issue for users who were on 0.6 and had everything working. So there is no need to configure #1. It should just work.
1 is provided as another configuration option if you need to override default auto-detection behavior.
Context
How to Test
Try a remote backend like so:
config/teraform/backend.tf
Confirm your Gemfile has:
Gemfile:
Run
It should expand out the variables using the aws terrspace plugin expander. Example of something it'll look like:
Version Changes
Patch