Hey! I'm new to Pulumi and I'm getting a little lo...
# dotnet
a
Hey! I'm new to Pulumi and I'm getting a little lost working out the best way to structure my program. I have a bunch of resources across Azure, CloudFlare, and Mongo Atlas. Is there any guidance or best practice I can read around how to structure a program? I have been creating classes that initialise resources in the constructor, but this seems to lead to some odd behaviour, and interesting gotchas. I feel like I'm doing something wrong, but all the examples I can find don't go into much detail and just lump everything into
program.cs
b
i wrote this a few weeks ago, let me know if it helps? https://leebriggs.co.uk/blog/2023/08/17/structuring-iac
a
That seems to be angling towards making groups of related components into a
ComponentResource
?
b
correct, yes!
a
Is there a situation where you would advice against doing that, or is it always pretty much the way to go
b
If you’re only managing a few resource in a stack, it’s not necessary. Once you get outside that components is always a better option
a
Thanks, I'll take a look