https://pulumi.com logo
Title
f

flaky-school-82490

06/17/2021, 4:54 PM
Hi #getting-started, I have been looking on guidance and best practices on how to organize stack code to best manage and version control (Azure and dotnet stack, multitenant SaaS app). Most samples I looked at in your C# collection of samples group all code in a single Stack.cs. I was hoping I could find something more component-based, with configuration separated from stack code, so we can easily set up our delivery processes around it. How would you separate configuration from implementation, and allow a build pipeline to automatically compose stacks based on environment variables and such?
q

quiet-architect-74241

06/18/2021, 11:22 AM
We have one stack, but are creating different parts of the stack in dedicated extension methods to keep it maintainable. From the Stack constructor, we call those extension methods. So far, our stacks are not extremely big, so this is good enough for us. All our deployments are getting the output of Pulumi first, set variables based on that and the rest of the pipelines use those variables where needed.
Further more, we have standardized methods for components (a standard webapp, a standard storage account, etc.) that we call from those extension methods.
f

flaky-school-82490

06/18/2021, 2:19 PM
Thanks @quiet-architect-74241, super helpful! Then I guess you can create test projects with "unit stacks" or single components, using the standardized methods. I will give it a try.
👍 1