https://pulumi.com logo
#general
Title
# general
b

brief-yacht-31759

10/09/2019, 3:23 PM
Hey, keen to POC Pulumi. Have some best practice questions if that is ok. In general, how are people mapping git repos/branches to pulumi stacks to logical infrastructure environments (environments)? I suppose an initial approach could be to have a git repo, with a branch per environment, then have a pulumi stack per environment. Where I am working now, an environment is basically AWS components, helm/kubernetes components, and then ansible/bash for some glue, so I am keen to automate straight away and think about the CI pipeline for progressing changes through multiple environments straight away.
i

incalculable-engineer-92975

10/09/2019, 3:28 PM
Not sure about best practice, but we have multiple config YAML files in the same repo. They move up with everything else.
b

brief-yacht-31759

10/09/2019, 3:29 PM
What does move up mean exactly?
a

acceptable-army-69872

10/09/2019, 3:31 PM
There's a concept called a stack, which would roughly be an environment (dev/stage/prod). You do a pulumi select to change which "environment" you'd be working on.
i do it all in a single branch, with feature branches for new functionality.
b

brief-yacht-31759

10/09/2019, 3:37 PM
I am guessing people in some cases don't put a whole logical env into one stack, to decrease the blast radius of things going wrong, or to mimic some sort of organisation structure like one team owns network, one owns permissions, etc.?
In which case, how are people managing CI pipelines to do multiple stack preview/update iterations in the correct order to update a logical env?
w

white-balloon-205

10/09/2019, 3:45 PM
Typically when a logical environment is broken down into multiple stacks, CD is driven independently for each layer, and automation at the CI/CD layer is used to manage the (hopefully somewhat rare) tasks that require coordinated changes across layers. The StackReference construct can be used to reference outputs of other stacks from higher-level stacks, which can be used to tie parts of the environment together.
FWIW - there is some material on this topic at https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/. If there are questions not addressed there - let us know so we can add to those docs as well.
b

brief-yacht-31759

10/09/2019, 3:50 PM
Oh wow, that is super helpful. That definitely would have been a more appropriate first start over Slack, apologies. Thanks for the help, will have a read.