bora icon indicating copy to clipboard operation
bora copied to clipboard

Allow stacks to be instantiated multiple times

Open ampedandwired opened this issue 9 years ago • 7 comments

See #6 for background. The basic idea is taking a stack, say "web-uat" and being able to instantiate that many times ("web-uat-1", "web-uat-2", etc).

At the moment this is possible by using the --cfn-stack-name command line option, however this should really be supported as a first-class citizen in Bora, as it is a powerful way of working with stacks.

ampedandwired avatar Oct 16 '16 23:10 ampedandwired

I think most use cases of this will be an orchestrator creating new stacks with a build number? We use ansible to create the bora.yml from a template in a prep stage as part of a Jenkins release pipeline. The build number goes into the stack name eg


template:
  myapp:
    stacks:
      dev-{{build_number}}:
      .....
      uat-{{build_number}}:
      .....
      prd-{{build_number}}:
      ....

The generated bora.yml also becomes a convenient release artifact.

I'm wondering is should be a bora feature or better done outside of it with a templating tool?

herebebogans avatar Oct 24 '16 22:10 herebebogans

Sorry didn't notice the closed ...

herebebogans avatar Oct 26 '16 00:10 herebebogans

Using ansible that way is a neat idea. Gives you immutable stacks which are pretty cool. How do you manage the switch over from one prd stack to another?

You might be right, maybe this is something that should be layered on top of Bora using a different tool. That said, I can see an argument for some support of this inside Bora too. Depends on how common of a use case this is, and how people are integrating Bora into their deployment pipelines.

ampedandwired avatar Oct 31 '16 00:10 ampedandwired

We do the switchover outside cloudformation with Route53 DNS changes - but our scenario is quite a simple website stack.

Yes I can see it both ways. I think bora is a great purpose tool for it's solution to "per environment cookie cutter cloudformation stacks".

I've seen quite a few posts on the cfndsl issue list of people looking for this kind of environment abstraction solution - should promote it some more there!

herebebogans avatar Nov 01 '16 01:11 herebebogans

Yeah, I really should get out and promote it a bit more :)

ampedandwired avatar Nov 01 '16 07:11 ampedandwired

@herebebogans What I was thinking for this was adding an additional optional "stack identifier" to the end of the bora command. So your example config above would become simply:

template:
  myapp:
    stacks:
      dev
      .....
      uat
      .....
      prd
      ....

And then you would apply it like this:

$ bora apply myapp-dev <build_number>

where build_number comes from Jenkins.

This would result in a stack named myapp-dev-<build_number> in cloudformation.

Thoughts?

ampedandwired avatar Nov 02 '16 00:11 ampedandwired

Yes - that's a elegant idea.

herebebogans avatar Nov 03 '16 20:11 herebebogans