Skip to content

AWS.MediaConnect reference

Source: src/AWS/MediaConnect/DescribeFlow.ts

Runtime binding for mediaconnect:DescribeFlow.

Reads the bound Flow’s live state — status (STANDBY/ACTIVE), source, outputs, and entitlements — e.g. for an operations dashboard or a scheduler that only starts a flow that is not already running. The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.DescribeFlowHttp).

// init — bind the operation to the flow
const describeFlow = yield* AWS.MediaConnect.DescribeFlow(flow);
// runtime
const { Flow: current } = yield* describeFlow();
const running = current?.Status === "ACTIVE";

Source: src/AWS/MediaConnect/DescribeFlowSourceMetadata.ts

Runtime binding for mediaconnect:DescribeFlowSourceMetadata.

Reads the bound Flow’s ingest transport-stream metadata — the programs and their video/audio/data streams — plus status messages about the source. Useful for confidence monitoring of what is actually arriving at the flow. A flow whose source is not currently receiving content answers with Messages instead of media info. The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.DescribeFlowSourceMetadataHttp).

DescribeFlowSourceMetadata: Observing Flows

Section titled “DescribeFlowSourceMetadata: Observing Flows”
// init — bind the operation to the flow
const sourceMetadata = yield* AWS.MediaConnect.DescribeFlowSourceMetadata(flow);
// runtime
const { TransportMediaInfo, Messages } = yield* sourceMetadata();
const programs = TransportMediaInfo?.Programs ?? [];

Source: src/AWS/MediaConnect/DescribeFlowSourceThumbnail.ts

Runtime binding for mediaconnect:DescribeFlowSourceThumbnail.

Fetches a thumbnail of the content currently arriving at the bound Flow’s source (base64-encoded, refreshed every few seconds) — the building block for visual confidence monitoring. Thumbnails are only generated while the flow is running and sourceMonitoringConfig has thumbnails enabled; otherwise the response carries ThumbnailMessages explaining why no image is available. The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.DescribeFlowSourceThumbnailHttp).

DescribeFlowSourceThumbnail: Observing Flows

Section titled “DescribeFlowSourceThumbnail: Observing Flows”
// init — bind the operation to the flow
const sourceThumbnail = yield* AWS.MediaConnect.DescribeFlowSourceThumbnail(flow);
// runtime
const { ThumbnailDetails } = yield* sourceThumbnail();
const image = ThumbnailDetails?.Thumbnail; // base64-encoded JPEG

Source: src/AWS/MediaConnect/Flow.ts

An AWS Elemental MediaConnect flow — a reliable live-video transport between a source and one or more outputs.

Creating a flow leaves it in STANDBY; a flow only ingests/egresses media (and bills for transport) once started with the StartFlow API. Flows bill hourly while ACTIVE, so alchemy never starts a flow implicitly.

const flow = yield* Flow("Broadcast", {
source: {
Name: "primary",
Protocol: "rtp",
WhitelistCidr: "10.24.34.0/23",
IngestPort: 5000,
},
});
const flow = yield* Flow("Distribution", {
source: {
Name: "primary",
Protocol: "rtp",
WhitelistCidr: "10.24.34.0/23",
IngestPort: 5000,
},
outputs: [
{
Name: "affiliate-east",
Protocol: "rtp",
Destination: "198.51.100.11",
Port: 5010,
},
],
});
const flow = yield* Flow("Broadcast", {
source: { Protocol: "rtp", WhitelistCidr: "10.0.0.0/8", IngestPort: 5000 },
tags: { team: "live-video" },
});

Source: src/AWS/MediaConnect/GrantFlowEntitlements.ts

Runtime binding for mediaconnect:GrantFlowEntitlements.

Grants entitlements on the bound Flow so other AWS accounts can subscribe to its content — e.g. a self-service affiliate portal that provisions access for a new subscriber account on demand. Granting more entitlements than the flow allows fails with the typed GrantFlowEntitlements420Exception tag. The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.GrantFlowEntitlementsHttp).

GrantFlowEntitlements: Managing Entitlements

Section titled “GrantFlowEntitlements: Managing Entitlements”
// init — bind the operation to the flow
const grantEntitlements = yield* AWS.MediaConnect.GrantFlowEntitlements(flow);
// runtime
const { Entitlements } = yield* grantEntitlements({
Entitlements: [
{ Name: "affiliate-west", Subscribers: ["111122223333"] },
],
});

Source: src/AWS/MediaConnect/ListEntitlements.ts

Runtime binding for mediaconnect:ListEntitlements.

Enumerates the entitlements that have been granted TO this account (the subscriber side of content sharing) — e.g. to discover new entitlement ARNs a distributor has shared so a flow source can be provisioned from them. One page per call — pass NextToken from the previous response to continue. Account-level: the deploy-time grant is mediaconnect:ListEntitlements on *. Provide the implementation with Effect.provide(AWS.MediaConnect.ListEntitlementsHttp).

// init — bind the account-level operation
const listEntitlements = yield* AWS.MediaConnect.ListEntitlements();
// runtime
const { Entitlements } = yield* listEntitlements();

Source: src/AWS/MediaConnect/ListFlows.ts

Runtime binding for mediaconnect:ListFlows.

Enumerates the account’s MediaConnect flows (one page per call — pass NextToken from the previous response to continue). Account-level: the deploy-time grant is mediaconnect:ListFlows on *. Provide the implementation with Effect.provide(AWS.MediaConnect.ListFlowsHttp).

// init — bind the account-level operation
const listFlows = yield* AWS.MediaConnect.ListFlows();
// runtime
const { Flows } = yield* listFlows({ MaxResults: 20 });
const active = (Flows ?? []).filter((f) => f.Status === "ACTIVE");

Source: src/AWS/MediaConnect/RevokeFlowEntitlement.ts

Runtime binding for mediaconnect:RevokeFlowEntitlement.

Revokes an entitlement previously granted on the bound Flow — the content immediately becomes unavailable to the subscriber and the associated output is removed from the flow. The flow ARN is injected from the binding; the entitlement to revoke is passed at runtime. Because the IAM resource types for this action are the flow AND the entitlement (a sibling ARN, not derived from the flow ARN), the deploy-time grant covers the flow ARN plus the entitlement wildcard. Provide the implementation with Effect.provide(AWS.MediaConnect.RevokeFlowEntitlementHttp).

RevokeFlowEntitlement: Managing Entitlements

Section titled “RevokeFlowEntitlement: Managing Entitlements”
// init — bind the operation to the flow
const revokeEntitlement = yield* AWS.MediaConnect.RevokeFlowEntitlement(flow);
// runtime
yield* revokeEntitlement({ EntitlementArn: entitlementArn });

Source: src/AWS/MediaConnect/StartFlow.ts

Runtime binding for mediaconnect:StartFlow.

Starts the bound Flow, transitioning it from STANDBY through STARTING to ACTIVE. An ACTIVE flow ingests and egresses media and bills hourly — pair with StopFlow to control transport cost (e.g. a scheduler Lambda that runs the flow only during broadcast windows). The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.StartFlowHttp).

// init — bind the operation to the flow
const startFlow = yield* AWS.MediaConnect.StartFlow(flow);
// runtime
const { Status } = yield* startFlow();

Source: src/AWS/MediaConnect/StopFlow.ts

Runtime binding for mediaconnect:StopFlow.

Stops the bound Flow, transitioning it from ACTIVE through STOPPING back to STANDBY (where it no longer bills for transport). Stopping a flow that is not running fails with the typed BadRequestException tag. The flow ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.MediaConnect.StopFlowHttp).

// init — bind the operation to the flow
const stopFlow = yield* AWS.MediaConnect.StopFlow(flow);
// runtime — a flow that is already in STANDBY answers with the typed
// BadRequestException tag
yield* stopFlow().pipe(
Effect.catchTag("BadRequestException", () => Effect.void),
);