-
Notifications
You must be signed in to change notification settings - Fork 11
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
dynamic list of stacks #6
Comments
I've been thinking about doing this as well, but I haven't landed on a solution that I really like yet. The idea is to have a bora stack definition that acts as kind of a "template" that you can use to stamp out multiple CFN stacks with very similar configuration. There's a Anyway, I'm planning a hacking session on Bora this week, I'll have a play with a few things and see how they look. |
... which is of course pretty much what you were suggesting :) Another option might be to allow a "default" stack config that gets used whenever there is no matching stack found. However I'm not sure I like this approach, it's a bit more non-obvious and limiting (what if you want many "default" stack configs?). |
Looking at the code I think it should be pretty easy to do it in a similar way to how we're handing region overrides from the command line. This wouldn't be available for the rake tasks though, but TBH I'm thinking of deprecating the rake functionality, as it's pretty limiting and you can always invoke the bora process from Rake if you really need to. What sort of an impact did you envisage on the resolvers? As far as I can see they wouldn't need to change? |
I wasn't sure if the resolvers just got applied to params? I hadn't followed it all the way through. I had (not MVP!) an idea around being able to pass a param and interpolate that into a cfn_stack_name in bora. You do some of that with creds and outputs I think? So in my case I'm identifying stacks by a number id so if I pass that as a param I can use that number in my cfndsl and in my cfn stack name. But short term I think yeah some way of having another named param like region to set the cloudformation stack name over the bora name would be good enough. Just need to make sure that change is propogated to status, delete and outputs I think? The bora stack name gets used a lot so wasn't sure how to approach changing that. I've stopped using the rake tasks - the Thor command is much nicer :) |
Resolvers are just applied to params at present. Applying them to stack_name would be an interesting idea, although it does make it easy to shoot yourself in the foot by forgetting to supply the parameter. |
I'm tossing up between the various ways to implement this. Interested in your thoughts from a user perspective. To recap: Option 1 is to introduce a Option 2 is to allow parameter interpolation in the Option 3 is to introduce a first-class top-level abstraction for this. I want to use the name "stack template", it's too confusing with the existing "template" terminology, but will go with it just for this discussion. So there would be syntax in bora.yml to declare a stack as a "template" and command line options to pass in the "stack instance" name or ID. Downside is more concepts and more complexity. Upside is a possibly a cleaner way to work with these concepts. Overall I'm probably leaning towards option 2 as a good balance between the various considerations. Thoughts? |
I think 1 and 3 are both valid but 2 would solve my particular problem the best :) |
Cool, I'll give this a crack. It will lay the groundwork for another feature I've been wanting to add too - being able to refer to other params in property substitutions |
After looking at this more closely, I decided that option 2 was actually not the best way to go about this. I think conflating params with stack name is confusing. It would require pretty much every command to accept a Thinking on it, I think option 3 is really what we need - I've opened a new ticket to track that in #10. In the meantime, I've added a new flag |
Released as 1.2.0 |
Sorry for the breaking change... I'm changing the short version of this param from |
Released 1.3. Use that. |
Hey mate,
We have a requirement to run the near same stack many times but with a slightly different config. That is a dynamic list really. I want to pass in and have a stack run a set config (say dev) but then override with my runtime params and most importantly give it an aws cfn name rather than a static one in bora.yml. So something like
bora apply my-stack-dev --cfn-stack-id=my-stack-dev-1 --params 'example=1'
Looked at the code - think it is possible if I treat cfn-stack-id as a new type of param and in stack.rb would have to do some work so that:
@cfn_stack_name = stack_config['stack_name'] || @stack_name
can also be set by a 3rd option (which takes precedence)
But do you want to take it in this direction as it kinda adds a new concept and is a bit of a largish change. Have to deal with all the other tasks, look at resolvers etc
Otherwise I'll use output the and fall back to aws tooling.
The text was updated successfully, but these errors were encountered: