Hey Team, is there any way to lookup for the exist...
# typescript
Hey Team, is there any way to lookup for the existence of a resource without the function actually throwing an error? For context - I am trying to get
but it errors out and the error seems to be not catchable. Maybe relatable - https://github.com/pulumi/pulumi/issues/3364
You can use the SDK provided by the appropriate cloud provider.
In addition to Paul's excellent suggestion, some resource types also have functions that are designed to return multiple matches, e.g.
. You could pass it criteria that should return exactly one if it matches.
Thank you. I am doing exactly that with getUserAssignedIdentityOutput. However I wanted to catch the error (when the resource doesn’t exist) but the function itself isn’t catchable. Was wondering if there was any other way to approach this?