I'm not sure if this applies to you, but as I understand it, it is not possible to try-catch these errors today? At-least I have had the same issue and had to solve another way.
https://github.com/pulumi/pulumi/issues/3364
c
curved-eye-56312
09/14/2022, 10:42 AM
You understood correctly. I am trying to validate if a resource exists via get() function, but an error is thrown instead of being "handled" in the try-catch block.
I see from the URL you have shared that there seem to be a lot more people being affected by this behavior.
Were you able to find a workaround for this?
a
able-bird-91336
09/14/2022, 11:01 AM
No, sorry. Ended up solving it another way, this was a more "nice to have" req so didn't dig deeper. (made sure resource is created in a stack run earlier, and if it hadn't been created when running the stack that assumes it is created = crash. Bit uglier but enough for the req we had)
👍 1
c
curved-eye-56312
09/14/2022, 11:37 AM
yeah, I ended up doing a similar workaround, but it is something that I need to improve so it doesn't happen on other scenarios 😄
Thank you for answering, though!
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.