Skip to content

CreateHarvestJob

Source: src/AWS/MediaPackageV2/CreateHarvestJob.ts

Runtime binding for mediapackagev2:CreateHarvestJob.

Exports a clip of previously streamed content from the bound OriginEndpoint to an S3 bucket as a live-to-VOD asset — e.g. a Lambda that clips a highlight when an operator flags a moment. The endpoint must have a startover window covering the requested schedule, and the destination bucket needs a policy granting the mediapackagev2.amazonaws.com service principal write access. The endpoint’s group, channel, and name are injected from the binding. Provide the implementation with Effect.provide(AWS.MediaPackageV2.CreateHarvestJobHttp).

// init — bind the operation to the endpoint
const createHarvestJob = yield* AWS.MediaPackageV2.CreateHarvestJob(endpoint);
// runtime
const job = yield* createHarvestJob({
HarvestedManifests: { HlsManifests: [{ ManifestName: "index" }] },
ScheduleConfiguration: {
StartTime: new Date(Date.now() - 5 * 60_000),
EndTime: new Date(),
},
Destination: {
S3Destination: { BucketName: "my-clips", DestinationPath: "highlights/" },
},
});