Hi everyone, Is there some mechanism that would a...
# general
p
Hi everyone, Is there some mechanism that would allow me to run my code on error? Here're some examples of what I need: Let's say an azure resource provider runs into some errors like: • 429 rate limit exceeded • 409 already exists • a random issue I dont yet know how to handle That I want to react on by: • requesting and logging the remaining rate limits • logging the resource ID, URN and parent to the filesystem so that I can import the resource before trying again (which happens to be needed for example in case of some intermittent issues on Azure) • log it to some analytical tool
l
You could write a little automation-api wrapper and have it invoke your standalone Pulumi project. In fact, the example snippet on this page is really close to your use case: https://www.pulumi.com/blog/automation-api/
Though of course you wouldn't need the HTTP handler.. it'd just be a normal bit of top-level code.
p
Thank you @little-cartoon-10569, I will try this approach and see if I can get all the necessary information, especially for the second case.
👍 1