How does prefect work with eventbridge? I have sch...
# ask-community
z
How does prefect work with eventbridge? I have schedules lambdas.
c
That’s a pretty loose question - what exactly are you looking for?
z
@Christopher Boyd I want to observe all scheduled pipelines, including lambdas being kicked off by event bridge but not sure what that process might look like, script/dashboard examples would be helpful. @Taylor Curran thanks for the article, it's not quite what I'm looking for but it's a good start!
c
If you ahve scheduled lambdas, they would just be decorated with your
@flow
decorator - if you have them configured properly to point to the prefect cloud (through a login / API_URL + KEY), then they would show up in the UI. eventbridge would -> trigger your lambda -> starts your flow
🙌 1
A lambda at it’s core is just a temporary compute instance with a filesystem
1
t
What Chris said, also not sure if we have detailed examples, but essentially you’ll use our API calls to let event bridge programmatically interact with Prefect: https://docs.prefect.io/api-ref/overview/
👍 1
c
eventbridge would just trigger that in the same way that Prefect might, the only difference being in this way, you are being re-active, and don’t need to specify / build some deployment, you would just run it as a local flow
👍 1
z
Is prefect able to trigger a lambda? I would prefer to have more control over scheduling using cloud/ui, versus defining the schedules through eventbridge using our cdk stacks.
fyi, we are doing serious experimentation with it over the next couple of weeks.
c
In what way, and what outcome? Generally my answer would be
YES
although your options vary You could literally have something as simple as :
Copy code
@flow():
   response = request.get(lambda url)
there is the ability to do it via boto, api, function url
all of which can be wrapped / triggered by prefect
beyond that, we have a set of integrations and collections with more direct functionality https://docs.prefect.io/collections/catalog/?h=collec
z
In our case fairly straight forward at the moment, we have eventbridge invoking a couple of lambdas every 30m or so. Perhaps a simple timed request from Prefect could do the job.
which function does {API_URL + KEY} need to be passed to?