https://pulumi.com logo
Title
b

brave-nightfall-19158

10/25/2021, 5:13 PM
hey y'all. Quick question on git / file structure vs stacks. If I have 2 different stacks to manage 2 different DNS domains, for example, do I need 2 separate folders with a Pulumi.yml & index file? Or can the 2 stacks be configured with e.g. Pulumi.domainA.yml & Pulumi.domainB.yml. If the latter, how does Pulumi know where the code is for the different stacks? Following the Pulumi guide, I'm assuming that 2 stacks for different environments are actually only configurable based on the config in the yml file, but the resources must be the same in both environments?
b

billowy-army-68599

10/25/2021, 5:20 PM
yep! stacks are managed by
Pulumi.<stackname>.yaml
- it needs to be in the same directory as your
Pulumi.yaml
b

brave-nightfall-19158

10/25/2021, 5:28 PM
So if there are two stacks, they will have exactly the same resources, but just configured with the yml file? And so if the two stacks need to have different resources, they have to be in separate folders with separate index files?
b

billowy-army-68599

10/25/2021, 5:33 PM
you could use if statements to separate them, but yes, if they have different resources - they should be projects. If they have different configuration, like the cloud provider region you'ree deploying them to, you should have distinct stacks
b

brave-nightfall-19158

10/25/2021, 6:35 PM
ok awesome. thanks so much @billowy-army-68599!!