https://pulumi.com logo
Title
g

glamorous-cpu-85849

04/22/2021, 1:16 PM
How are people handling multiple stacks in the same environment, region, and project? Since the stack name must match the
Pulumi.<stack_name>.yaml
file, I'm not sure what the best solution is here. Example: multiple stacks considered 'dev' in the same environment. Aside from having random char generation and ending up with
Pulumi.8dnfa2.yaml
which is not very helpful for human operators, what are the other options? Any support for nested folders inside project? Inheritance for
Pulumi.<stack_name>.yaml
? Some kind of hack or wrapper? Organize projects and stacks differently? Appreciate insight here!
b

bored-oyster-3147

04/22/2021, 1:17 PM
why not name them descriptively? Idk why you have separate stacks so these names are just examples but like
dev-networking
,
dev-storage
,
dev-api
etc
actually h/o, how do you have multiple stacks for the same env since they're all just instances of the same resources?
Keeping in mind that in Pulumi, conceptually a stack is 1:1 an environment
r

red-match-15116

04/22/2021, 6:43 PM
We do have multiple dev stacks in the same environment internally, for each engineer’s dev stack. We usually follow a pattern of
Pulumi.dev-[user].yaml
👍 2
g

glamorous-cpu-85849

04/22/2021, 11:11 PM
Yes @red-match-15116 ‘s example is a use case. The others are similar just not ties to a user exactly. I was hoping to keep human names out of it and be a little more systematic.
Are the character limits on Pulumi logical names? I didn’t see this the docs. @red-match-15116
The stack being 1:1 with an environment I can understand, but this is the scenario where we want replicas of stacks/environments within the account or footprint.
It would be nice if we could reference a standard ‘Pulumi.dev.yaml’ and then all of the ‘Pulumi.dev-user.yaml’ would inherit those defaults and override as necessary. Save a lot of duplication.
l

little-cartoon-10569

04/22/2021, 11:40 PM
To achieve this, you can get config details from other sources; you're using a full programming language so you can use other libraries to do it. Maybe even use a single Pulumi.dev.yaml file and some properties are the names of environment variables, other config files, something like that?
Pulumi already goes quite a way beyond the "do one thing, well" philosophy and offers a myriad of features, but sometimes you will have to pull features in from other sources to get all the functionality you want.
b

bored-oyster-3147

04/23/2021, 12:14 AM
@glamorous-cpu-85849 There is
pulumi config cp
so you could setup a stack as your "schema" stack and put the config in that and then make part of your process that after you create the new stack you copy the config from the schema stack. Or you could use Automation API to manage your stacks. Then like @little-cartoon-10569 said spawning a new replica stack and moving config around would just be programmatic
👍 1
g

glamorous-cpu-85849

04/23/2021, 12:43 AM
Thank you both! I’ll look into your suggestions.