[ ] I've added tests (if it's a bug, feature or enhancement)
[ ] I've adjusted the documentation (if it's a feature or enhancement)
[x] The test suite passes (run bundle exec rspec to verify this)
Summary
Add additional tfvars lookup path at config/stacks/demo/tfvars.
❯ tree config/stacks
config/stacks
└── demo
└── tfvars
└── dev.tfvars
Layering is performed in this order:
config/terraform/tfvars/dev.tfvars
app/stacks/demo/tfvars/dev.tfvars
config/stacks/demo/tfvars/dev.tfvars <= NEW
So config/stacks/demo/tfvars/dev.tfvars will take the highest precedence and win.
This allows tfvars config to be decoupled from the stacks. The idea is that stacks can optionally ship with default tfvars files. And users can completely override them without touching the stack code.
This PR also changes terraspace seed so it'll generate the tfvars starter file in config/stacks/demo/tfvars
This is a 🙋♂️ feature or enhancement.
bundle exec rspec
to verify this)Summary
Add additional tfvars lookup path at
config/stacks/demo/tfvars
.Layering is performed in this order:
So
config/stacks/demo/tfvars/dev.tfvars
will take the highest precedence and win.This allows tfvars config to be decoupled from the stacks. The idea is that stacks can optionally ship with default tfvars files. And users can completely override them without touching the stack code.
This PR also changes
terraspace seed
so it'll generate the tfvars starter file inconfig/stacks/demo/tfvars
Additionally, found this it easier to see what stacks have been deployed by simply running
tree config/stacks
How to Test
Just do a sanity check and make sure terraspace works.
Move Script
Here's a useful move-tfvars.rb script that you can use to quickly move your tfvars files from
app/stacks
toconfig/stacks
.Also relevant docs: https://terraspace.cloud/docs/layering/tfvars-location-thoughts/
Version Changes
Patch