ampedandwired/bora

Additional layer of abstraction

Closed this issue · 4 comments

Hi @ampedandwired,

Thanks for this gem!

I was wondering your thoughts on implementing an additional layer of abstraction.

For example. I have application 'example' comprised of multiple stacks that essentially build up separate components of aws infrastructure.

I would want the ability of bora apply example or rake example:apply which will then use the apply method to build those stacks listed within the bora.yml with each stack having a separate template file.

Thanks,
thebeefcake

Hi @thebeefcake You can do this to some extent already via nested Cloudformation stacks.

https://aws.amazon.com/blogs/devops/use-nested-stacks-to-create-reusable-templates-and-support-role-specialization/

They can be a little tricky to work with - especially stack updates.

So the use case here is that you want to be able to break a stack down into multiple smaller stacks, but then still work with them as if they are a single stack in Bora?

I can see why that might be useful, but I'm a little bit hesitant to add it to Bora right now. It would introduce a fair bit of complexity to the code and I'm not sure the benefits would be worth it. There are a few alternative approaches that may address some of the use cases:

  • Use nested cloudformation stacks as @herebebogans mentioned
  • If you're using cfndsl, you can break your template down into multiple files, but then combine them into a single template
  • Keep them as separate templates in Bora, but write a small wrapper script over Bora to do this

@thebeefcake we do this via Rake along with ERB to templatise a bora.yml that describe our core infra eg vpc's / subnets and uses the bora rake tasks to apply each in order.

I feel this is better down outside bora with orchestration tools.

I agree that this is better done as a layer on top of bora. I'm going to close this one for now.