AWS.MediaConnect reference
DescribeFlow
Section titled “DescribeFlow”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).
DescribeFlow: Observing Flows
Section titled “DescribeFlow: Observing Flows”// init — bind the operation to the flowconst describeFlow = yield* AWS.MediaConnect.DescribeFlow(flow);
// runtimeconst { Flow: current } = yield* describeFlow();const running = current?.Status === "ACTIVE";DescribeFlowSourceMetadata
Section titled “DescribeFlowSourceMetadata”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 flowconst sourceMetadata = yield* AWS.MediaConnect.DescribeFlowSourceMetadata(flow);
// runtimeconst { TransportMediaInfo, Messages } = yield* sourceMetadata();const programs = TransportMediaInfo?.Programs ?? [];DescribeFlowSourceThumbnail
Section titled “DescribeFlowSourceThumbnail”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 flowconst sourceThumbnail = yield* AWS.MediaConnect.DescribeFlowSourceThumbnail(flow);
// runtimeconst { ThumbnailDetails } = yield* sourceThumbnail();const image = ThumbnailDetails?.Thumbnail; // base64-encoded JPEGSource:
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.
Flow: Creating a Flow
Section titled “Flow: Creating a Flow”const flow = yield* Flow("Broadcast", { source: { Name: "primary", Protocol: "rtp", WhitelistCidr: "10.24.34.0/23", IngestPort: 5000, },});Flow: Outputs
Section titled “Flow: Outputs”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, }, ],});Flow: Tags
Section titled “Flow: Tags”const flow = yield* Flow("Broadcast", { source: { Protocol: "rtp", WhitelistCidr: "10.0.0.0/8", IngestPort: 5000 }, tags: { team: "live-video" },});GrantFlowEntitlements
Section titled “GrantFlowEntitlements”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 flowconst grantEntitlements = yield* AWS.MediaConnect.GrantFlowEntitlements(flow);
// runtimeconst { Entitlements } = yield* grantEntitlements({ Entitlements: [ { Name: "affiliate-west", Subscribers: ["111122223333"] }, ],});ListEntitlements
Section titled “ListEntitlements”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).
ListEntitlements: Managing Entitlements
Section titled “ListEntitlements: Managing Entitlements”// init — bind the account-level operationconst listEntitlements = yield* AWS.MediaConnect.ListEntitlements();
// runtimeconst { Entitlements } = yield* listEntitlements();ListFlows
Section titled “ListFlows”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).
ListFlows: Observing Flows
Section titled “ListFlows: Observing Flows”// init — bind the account-level operationconst listFlows = yield* AWS.MediaConnect.ListFlows();
// runtimeconst { Flows } = yield* listFlows({ MaxResults: 20 });const active = (Flows ?? []).filter((f) => f.Status === "ACTIVE");RevokeFlowEntitlement
Section titled “RevokeFlowEntitlement”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 flowconst revokeEntitlement = yield* AWS.MediaConnect.RevokeFlowEntitlement(flow);
// runtimeyield* revokeEntitlement({ EntitlementArn: entitlementArn });StartFlow
Section titled “StartFlow”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).
StartFlow: Controlling Flows
Section titled “StartFlow: Controlling Flows”// init — bind the operation to the flowconst startFlow = yield* AWS.MediaConnect.StartFlow(flow);
// runtimeconst { Status } = yield* startFlow();StopFlow
Section titled “StopFlow”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).
StopFlow: Controlling Flows
Section titled “StopFlow: Controlling Flows”// init — bind the operation to the flowconst stopFlow = yield* AWS.MediaConnect.StopFlow(flow);
// runtime — a flow that is already in STANDBY answers with the typed// BadRequestException tagyield* stopFlow().pipe( Effect.catchTag("BadRequestException", () => Effect.void),);