https://pulumi.com logo
#dotnet
Title
# dotnet
m

millions-journalist-34868

02/19/2020, 12:40 PM
Hi. I am new to Pulumi and I was wondering what was the proper way to organize its code. Right now all my azure ressources are created in the Main of my Program.cs file which is getting bigger and bigger 😞. Samples that I saw were doing the same thing which seems fine for a few ressources but as my infrastructure is growing it's getting less nice. Are there good practices to organize the code ?
t

tall-librarian-49374

02/19/2020, 12:50 PM
If you have multiple resources that are related and produce a logical higher-level component, you can wrap them as Component Resources, e.g. like here https://github.com/pulumi/examples/blob/master/azure-cs-cosmosapp-component/ArchiveFunctionApp.cs#L10
👍 2
If not, you are free to choose the structure based on classes/methods calling each other as you see fit
On a higher level, if you want to start deploying some of those resources separately, you may want to split them into multiple projects
m

millions-journalist-34868

02/19/2020, 12:55 PM
Okay, thanks 😀