I decided to surf github and I noticed there are a...
# general
p
I decided to surf github and I noticed there are a lot of people writing their code in what I would consider in the typical way we program. I have also noticed that people are writing their Pulumi programs in a more declarative way not really instantiating anything (because pulumi does this for us?) . Which way is the right way? Or is it dealers choice? Any recommendations? I've been making classes and newing up instances of said classes instead of making consts and assigning attributes to them alone.
r
Wanna show us what you mean with some code?
p
Sure, so there is this way by making an interface and helper class.
And then there is this way Ive seen where you just do a bunch of consts basically.
r
Ah yeah it’s up to you really. If you are logically grouping resources together in your classes, you might consider using component resources: https://www.pulumi.com/docs/intro/concepts/resources/#authoring-a-new-component-resource Your current structure makes sense for reuse of the components you create, whereas the const-based flow might make sense for one-off deployments.
p
Oh gotcha gotcha. Makes sesne
Thanks for the link. This is good to know about
partypus 8bit 1