thanks @great-sunset-355, I'll check those links out!
g
great-sunset-355
01/31/2023, 10:56 AM
in general, I tend to avoid
resource.get
because in past it had some weird consequences (I do not remember now, sorry) and use
get_resource
or rather
get_resource_output
which works as expected
m
millions-pharmacist-626
01/31/2023, 10:57 AM
is there any advantage of using
get_resource_output
over
get_resource
? The whole input / output thing is still a bit esoteric to me. I find that whenever I need a resource value (e.g. the ID), most times I have to
apply()
to use it.
l
little-cartoon-10569
01/31/2023, 9:13 PM
The get_resource functions return (your language's version of) a promise, which you have to handle in the normal way. The get_resource_output functions wrap those promises in outputs. The primary benefit of this is member lifting: you can pass a value inside the output object into a Pulumi resource constructor without waiting for the promise to resolve.
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.