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

witty-belgium-75866

02/01/2024, 3:02 PM
Hello! Is there a way to use multiple config files per stack?
m

millions-furniture-75402

02/01/2024, 3:15 PM
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

witty-belgium-75866

02/01/2024, 3:16 PM
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

millions-furniture-75402

02/01/2024, 3:18 PM
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

witty-belgium-75866

02/01/2024, 3:25 PM
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

millions-furniture-75402

02/01/2024, 3:36 PM
Is any of these shared configuration?
w

witty-belgium-75866

02/01/2024, 3:36 PM
what do you mean?
each file represents a subset of the configuration of the stack
m

millions-furniture-75402

02/01/2024, 3:37 PM
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

lemon-agent-27707

02/01/2024, 5:29 PM
@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/