Hello! Is there a way to use multiple config files...
# general
w
Hello! Is there a way to use multiple config files per stack?
m
Depends on what you're really asking. Stack configuration files are tightly coupled with a stack. However, if you're asking for "global" configuration, then yes, you can share common configuration across stacks using
Pulumi.yaml
. Otherwise, you'll likely have to use your general purpose language's patterns for configuration.
w
thanks for the response @millions-furniture-75402 Let’s for example, assume I have
staging
stack with the corresponding
Pulumi.staging.yaml
file. is there a way to have several files for the same stack?
m
Are we clear on terminology? A Pulumi project is the resource graph "plan" A stack is an instance of that project, which should have its own configuration and outputs. You can make 100 stacks for 1 Project if you want, and the only thing different is the
Pulumi.<stackname>.yaml
.
Do you have a monolithic project you're trying to break down into more logical stacks?
w
Thanks, I’m familiar with the terminology, I just have a stack with a lot of resources and I just want to split the configuration yaml of these resources into several files ( all related to the same stack )
m
Is any of these shared configuration?
w
what do you mean?
each file represents a subset of the configuration of the stack
m
Can you tell me more about your use case?
If you're using Pulumi Cloud, there is also this https://www.pulumi.com/product/esc/
l
@witty-belgium-75866 as @millions-furniture-75402 points out ESC allows you to compose multiple config files, override and inherit values, etc: https://www.pulumi.com/docs/esc/get-started/import-environments/