Skip to content
v2.277.0

Experimental

@aws-cdk/aws-mediapackagev2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Channel L2 construct ​

Defines an AWS Elemental MediaPackage V2 Channel.

Example ​

ts
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',
    })],
});
python
# stack: Stack

group = ChannelGroup(stack, "MyChannelGroup",
    channel_group_name="my-test-channel-group"
)

channel = Channel(stack, "MyChannel",
    channel_group=group,
    channel_name="my-testchannel",
    input=InputConfiguration.cmaf()
)

endpoint = OriginEndpoint(stack, "MyOriginEndpoint",
    channel=channel,
    origin_endpoint_name="my-test-endpoint",
    segment=Segment.cmaf(),
    manifests=[Manifest.hls(
        manifest_name="index"
    )]
)
java
Stack stack;

ChannelGroup group = ChannelGroup.Builder.create(stack, "MyChannelGroup")
        .channelGroupName("my-test-channel-group")
        .build();

Channel channel = Channel.Builder.create(stack, "MyChannel")
        .channelGroup(group)
        .channelName("my-testchannel")
        .input(InputConfiguration.cmaf())
        .build();

OriginEndpoint endpoint = OriginEndpoint.Builder.create(stack, "MyOriginEndpoint")
        .channel(channel)
        .originEndpointName("my-test-endpoint")
        .segment(Segment.cmaf())
        .manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder()
                .manifestName("index")
                .build())))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Stack stack;

var group = new ChannelGroup(stack, "MyChannelGroup", new ChannelGroupProps {
    ChannelGroupName = "my-test-channel-group"
});

var channel = new Channel(stack, "MyChannel", new ChannelProps {
    ChannelGroup = group,
    ChannelName = "my-testchannel",
    Input = InputConfiguration.Cmaf()
});

var endpoint = new OriginEndpoint(stack, "MyOriginEndpoint", new OriginEndpointProps {
    Channel = channel,
    OriginEndpointName = "my-test-endpoint",
    Segment = Segment.Cmaf(),
    Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration {
        ManifestName = "index"
    }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var stack Stack

group := awsmediapackagev2alpha.NewChannelGroup(stack, jsii.String("MyChannelGroup"), &ChannelGroupProps{
	ChannelGroupName: jsii.String("my-test-channel-group"),
})

channel := awsmediapackagev2alpha.NewChannel(stack, jsii.String("MyChannel"), &ChannelProps{
	ChannelGroup: group,
	ChannelName: jsii.String("my-testchannel"),
	Input: awsmediapackagev2alpha.InputConfiguration_Cmaf(),
})

endpoint := awsmediapackagev2alpha.NewOriginEndpoint(stack, jsii.String("MyOriginEndpoint"), &OriginEndpointProps{
	Channel: Channel,
	OriginEndpointName: jsii.String("my-test-endpoint"),
	Segment: awsmediapackagev2alpha.Segment_Cmaf(),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})

Initializer ​

ts
new Channel(scope: Construct, id: string, props: ChannelProps)
python
Channel(scope: Construct, id: str, props: ChannelProps)
java
new Channel(Construct scope, String id, ChannelProps props)
csharp
new Channel(Construct scope, string id, ChannelProps props)
go
NewChannel(Scope Construct, Id *string, Props ChannelProps)

Construct Props ​

channelGroupIChannelGroupchannel_groupIChannelGroupchannelGroupIChannelGroupChannelGroupIChannelGroupChannelGroupIChannelGrouprequired#
Channel Group to add this Channel to.
channelNameoptionalstringchannel_nameoptionalstrchannelNameoptionalStringChannelNameoptionalstringChannelNameoptional*string= 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.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
Enter any descriptive text that helps you to identify the channel.

Default: no description

inputoptionalInputConfigurationinputoptionalInputConfigurationinputoptionalInputConfigurationInputoptionalInputConfigurationInputoptionalInputConfiguration= InputConfiguration.cmaf()#
Input configuration for the channel.

Use InputConfiguration.hls() or InputConfiguration.cmaf() to create the configuration.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#
Policy to apply when the channel is removed from the stack.
notes

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.

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#
Tags to add to the Channel.

Default: No tagging

Properties ​

channelArnstringchannel_arnstrchannelArnStringChannelArnstringChannelArn*string#
The Amazon Resource Name (ARN) associated with the resource.
channelGroupmay be undefinedIChannelGroupchannel_groupmay be undefinedIChannelGroupchannelGroupmay be undefinedIChannelGroupChannelGroupmay be undefinedIChannelGroupChannelGroupmay be undefinedIChannelGroup#
The channel group this channel belongs to.

Only available when the channel was created in the same stack. Undefined for imported channels.

channelGroupNamestringchannel_group_namestrchannelGroupNameStringChannelGroupNamestringChannelGroupName*string#
The name that describes the channel group.

The name is the primary identifier for the channel group.

channelNamestringchannel_namestrchannelNameStringChannelNamestringChannelName*string#
The name that describes the channel.

The name is the primary identifier for the channel.

A reference to this Channel resource.
createdAtmay be undefinedstringcreated_atmay be undefinedstrcreatedAtmay be undefinedStringCreatedAtmay be undefinedstringCreatedAtmay be undefined*string#
The date and time the channel was created.
The environment this resource belongs to.
notes

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.

Collection of grant methods for this channel.
ingestEndpointUrlsstring[]ingest_endpoint_urlstyping.List[str]ingestEndpointUrlsList<String>IngestEndpointUrlsstring[]IngestEndpointUrls*[]*string#
The list of ingest endpoints.
modifiedAtmay be undefinedstringmodified_atmay be undefinedstrmodifiedAtmay be undefinedStringModifiedAtmay be undefinedstringModifiedAtmay be undefined*string#
The date and time the channel was modified.
nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
policymay be undefinedChannelPolicypolicymay be undefinedChannelPolicypolicymay be undefinedChannelPolicyPolicymay be undefinedChannelPolicyPolicymay be undefinedChannelPolicy#
The resource policy associated with this channel.

If autoCreatePolicy is true, a ChannelPolicy will be created upon the first call to addToResourcePolicy(s).

PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#
Uniquely identifies this class.
regionstringregionstrregionStringRegionstringRegion*string#
The AWS region where this channel lives.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this resource is defined.

Methods ​

addOriginEndpoint(id: string, options: OriginEndpointOptions): OriginEndpointdef add_origin_endpoint(self, id: str, options: OriginEndpointOptions) -> OriginEndpointpublic OriginEndpoint addOriginEndpoint(String id, OriginEndpointOptions options)public OriginEndpoint AddOriginEndpoint(string id, OriginEndpointOptions options)func AddOriginEndpoint(Id *string, Options OriginEndpointOptions) OriginEndpoint#
Add Origin Endpoint for this Channel.
addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)func AddToResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#
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.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

fromChannelArn(scope: Construct, id: string, channelArn: string): IChannel@staticmethod def from_channel_arn(scope: Construct, id: str, channel_arn: str) -> IChannelpublic static IChannel fromChannelArn(Construct scope, String id, String channelArn)public static IChannel FromChannelArn(Construct scope, string id, string channelArn)func FromChannelArn(Scope Construct, Id *string, ChannelArn *string) IChannelstatic#
Creates a Channel construct that represents an external (imported) Channel from its ARN.

The ARN is expected to be in the format: arn:<partition>:mediapackagev2:<region>:<account>:channelGroup/<groupName>/channel/<channelName>

fromChannelAttributes(scope: Construct, id: string, attrs: ChannelAttributes): IChannel@staticmethod def from_channel_attributes(scope: Construct, id: str, attrs: ChannelAttributes) -> IChannelpublic static IChannel fromChannelAttributes(Construct scope, String id, ChannelAttributes attrs)public static IChannel FromChannelAttributes(Construct scope, string id, ChannelAttributes attrs)func FromChannelAttributes(Scope Construct, Id *string, Attrs ChannelAttributes) IChannelstatic#
Creates a Channel construct that represents an external (imported) Channel.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, options?: MetricOptions): Metricdef metric(self, metric_name: str, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions options)public Metric Metric(string metricName, MetricOptions? options = null)func Metric(MetricName *string, Options MetricOptions) Metric#
Create a CloudWatch metric.
2 parameters

Parameters

  • metricNamemetric_namemetricNamemetricNameMetricName — name of the metric.
  • optionsoptionsoptionsoptionsOptions — metric options.
metricEgressBytes(options?: MetricOptions): Metricdef metric_egress_bytes(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressBytes(MetricOptions options)public Metric MetricEgressBytes(MetricOptions? options = null)func MetricEgressBytes(Options MetricOptions) Metric#
Returns Metric for Egress Bytes.
metricEgressRequestCount(options?: MetricOptions): Metricdef metric_egress_request_count(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressRequestCount(MetricOptions options)public Metric MetricEgressRequestCount(MetricOptions? options = null)func MetricEgressRequestCount(Options MetricOptions) Metric#
Returns Metric for Egress Request Count.
metricEgressResponseTime(options?: MetricOptions): Metricdef metric_egress_response_time(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressResponseTime(MetricOptions options)public Metric MetricEgressResponseTime(MetricOptions? options = null)func MetricEgressResponseTime(Options MetricOptions) Metric#
Returns Metric for Egress Response time.
metricIngressBytes(options?: MetricOptions): Metricdef metric_ingress_bytes(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressBytes(MetricOptions options)public Metric MetricIngressBytes(MetricOptions? options = null)func MetricIngressBytes(Options MetricOptions) Metric#
Returns Metric for Ingress Bytes.
metricIngressRequestCount(options?: MetricOptions): Metricdef metric_ingress_request_count(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressRequestCount(MetricOptions options)public Metric MetricIngressRequestCount(MetricOptions? options = null)func MetricIngressRequestCount(Options MetricOptions) Metric#
Returns Metric for Ingress Request Count.
metricIngressResponseTime(options?: MetricOptions): Metricdef metric_ingress_response_time(self, options: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressResponseTime(MetricOptions options)public Metric MetricIngressResponseTime(MetricOptions? options = null)func MetricIngressResponseTime(Options MetricOptions) Metric#
Returns Metric for Ingress response time.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
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.