https://pulumi.com logo
#general
Title
# general
g

great-zebra-31498

01/18/2024, 12:13 PM
Hello ☀️ Is it possible to perform retries and / or handle exceptions in Pulumi? I tried to find anything in docs / Github issues, but I found only feature requests. I'm trying to provision/update AWS Glue crawlers and sometimes they might be running, so I would like to skip updating or repeat it for couple minutes. I appreciate any tips.
Copy code
aws:glue:Crawler (xxxxxxx):
    error: 1 error occurred:
      * updating urn:pulumi:production::xxxxxxx::aws:glue/crawler:Crawler::xxxxxxx: 1 error occurred:
      * updating Glue Crawler (xxxxxxx): InvalidInputException: Cannot update Crawler while running. Please stop crawl or wait until it completes to update.
    {
      RespMetadata: {
        StatusCode: 400,
        RequestID: "ca580e1d-31a9-4725-8db6-0773ddbfa079"
      },
      Message_: "Cannot update Crawler while running. Please stop crawl or wait until it completes to update."
    }
f

freezing-vase-18205

01/19/2024, 8:01 AM
I will soon have a similar problem. I thought that maybe you should first use one of the get functions to fetch the resource, and only try create it if the fetch errors. I don’t know though if the error during the initial get won’t stop the deployment run
g

great-zebra-31498

01/19/2024, 9:26 AM
problem is only with update/delete for running crawlers depending on extra "get function to fetch the resource" might hit the same issues - function returns that crawler is idle and a moment later this crawler is running, and pulumi returns "Cannot update Crawler while running" error one of my ideas was to use dynamic resource https://www.pulumi.com/docs/concepts/resources/dynamic-providers/ to handle crawlers in a custom way using boto3 (I use Python code for pulumi)
ideally, I'd rather use built-in mechanisms than write something on my own