improve autodetection for plugin expander for backend like remote #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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