boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

Why build all stacks when not running `terraspace all...`? #223

Closed ghost closed 2 years ago

ghost commented 2 years ago

Currently, TS builds all dependency stacks when running normal single-stack commands, e.g. terraspace build some_stack, terraspace plan some_stack etc. If you have a complex environment, this leads to pretty long run times when deploying a single stack - much longer than running pure Terraform - and I'm not really clear on the reason for it given that the dependency stacks don't ultimately seem to be used at all (templated output() values are resolved from the dependency's statefile which is entirely independent).

Was wondering if there was a reason for this. Otherwise, would it make sense to change the default include_stacks behaviour for Builder to :root_only?

tongueroo commented 2 years ago

See https://github.com/boltops-tools/terraspace/pull/199 and https://github.com/boltops-tools/terraspace/pull/215

In short, on a fresh clean machine, there would be issues. Unsure if there’s another approach. Will consider PRs for improvements. No sweat either way of course.

Also, please use the Terraspace forums for questions. 🎊Thanks!