Skip to content
GitHubXDiscordRSS

Channel

Learn how to create, update, and manage AWS MediaPackage Channels using Alchemy Cloud Control.

The Channel resource lets you manage AWS MediaPackage Channels for delivering video content over the internet.

Create a basic MediaPackage Channel with required properties and a description.

import AWS from "alchemy/aws/control";
const mediaPackageChannel = await AWS.MediaPackage.Channel("myChannel", {
Id: "my-channel-id",
Description: "This channel is for delivering live sports events.",
HlsIngest: {
IngestEndpoints: [{
Id: "my-ingest-endpoint-id",
Url: "https://my-ingest-endpoint.example.com"
}]
}
});

Configure a channel with ingress and egress access logs for monitoring and analysis.

const mediaPackageChannelWithLogs = await AWS.MediaPackage.Channel("myChannelWithLogs", {
Id: "my-channel-logs-id",
Description: "This channel includes logging for better monitoring.",
HlsIngest: {
IngestEndpoints: [{
Id: "my-ingest-endpoint-id",
Url: "https://my-ingest-endpoint.example.com"
}]
},
IngressAccessLogs: {
LogGroupName: "my-ingress-log-group",
LogRoleArn: "arn:aws:iam::123456789012:role/my-log-role"
},
EgressAccessLogs: {
LogGroupName: "my-egress-log-group",
LogRoleArn: "arn:aws:iam::123456789012:role/my-log-role"
},
Tags: [{
Key: "Environment",
Value: "Production"
}]
});

If you need to adopt an existing MediaPackage Channel instead of creating a new one, you can set the adopt property to true.

const adoptedChannel = await AWS.MediaPackage.Channel("existingChannel", {
Id: "existing-channel-id",
adopt: true
});