"ComponentResource" is the Pulumi-idiomatic way to do this. However, you can achieve this with any block of code / class / object that your preferred language supports.
i
icy-doctor-13719
08/23/2022, 10:02 PM
oh, interesting. my brain is still thinking in HCL/Terraform mode … I didn’t think about creating a new class and instantiating it 🤔
l
little-cartoon-10569
08/23/2022, 10:24 PM
Just be careful with the Pulumi name parameter. Its value needs to be different for each resource (obviously), but it also needs to never change once the resource is created (because a new name means a new resource, which means deleting the old one).
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.