class Channel (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.MediaPackageV2.Alpha.Channel |
Go | github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2#Channel |
Java | software.amazon.awscdk.services.mediapackagev2.alpha.Channel |
Python | aws_cdk.aws_mediapackagev2_alpha.Channel |
TypeScript (source) | @aws-cdk/aws-mediapackagev2-alpha ยป Channel |
Implements
IConstruct, IDependable, IResource, IEnvironment, IChannel, IChannel
Defines an AWS Elemental MediaPackage V2 Channel.
Example
declare const stack: Stack;
const group = new ChannelGroup(stack, 'MyChannelGroup', {
channelGroupName: 'my-test-channel-group',
});
const channel = new Channel(stack, 'MyChannel', {
channelGroup: group,
channelName: 'my-testchannel',
input: InputConfiguration.cmaf(),
});
const endpoint = new OriginEndpoint(stack, 'MyOriginEndpoint', {
channel,
originEndpointName: 'my-test-endpoint',
segment: Segment.cmaf(),
manifests: [Manifest.hls({
manifestName: 'index',
})],
});
Initializer
new Channel(scope: Construct, id: string, props: ChannelProps)
Parameters
- scope
Construct - id
string - props
ChannelProps
Construct Props
| Name | Type | Description |
|---|---|---|
| channel | IChannel | Channel Group to add this Channel to. |
| channel | string | The name that describes the channel. |
| description? | string | Enter any descriptive text that helps you to identify the channel. |
| input? | Input | Input configuration for the channel. |
| removal | Removal | Policy to apply when the channel is removed from the stack. |
| tags? | { [string]: string } | Tags to add to the Channel. |
channelGroup
Type:
IChannel
Channel Group to add this Channel to.
channelName?
Type:
string
(optional, default: autogenerated)
The name that describes the channel.
The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
description?
Type:
string
(optional, default: no description)
Enter any descriptive text that helps you to identify the channel.
input?
Type:
Input
(optional, default: InputConfiguration.cmaf())
Input configuration for the channel.
Use InputConfiguration.hls() or InputConfiguration.cmaf() to create the configuration.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.DESTROY)
Policy to apply when the channel is removed from the stack.
Even though MediaPackage ChannelGroups, Channels and OriginEndpoints are technically stateful,
their contents are transient and it is common to add and remove these while rearchitecting your application.
The default is therefore DESTROY. Change it to RETAIN if the content (in a lookback window) are so
valuable that accidentally losing it would be unacceptable.
tags?
Type:
{ [string]: string }
(optional, default: No tagging)
Tags to add to the Channel.
Properties
| Name | Type | Description |
|---|---|---|
| auto | boolean | Indicates if a channel resource policy should automatically created upon the first call to addToResourcePolicy. |
| channel | string | The Amazon Resource Name (ARN) associated with the resource. |
| channel | string | The name that describes the channel group. |
| channel | string | The name that describes the channel. |
| channel | Channel | A reference to this Channel resource. |
| env | Resource | The environment this resource belongs to. |
| grants | Channel | Collection of grant methods for this channel. |
| ingest | string[] | The list of ingest endpoints. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| channel | IChannel | The channel group this channel belongs to. |
| created | string | The date and time the channel was created. |
| modified | string | The date and time the channel was modified. |
| policy? | Channel | The resource policy associated with this channel. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
autoCreatePolicy
Type:
boolean
Indicates if a channel resource policy should automatically created upon the first call to addToResourcePolicy.
channelArn
Type:
string
The Amazon Resource Name (ARN) associated with the resource.
channelGroupName
Type:
string
The name that describes the channel group.
The name is the primary identifier for the channel group.
channelName
Type:
string
The name that describes the channel.
The name is the primary identifier for the channel.
channelRef
Type:
Channel
A reference to this Channel resource.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
grants
Type:
Channel
Collection of grant methods for this channel.
ingestEndpointUrls
Type:
string[]
The list of ingest endpoints.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
channelGroup?
Type:
IChannel
(optional)
The channel group this channel belongs to.
Only available when the channel was created in the same stack. Undefined for imported channels.
createdAt?
Type:
string
(optional)
The date and time the channel was created.
modifiedAt?
Type:
string
(optional)
The date and time the channel was modified.
policy?
Type:
Channel
(optional)
The resource policy associated with this channel.
If autoCreatePolicy is true, a ChannelPolicy will be created upon the
first call to addToResourcePolicy(s).
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add Origin Endpoint for this Channel. |
| add | Configure channel policy. |
| apply | Apply the given removal policy to this resource. |
| metric(metricName, options?) | Create a CloudWatch metric. |
| metric | Returns Metric for Egress Bytes. |
| metric | Returns Metric for Egress Request Count. |
| metric | Returns Metric for Egress Response time. |
| metric | Returns Metric for Ingress Bytes. |
| metric | Returns Metric for Ingress Request Count. |
| metric | Returns Metric for Ingress response time. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from | Creates a Channel construct that represents an external (imported) Channel. |
addOriginEndpoint(id, options)
public addOriginEndpoint(id: string, options: OriginEndpointOptions): OriginEndpoint
Parameters
- id
string - options
OriginEndpoint Options
Returns
Add Origin Endpoint for this Channel.
addToResourcePolicy(statement)
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
Parameters
- statement
PolicyStatement
Returns
Configure channel policy.
You can only add 1 ChannelPolicy to a Channel. If you have already defined one, function will append the policy already created.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
metric(metricName, options?)
public metric(metricName: string, options?: MetricOptions): Metric
Parameters
- metricName
stringโ name of the metric. - options
Metricโ metric options.Options
Returns
Create a CloudWatch metric.
metricEgressBytes(options?)
public metricEgressBytes(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Egress Bytes.
metricEgressRequestCount(options?)
public metricEgressRequestCount(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Egress Request Count.
metricEgressResponseTime(options?)
public metricEgressResponseTime(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Egress Response time.
metricIngressBytes(options?)
public metricIngressBytes(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Ingress Bytes.
metricIngressRequestCount(options?)
public metricIngressRequestCount(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Ingress Request Count.
metricIngressResponseTime(options?)
public metricIngressResponseTime(options?: MetricOptions): Metric
Parameters
- options
MetricOptions
Returns
Returns Metric for Ingress response time.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromChannelAttributes(scope, id, attrs)
public static fromChannelAttributes(scope: Construct, id: string, attrs: ChannelAttributes): IChannel
Parameters
- scope
Construct - id
string - attrs
ChannelAttributes
Returns
Creates a Channel construct that represents an external (imported) Channel.

.NET
Go
Java
Python
TypeScript (