Skip to content
v2.275.0

Experimental

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

ChannelGroup L2 construct ​

Defines an AWS Elemental MediaPackage V2 Channel Group.

Example ​

ts
declare const stack: Stack;

// Create a channel group
const group = new ChannelGroup(stack, 'MyChannelGroup', {
  channelGroupName: 'my-channel-group',
});

// Add a channel using the factory method
const channel = group.addChannel('MyChannel', {
  channelName: 'my-channel',
  input: InputConfiguration.cmaf(),
});

// Add an origin endpoint using the factory method
const endpoint = channel.addOriginEndpoint('MyEndpoint', {
  originEndpointName: 'my-endpoint',
  segment: Segment.cmaf(),
  manifests: [Manifest.hls({ manifestName: 'index' })],
});
python
# stack: Stack


# Create a channel group
group = ChannelGroup(stack, "MyChannelGroup",
    channel_group_name="my-channel-group"
)

# Add a channel using the factory method
channel = group.add_channel("MyChannel",
    channel_name="my-channel",
    input=InputConfiguration.cmaf()
)

# Add an origin endpoint using the factory method
endpoint = channel.add_origin_endpoint("MyEndpoint",
    origin_endpoint_name="my-endpoint",
    segment=Segment.cmaf(),
    manifests=[Manifest.hls(manifest_name="index")]
)
java
Stack stack;


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

// Add a channel using the factory method
Channel channel = group.addChannel("MyChannel", ChannelOptions.builder()
        .channelName("my-channel")
        .input(InputConfiguration.cmaf())
        .build());

// Add an origin endpoint using the factory method
OriginEndpoint endpoint = channel.addOriginEndpoint("MyEndpoint", OriginEndpointOptions.builder()
        .originEndpointName("my-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;


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

// Add a channel using the factory method
var channel = group.AddChannel("MyChannel", new ChannelOptions {
    ChannelName = "my-channel",
    Input = InputConfiguration.Cmaf()
});

// Add an origin endpoint using the factory method
var endpoint = channel.AddOriginEndpoint("MyEndpoint", new OriginEndpointOptions {
    OriginEndpointName = "my-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


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

// Add a channel using the factory method
channel := group.addChannel(jsii.String("MyChannel"), &ChannelOptions{
	ChannelName: jsii.String("my-channel"),
	Input: awsmediapackagev2alpha.InputConfiguration_Cmaf(),
})

// Add an origin endpoint using the factory method
endpoint := channel.addOriginEndpoint(jsii.String("MyEndpoint"), &OriginEndpointOptions{
	OriginEndpointName: jsii.String("my-endpoint"),
	Segment: awsmediapackagev2alpha.Segment_Cmaf(),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})

Initializer ​

ts
new ChannelGroup(scope: Construct, id: string, props?: ChannelGroupProps)
python
ChannelGroup(scope: Construct, id: str, props: typing.Optional[ChannelGroupProps] = None)
java
new ChannelGroup(Construct scope, String id, ChannelGroupProps props)
csharp
new ChannelGroup(Construct scope, string id, ChannelGroupProps? props = null)
go
NewChannelGroup(Scope Construct, Id *string, Props ChannelGroupProps)

Construct Props ​

channelGroupNameoptionalstringchannel_group_nameoptionalstrchannelGroupNameoptionalStringChannelGroupNameoptionalstringChannelGroupNameoptional*string= autogenerated#
The name that describes the channel group.

The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description for your channel group.

Default: no description

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#
Policy to apply when the channel group 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 Group.

Default: No tagging

Properties ​

channelGroupArnstringchannel_group_arnstrchannelGroupArnStringChannelGroupArnstringChannelGroupArn*string#
The Amazon Resource Name (ARN) associated with the resource.
channelGroupNamestringchannel_group_namestrchannelGroupNameStringChannelGroupNamestringChannelGroupName*string#
The name that describes the channel group.

The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.

channelGroupRefChannelGroupReferencechannel_group_refChannelGroupReferencechannelGroupRefChannelGroupReferenceChannelGroupRefChannelGroupReferenceChannelGroupRefChannelGroupReference#
A reference to this Channel Group resource.

Required by the auto-generated IChannelGroupRef interface.

createdAtmay be undefinedstringcreated_atmay be undefinedstrcreatedAtmay be undefinedStringCreatedAtmay be undefinedstringCreatedAtmay be undefined*string#
The date and time the channel group was created.
egressDomainstringegress_domainstregressDomainStringEgressDomainstringEgressDomain*string#
The egress domain where packaged content is available.

Use this as the origin domain when configuring a CDN such as Amazon CloudFront.

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.

modifiedAtmay be undefinedstringmodified_atmay be undefinedstrmodifiedAtmay be undefinedStringModifiedAtmay be undefinedstringModifiedAtmay be undefined*string#
The date and time the channel group was modified.
nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this resource is defined.

Methods ​

addChannel(id: string, options?: ChannelOptions): Channeldef add_channel(self, id: str, options: typing.Optional[ChannelOptions] = None) -> Channelpublic Channel addChannel(String id, ChannelOptions options)public Channel AddChannel(string id, ChannelOptions? options = null)func AddChannel(Id *string, Options ChannelOptions) Channel#
Add Channel for this Channel Group.
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).

fromChannelGroupArn(scope: Construct, id: string, channelGroupArn: string): IChannelGroup@staticmethod def from_channel_group_arn(scope: Construct, id: str, channel_group_arn: str) -> IChannelGrouppublic static IChannelGroup fromChannelGroupArn(Construct scope, String id, String channelGroupArn)public static IChannelGroup FromChannelGroupArn(Construct scope, string id, string channelGroupArn)func FromChannelGroupArn(Scope Construct, Id *string, ChannelGroupArn *string) IChannelGroupstatic#
Creates a Channel Group construct that represents an external (imported) Channel Group from its ARN.
fromChannelGroupAttributes(scope: Construct, id: string, attrs: ChannelGroupAttributes): IChannelGroup@staticmethod def from_channel_group_attributes(scope: Construct, id: str, attrs: ChannelGroupAttributes) -> IChannelGrouppublic static IChannelGroup fromChannelGroupAttributes(Construct scope, String id, ChannelGroupAttributes attrs)public static IChannelGroup FromChannelGroupAttributes(Construct scope, string id, ChannelGroupAttributes attrs)func FromChannelGroupAttributes(Scope Construct, Id *string, Attrs ChannelGroupAttributes) IChannelGroupstatic#
Creates a Channel Group construct that represents an external (imported) Channel Group.
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, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Create a CloudWatch metric.
2 parameters

Parameters

  • metricNamemetric_namemetricNamemetricNameMetricName — name of the metric.
  • propspropspropspropsProps — metric options.
metricEgressBytes(props?: MetricOptions): Metricdef metric_egress_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressBytes(MetricOptions props)public Metric MetricEgressBytes(MetricOptions? props = null)func MetricEgressBytes(Props MetricOptions) Metric#
Returns Metric for Egress Bytes.
metricEgressRequestCount(props?: MetricOptions): Metricdef metric_egress_request_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressRequestCount(MetricOptions props)public Metric MetricEgressRequestCount(MetricOptions? props = null)func MetricEgressRequestCount(Props MetricOptions) Metric#
Returns Metric for Egress Request Count.
metricEgressResponseTime(props?: MetricOptions): Metricdef metric_egress_response_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricEgressResponseTime(MetricOptions props)public Metric MetricEgressResponseTime(MetricOptions? props = null)func MetricEgressResponseTime(Props MetricOptions) Metric#
Returns Metric for Egress Response time.
metricIngressBytes(props?: MetricOptions): Metricdef metric_ingress_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressBytes(MetricOptions props)public Metric MetricIngressBytes(MetricOptions? props = null)func MetricIngressBytes(Props MetricOptions) Metric#
Returns Metric for Ingress Bytes.
metricIngressRequestCount(props?: MetricOptions): Metricdef metric_ingress_request_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressRequestCount(MetricOptions props)public Metric MetricIngressRequestCount(MetricOptions? props = null)func MetricIngressRequestCount(Props MetricOptions) Metric#
Returns Metric for Ingress Request Count.
metricIngressResponseTime(props?: MetricOptions): Metricdef metric_ingress_response_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIngressResponseTime(MetricOptions props)public Metric MetricIngressResponseTime(MetricOptions? props = null)func MetricIngressResponseTime(Props 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.