Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Conditional stacks #1212

Closed
jfalkenstein opened this issue Mar 15, 2022 · 4 comments
Closed

Feature Request: Conditional stacks #1212

jfalkenstein opened this issue Mar 15, 2022 · 4 comments

Comments

@jfalkenstein
Copy link
Contributor

jfalkenstein commented Mar 15, 2022

Frequently, lately, I've been working where I'd really like to specify a flag on a StackConfig that basically is like:

skip_stack: {{ var.environment == "prod" }}

In this scenario, if the environment is "prod", Sceptre would completely ignore the StackConfig. But if the environment was something else, it would build it as usual.

While avoiding building an individual stack is fairly easy if you're directly launching a single stack (e.g. sceptre launch my_group/stack-a.yaml), it's not possible when launching a StackGroup (e.g. sceptre launch my_group) and there's a stack in that group that you only want considered a part of the group sometimes.

The only way to simulate this behavior right now is by putting the stack outside the StackGroup and creating a conditional dependency on that stack. But that's not as clean.

This feature will ultimately fulfills the feature described in #1193

@jfalkenstein
Copy link
Contributor Author

@zaro0508 , @craighurley I'm wondering what your thoughts would be on this ^^

@zaro0508
Copy link
Contributor

this might be related to the greedy pattern matching, issue #941, feature that was removed in ver 2.4.0. It looks like people are generally in favor of using a flag to revive something similar to pattern matching files for deployment. How about we add --include/--exclude command line flags to match file patterns to include/exclude on a sceptre deploy? It can be a regex or glob matcher.

@jfalkenstein
Copy link
Contributor Author

Well, I'm not opposed to pattern matching. But I to be able to use jinja logic to determine whether or not a stack is included; using a cli flag doesn't give me that capability.

@zaro0508
Copy link
Contributor

related to issue #750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants