It would be very useful if there was a stack setting, or a way through policies or some other mechanism, to run a stack automatically upon its environment variables changing.
This is because, obviously, stack environment variables may be used as input variables for the infrastructure as code itself, so changing the environment variables most often actually warrants a rerun of the stack. Currently it does not seem to be directly possible.
Consider this scenario:
- a top level platform stack is used to create other stacks, their environment variables, the stacks dependencies and dependency references (using the spacelift TF provider)
- since the platform stack manages environment variables (i.e. TF_VAR_ input variables for terraform/opentofu stacks) for all other stacks, this means all other stacks must depend on the platform stack and have the “always run” setting enabled in order to apply potential changes resulting from environment variables (i.e. input variable) changes
- this is extremely inneffective, as changing one single environment variable through the platform stack results in a cascade of runs for EVERY SINGLE STACK (since all must depend on platform stack), which takes a lot of time and slows down development a lot
If there was a “run stack on env vars changing” type of setting, the direct dependency of all stacks on the platform stack would not have to exist, but applying potential changes made by environment variables (i.e. input variables) changing would be taken care of by that setting.
Outside of this specific example, it’s usually common sense to rerun a module/stack if its input variables change. When the values of the env vars are also managed with IaC (e.g. with the spacelift terraform/opentofu provider like described above), this need becomes even more painfully obvious.
Please authenticate to join the conversation.
🗑️ Archived
💡 Feature Requests
Over 1 year ago
Get notified by email when there are changes.
🗑️ Archived
💡 Feature Requests
Over 1 year ago
Get notified by email when there are changes.