Blog
Long running jobs
We launched a new construct that makes it easy to run functions longer than 15 minutes — `Job]
These are useful for cases where you are running async tasks like video processing, ETL, and ML. A Job
can run for up to 8 hours.
Job
is made up of:
Job
— a construct that creates the necessary infrastructure.JobHandler
— a handler function that wraps around your function code in a typesafe way.Job.run
— a helper function to invoke the job.
Launch event
We hosted a launch livestream where we demoed the new construct, did a deep dive, and answered some questions.
The video is timestamped and here’s roughly what we covered.
- Intro
- Demo
- Deep Dive
- Deep dive into the construct
- Granting permissions for running the job
- Typesafety
- Defining the job handler
- Running the job
- Live debugging the job
- Q&A
- Q: When should I use
Job
vsFunction
? - Q: Is
Job
a good fit for batch jobs? - Q: Why CodeBuild instead of Fargate?
- Q: When should I use
Get started
Here’s how you use the new Job
construct. Start by creating a new job.
Add the job handler.
Finally invoke the job.
Note that the payload
and job name MyJob
here are typesafe.
For a full tutorial check out the Quick Start in the docs.