Skip to content

AWS.MediaLive reference

Source: packages/aws/src/MediaLive/BatchUpdateSchedule.ts

Runtime binding for medialive:BatchUpdateSchedule.

Adds and/or removes schedule actions on the bound Channel — ad breaks (SCTE-35 splices), input switches, static image overlays, pause states — the primary data-plane API for driving a live broadcast (e.g. a playout-automation Lambda that switches inputs on a timecode). The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.BatchUpdateScheduleHttp).

BatchUpdateSchedule: Driving the Channel Schedule

Section titled “BatchUpdateSchedule: Driving the Channel Schedule”
// init — bind the operation to the channel
const updateSchedule = yield* AWS.MediaLive.BatchUpdateSchedule(channel);
// runtime
yield* updateSchedule({
Creates: {
ScheduleActions: [
{
ActionName: "switch-to-backup",
ScheduleActionStartSettings: {
FixedModeScheduleActionStartSettings: {
Time: "2026-01-01T00:00:00.000Z",
},
},
ScheduleActionSettings: {
InputSwitchSettings: { InputAttachmentNameReference: "backup" },
},
},
],
},
});

Source: packages/aws/src/MediaLive/Channel.ts

An AWS Elemental MediaLive channel — the live encoder that reads from attached inputs, transcodes per its encoder settings, and writes to output destinations (HLS, RTMP, MediaPackage, …).

Channels bill per running hour; Alchemy provisions channels in the IDLE state and never starts them — start/stop is a runtime operation.

Single-pipeline HLS channel

const channel = yield* MediaLive.Channel("Live", {
channelClass: "SINGLE_PIPELINE",
roleArn: role.roleArn,
inputAttachments: [
{ InputId: input.inputId, InputAttachmentName: "primary" },
],
inputSpecification: {
Codec: "AVC",
Resolution: "SD",
MaximumBitrate: "MAX_10_MBPS",
},
destinations,
encoderSettings,
});

IAM role for MediaLive

const role = yield* IAM.Role("MediaLiveRole", {
assumeRolePolicyDocument: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: { Service: "medialive.amazonaws.com" },
Action: ["sts:AssumeRole"],
},
],
},
});

Channel.lookup references a channel Alchemy doesn’t manage (created in the console or by another stack), found by channelId or name. It is read during plan/deploy and never created, updated or deleted.

const live = AWS.MediaLive.Channel.lookup({ name: "live" });

Source: packages/aws/src/MediaLive/DeleteSchedule.ts

Runtime binding for medialive:DeleteSchedule.

Clears every scheduled action from the bound Channel’s schedule in one call — the reset lever a playout-automation Lambda pulls before programming a fresh broadcast rundown with BatchUpdateSchedule. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.DeleteScheduleHttp).

DeleteSchedule: Driving the Channel Schedule

Section titled “DeleteSchedule: Driving the Channel Schedule”
// init — bind the operation to the channel
const deleteSchedule = yield* AWS.MediaLive.DeleteSchedule(channel);
// runtime
yield* deleteSchedule();

Source: packages/aws/src/MediaLive/DescribeChannel.ts

Runtime binding for medialive:DescribeChannel.

Reads the bound Channel’s live state — lifecycle state (IDLE/RUNNING), pipeline details, egress endpoints, and attached inputs — e.g. for an operations dashboard or a scheduler that only starts a channel that is not already running. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.DescribeChannelHttp).

// init — bind the operation to the channel
const describeChannel = yield* AWS.MediaLive.DescribeChannel(channel);
// runtime
const { State } = yield* describeChannel();
const running = State === "RUNNING";

Source: packages/aws/src/MediaLive/DescribeInput.ts

Runtime binding for medialive:DescribeInput.

Reads the bound Input’s live state — attachment state (DETACHED/ATTACHED), resolved push ingest URLs, sources, and security groups — e.g. so a stream-key service can hand a contributor the RTMP endpoint to push to. The input id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.DescribeInputHttp).

// init — bind the operation to the input
const describeInput = yield* AWS.MediaLive.DescribeInput(input);
// runtime
const { Destinations } = yield* describeInput();
const ingestUrl = Destinations?.[0]?.Url;

Source: packages/aws/src/MediaLive/DescribeSchedule.ts

Runtime binding for medialive:DescribeSchedule.

Reads the bound Channel’s schedule — the queue of pending and recent actions created with BatchUpdateSchedule (one page per call; pass NextToken from the previous response to continue) — e.g. so a playout dashboard can show upcoming input switches and ad breaks. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.DescribeScheduleHttp).

DescribeSchedule: Driving the Channel Schedule

Section titled “DescribeSchedule: Driving the Channel Schedule”
// init — bind the operation to the channel
const describeSchedule = yield* AWS.MediaLive.DescribeSchedule(channel);
// runtime
const { ScheduleActions } = yield* describeSchedule();

Source: packages/aws/src/MediaLive/DescribeThumbnails.ts

Runtime binding for medialive:DescribeThumbnails.

Fetches the latest preview thumbnail (base64 JPEG) from a pipeline of the bound RUNNING Channel — e.g. a confidence-monitoring dashboard that renders a live snapshot of what the channel is encoding. Requires thumbnails to be enabled in the channel’s encoder settings; a channel that is not running answers with the typed BadRequestException tag. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.DescribeThumbnailsHttp).

// init — bind the operation to the channel
const describeThumbnails = yield* AWS.MediaLive.DescribeThumbnails(channel);
// runtime
const { ThumbnailDetails } = yield* describeThumbnails({
PipelineId: "0",
ThumbnailType: "CURRENT_ACTIVE",
});

Source: packages/aws/src/MediaLive/Input.ts

An AWS Elemental MediaLive input — the ingest endpoint or source locator a channel reads live content from (RTMP/RTP push, HLS/MP4 pull, MediaConnect flow, …).

RTMP push input behind an allowlist

const isg = yield* MediaLive.InputSecurityGroup("Allowlist", {
whitelistRules: ["0.0.0.0/0"],
});
const input = yield* MediaLive.Input("Stream", {
type: "RTMP_PUSH",
inputSecurityGroups: [isg.inputSecurityGroupId],
destinations: [{ StreamName: "live/stream" }],
});

HLS pull input

const input = yield* MediaLive.Input("Vod", {
type: "URL_PULL",
sources: [{ Url: "https://example.com/stream/index.m3u8" }],
});
const channel = yield* MediaLive.Channel("Live", {
roleArn: role.roleArn,
inputAttachments: [
{ InputId: input.inputId, InputAttachmentName: "primary" },
],
encoderSettings,
destinations,
});

Input.lookup references an input Alchemy doesn’t manage (created in the console or by another stack), found by inputId or name. It is read during plan/deploy and never created, updated or deleted.

const camera = AWS.MediaLive.Input.lookup({ name: "camera-1" });

Source: packages/aws/src/MediaLive/InputSecurityGroup.ts

An AWS Elemental MediaLive input security group — an IP allowlist that gates which source networks may push content to attached PUSH inputs (RTMP_PUSH, RTP_PUSH, UDP_PUSH).

InputSecurityGroup: Creating an Input Security Group

Section titled “InputSecurityGroup: Creating an Input Security Group”

Allow a single network

const isg = yield* MediaLive.InputSecurityGroup("Allowlist", {
whitelistRules: ["10.0.0.0/16"],
});

Open to the world (test-only)

const isg = yield* MediaLive.InputSecurityGroup("Open", {
whitelistRules: ["0.0.0.0/0"],
tags: { team: "media" },
});
const input = yield* MediaLive.Input("Stream", {
type: "RTMP_PUSH",
inputSecurityGroups: [isg.inputSecurityGroupId],
destinations: [{ StreamName: "live/stream" }],
});

InputSecurityGroup: Looking up an existing input security group

Section titled “InputSecurityGroup: Looking up an existing input security group”

InputSecurityGroup.lookup references an input security group Alchemy doesn’t manage (created in the console or by another stack), found by inputSecurityGroupId. It is read during plan/deploy and never created, updated or deleted.

const studio = AWS.MediaLive.InputSecurityGroup.lookup({ inputSecurityGroupId: "123456" });

Source: packages/aws/src/MediaLive/ListAlerts.ts

Runtime binding for medialive:ListAlerts.

Lists the bound Channel’s alerts — SET and CLEARED error conditions such as a lost input or a failed output (one page per call; pass NextToken from the previous response to continue). Filter with StateFilter: "SET" to see only active problems — e.g. a health-check Lambda that pages an operator while any alert is SET. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.ListAlertsHttp).

// init — bind the operation to the channel
const listAlerts = yield* AWS.MediaLive.ListAlerts(channel);
// runtime
const { Alerts } = yield* listAlerts({ StateFilter: "SET" });

Source: packages/aws/src/MediaLive/ListChannels.ts

Runtime binding for medialive:ListChannels.

Enumerates the account’s MediaLive channels (one page per call — pass NextToken from the previous response to continue) — e.g. a cost sentinel that finds channels left RUNNING outside broadcast hours. Account-level: the deploy-time grant is medialive:ListChannels on *. Provide the implementation with Effect.provide(AWS.MediaLive.ListChannelsHttp).

// init — bind the account-level operation
const listChannels = yield* AWS.MediaLive.ListChannels();
// runtime
const { Channels } = yield* listChannels({ MaxResults: 20 });
const running = (Channels ?? []).filter((c) => c.State === "RUNNING");

Source: packages/aws/src/MediaLive/ListInputs.ts

Runtime binding for medialive:ListInputs.

Enumerates the account’s MediaLive inputs (one page per call — pass NextToken from the previous response to continue) — e.g. an inventory endpoint that maps ingest endpoints to the channels they feed. Account-level: the deploy-time grant is medialive:ListInputs on *. Provide the implementation with Effect.provide(AWS.MediaLive.ListInputsHttp).

// init — bind the account-level operation
const listInputs = yield* AWS.MediaLive.ListInputs();
// runtime
const { Inputs } = yield* listInputs({ MaxResults: 20 });
const attached = (Inputs ?? []).filter((i) => i.State === "ATTACHED");

Source: packages/aws/src/MediaLive/RestartChannelPipelines.ts

Runtime binding for medialive:RestartChannelPipelines.

Restarts one or both encoder pipelines of the bound RUNNING Channel without a full stop/start cycle — the standard remedy for a wedged pipeline (frozen output, persistent alert) that an automated-recovery Lambda applies when a channel alert fires. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.RestartChannelPipelinesHttp).

RestartChannelPipelines: Controlling Channels

Section titled “RestartChannelPipelines: Controlling Channels”
// init — bind the operation to the channel
const restartPipelines = yield* AWS.MediaLive.RestartChannelPipelines(channel);
// runtime
yield* restartPipelines({ PipelineIds: ["PIPELINE_0"] });

Source: packages/aws/src/MediaLive/StartChannel.ts

Runtime binding for medialive:StartChannel.

Starts the bound Channel, transitioning it from IDLE through STARTING to RUNNING. A RUNNING channel encodes and bills hourly — pair with StopChannel to control encoding cost (e.g. a scheduler Lambda that runs the channel only during broadcast windows). The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.StartChannelHttp).

// init — bind the operation to the channel
const startChannel = yield* AWS.MediaLive.StartChannel(channel);
// runtime
const { State } = yield* startChannel();

Source: packages/aws/src/MediaLive/StopChannel.ts

Runtime binding for medialive:StopChannel.

Stops the bound Channel, transitioning it from RUNNING through STOPPING back to IDLE — the other half of a broadcast-window scheduler built on StartChannel. Stopping a channel that is not running fails with the typed ConflictException tag. The channel id is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaLive.StopChannelHttp).

// init — bind the operation to the channel
const stopChannel = yield* AWS.MediaLive.StopChannel(channel);
// runtime
const { State } = yield* stopChannel();