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
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',
})],
});
# 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"
)]
)
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();
// 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"
}) }
});
// 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
new Channel(scope: Construct, id: string, props: ChannelProps)
Channel(scope: Construct, id: str, props: ChannelProps)
new Channel(Construct scope, String id, ChannelProps props)
new Channel(Construct scope, string id, ChannelProps props)
NewChannel(Scope Construct, Id *string, Props ChannelProps)
Construct Props
channelGroupIChannelGroupchannel_groupIChannelGroupchannelGroupIChannelGroupChannelGroupIChannelGroupChannelGroupIChannelGrouprequired#channelNameoptionalstringchannel_nameoptionalstrchannelNameoptionalStringChannelNameoptionalstringChannelNameoptional*string= autogenerated#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#Default: no description
inputoptionalInputConfigurationinputoptionalInputConfigurationinputoptionalInputConfigurationInputoptionalInputConfigurationInputoptionalInputConfiguration= InputConfiguration.cmaf()#Use InputConfiguration.hls() or InputConfiguration.cmaf() to create the configuration.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#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#Default: No tagging
Properties
channelGroupmay be undefinedIChannelGroupchannel_groupmay be undefinedIChannelGroupchannelGroupmay be undefinedIChannelGroupChannelGroupmay be undefinedIChannelGroupChannelGroupmay be undefinedIChannelGroup#Only available when the channel was created in the same stack. Undefined for imported channels.
channelGroupNamestringchannel_group_namestrchannelGroupNameStringChannelGroupNamestringChannelGroupName*string#The name is the primary identifier for the channel group.
The name is the primary identifier for the channel.
channelRefChannelReferencechannel_refChannelReferencechannelRefChannelReferenceChannelRefChannelReferenceChannelRefChannelReference#createdAtmay be undefinedstringcreated_atmay be undefinedstrcreatedAtmay be undefinedStringCreatedAtmay be undefinedstringCreatedAtmay be undefined*string#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironment#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.
ingestEndpointUrlsstring[]ingest_endpoint_urlstyping.List[str]ingestEndpointUrlsList<String>IngestEndpointUrlsstring[]IngestEndpointUrls*[]*string#modifiedAtmay be undefinedstringmodified_atmay be undefinedstrmodifiedAtmay be undefinedStringModifiedAtmay be undefinedstringModifiedAtmay be undefined*string#policymay be undefinedChannelPolicypolicymay be undefinedChannelPolicypolicymay be undefinedChannelPolicyPolicymay be undefinedChannelPolicyPolicymay be undefinedChannelPolicy#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#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#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#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)#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)#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#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#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#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#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#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#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#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#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#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#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#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#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.