Skip to content

StartJob

Source: src/AWS/Amplify/StartJob.ts

Runtime binding for amplify:StartJob.

Bind an App in the function’s init phase to get a callable that starts a build/deploy job for one of the app’s branches — the app id is injected automatically and amplify:StartJob is granted on the app’s jobs. Provide the implementation with Effect.provide(AWS.Amplify.StartJobHttp).

The canonical use is a webhook Lambda that rebuilds the site when upstream content changes (a CMS publish, a data refresh, etc.).

// init — bind the operation to the app
const startJob = yield* AWS.Amplify.StartJob(app);
// runtime — kick off a release of the main branch
const { jobSummary } = yield* startJob({
branchName: "main",
jobType: "RELEASE",
jobReason: "CMS content published",
});