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.

OriginEndpoint L2 construct ​

Defines an AWS Elemental MediaPackage V2 Origin Endpoint.

Example ​

ts
declare const channel: Channel;
declare const spekeRole: iam.IRole;

new OriginEndpoint(this, 'TsEndpoint', {
  channel,
  segment: Segment.ts({
    encryption: TsEncryption.speke({
      method: TsEncryptionMethod.SAMPLE_AES,
      resourceId: 'my-content-id',
      url: 'https://example.com/speke',
      role: spekeRole,
    }),
  }),
  manifests: [Manifest.hls({ manifestName: 'index' })],
});
python
# channel: Channel
# speke_role: iam.IRole


OriginEndpoint(self, "TsEndpoint",
    channel=channel,
    segment=Segment.ts(
        encryption=TsEncryption.speke(
            method=TsEncryptionMethod.SAMPLE_AES,
            resource_id="my-content-id",
            url="https://example.com/speke",
            role=speke_role
        )
    ),
    manifests=[Manifest.hls(manifest_name="index")]
)
java
Channel channel;
IRole spekeRole;


OriginEndpoint.Builder.create(this, "TsEndpoint")
        .channel(channel)
        .segment(Segment.ts(TsSegmentProps.builder()
                .encryption(TsEncryption.speke(TsSpekeEncryptionProps.builder()
                        .method(TsEncryptionMethod.SAMPLE_AES)
                        .resourceId("my-content-id")
                        .url("https://example.com/speke")
                        .role(spekeRole)
                        .build()))
                .build()))
        .manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Channel channel;
IRole spekeRole;


new OriginEndpoint(this, "TsEndpoint", new OriginEndpointProps {
    Channel = channel,
    Segment = Segment.Ts(new TsSegmentProps {
        Encryption = TsEncryption.Speke(new TsSpekeEncryptionProps {
            Method = TsEncryptionMethod.SAMPLE_AES,
            ResourceId = "my-content-id",
            Url = "https://example.com/speke",
            Role = spekeRole
        })
    }),
    Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var channel Channel
var spekeRole IRole


awsmediapackagev2alpha.NewOriginEndpoint(this, jsii.String("TsEndpoint"), &OriginEndpointProps{
	Channel: Channel,
	Segment: awsmediapackagev2alpha.Segment_Ts(&TsSegmentProps{
		Encryption: awsmediapackagev2alpha.TsEncryption_Speke(&TsSpekeEncryptionProps{
			Method: awsmediapackagev2alpha.TsEncryptionMethod_SAMPLE_AES,
			ResourceId: jsii.String("my-content-id"),
			Url: jsii.String("https://example.com/speke"),
			Role: spekeRole,
		}),
	}),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})

Initializer ​

ts
new OriginEndpoint(scope: Construct, id: string, props: OriginEndpointProps)
python
OriginEndpoint(scope: Construct, id: str, props: OriginEndpointProps)
java
new OriginEndpoint(Construct scope, String id, OriginEndpointProps props)
csharp
new OriginEndpoint(Construct scope, string id, OriginEndpointProps props)
go
NewOriginEndpoint(Scope Construct, Id *string, Props OriginEndpointProps)

Construct Props ​

cdnAuthoptionalCdnAuthConfigurationcdn_authoptionalCdnAuthConfigurationcdnAuthoptionalCdnAuthConfigurationCdnAuthoptionalCdnAuthConfigurationCdnAuthoptionalCdnAuthConfiguration#
Provide access to MediaPackage V2 Origin Endpoint via secret header.

Default: undefined - Not configured on endpoint

notes

Use this when your CDN doesn't support AWS Signature Version 4 (SigV4) authentication. For SigV4-based access with Amazon CloudFront, see MediaPackageV2Origin.

Setting cdnAuth auto-creates the following policy on the OriginEndpoint:

json
{
  "Version":"2012-10-17",
  "Statement": [
    {
      "Sid": "AllowGetObjectAccessForAuthorizedRequest",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "mediapackagev2:GetObject",
      "Resource": "arn:aws:mediapackagev2:us-east-1:111122223333:channelGroup/channelGroupName/channel/channelName/originEndpoint/originEndpointName",
      "Condition": {
        "Bool": {
          "mediapackagev2:RequestHasMatchingCdnAuthHeader": "true"
        }
      }
    }
  ]
}
channelIChannelchannelIChannelchannelIChannelChannelIChannelChannelIChannelrequired#
The channel associated with the origin endpoint.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description associated with the origin endpoint.

Default: undefined - No description is added to Origin Endpoint

forceEndpointConfigurationConditionsoptionalEndpointErrorConfiguration[]force_endpoint_configuration_conditionsoptionaltyping.List[EndpointErrorConfiguration]forceEndpointConfigurationConditionsoptionalList<EndpointErrorConfiguration>ForceEndpointConfigurationConditionsoptionalEndpointErrorConfiguration[]ForceEndpointConfigurationConditionsoptional*[]EndpointErrorConfiguration#
The failover settings for the endpoint.

Default: undefined - No force endpoint configuration is configured

manifestsManifest[]manifeststyping.List[Manifest]manifestsList<Manifest>ManifestsManifest[]Manifests*[]Manifestrequired#
Manifests configuration for HLS, Low Latency HLS and DASH.
originEndpointNameoptionalstringorigin_endpoint_nameoptionalstroriginEndpointNameoptionalStringOriginEndpointNameoptionalstringOriginEndpointNameoptional*string= autogenerated#
The name of the origin endpoint associated with the origin endpoint configuration.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#
Policy to apply when the origin endpoint 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.

The segment associated with the origin endpoint.

Inside the segment configuration you can define options such as encryption, SPEKE parameters and other general segment configurations.

Use Segment.ts() or Segment.cmaf() to create the configuration.

startoverWindowoptionalDurationstartover_windowoptionalDurationstartoverWindowoptionalDurationStartoverWindowoptionalDurationStartoverWindowoptionalDuration= 900#
The size of the window to specify a window of the live stream that's available for on-demand viewing.

Viewers can start-over or catch-up on content that falls within the window.

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#
The tags associated with the origin endpoint.

Default: No tagging

Properties ​

channelGroupNamestringchannel_group_namestrchannelGroupNameStringChannelGroupNamestringChannelGroupName*string#
The name of the channel group associated with the origin endpoint configuration.
channelNamestringchannel_namestrchannelNameStringChannelNamestringChannelName*string#
The channel name associated with the origin endpoint.
createdAtmay be undefinedstringcreated_atmay be undefinedstrcreatedAtmay be undefinedStringCreatedAtmay be undefinedstringCreatedAtmay be undefined*string#
The timestamp of the creation of the origin endpoint.
dashManifestUrlsmay be undefinedstring[]dash_manifest_urlsmay be undefinedtyping.List[str]dashManifestUrlsmay be undefinedList<String>DashManifestUrlsmay be undefinedstring[]DashManifestUrlsmay be undefined*[]*string#
Array containing DASH Manifests created by the OriginEndpoint.
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.

hlsManifestUrlsmay be undefinedstring[]hls_manifest_urlsmay be undefinedtyping.List[str]hlsManifestUrlsmay be undefinedList<String>HlsManifestUrlsmay be undefinedstring[]HlsManifestUrlsmay be undefined*[]*string#
Array containing HLS Manifests created by the OriginEndpoint.
lowLatencyHlsManifestUrlsmay be undefinedstring[]low_latency_hls_manifest_urlsmay be undefinedtyping.List[str]lowLatencyHlsManifestUrlsmay be undefinedList<String>LowLatencyHlsManifestUrlsmay be undefinedstring[]LowLatencyHlsManifestUrlsmay be undefined*[]*string#
Array containing Low Latency HLS Manifests created by the OriginEndpoint.
modifiedAtmay be undefinedstringmodified_atmay be undefinedstrmodifiedAtmay be undefinedStringModifiedAtmay be undefinedstringModifiedAtmay be undefined*string#
The timestamp of the modification of the origin endpoint.
mssManifestUrlsmay be undefinedstring[]mss_manifest_urlsmay be undefinedtyping.List[str]mssManifestUrlsmay be undefinedList<String>MssManifestUrlsmay be undefinedstring[]MssManifestUrlsmay be undefined*[]*string#
Array containing MSS Manifests created by the OriginEndpoint.
nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
originEndpointArnstringorigin_endpoint_arnstroriginEndpointArnStringOriginEndpointArnstringOriginEndpointArn*string#
The Amazon Resource Name (ARN) of the origin endpoint.
originEndpointNamestringorigin_endpoint_namestroriginEndpointNameStringOriginEndpointNamestringOriginEndpointName*string#
The name of the origin endpoint associated with the origin endpoint configuration.
originEndpointRefOriginEndpointReferenceorigin_endpoint_refOriginEndpointReferenceoriginEndpointRefOriginEndpointReferenceOriginEndpointRefOriginEndpointReferenceOriginEndpointRefOriginEndpointReference#
A reference to this Origin Endpoint resource.

Required by the auto-generated IOriginEndpointRef interface.

policymay be undefinedOriginEndpointPolicypolicymay be undefinedOriginEndpointPolicypolicymay be undefinedOriginEndpointPolicyPolicymay be undefinedOriginEndpointPolicyPolicymay be undefinedOriginEndpointPolicy#
The resource policy associated with this origin endpoint.

If autoCreatePolicy is true, an OriginEndpointPolicy 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.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this resource is defined.

Methods ​

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 origin endpoint policy.

You can only add 1 OriginEndpointPolicy to an OriginEndpoint. If you have already defined one, this will append to the policy already created.

To configure CDN authentication, set cdnAuth on the construct's props instead.

1 parameter

Parameters

  • statementstatementstatementstatementStatement — - The policy statement to add.
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).

fromOriginEndpointArn(scope: Construct, id: string, originEndpointArn: string): IOriginEndpoint@staticmethod def from_origin_endpoint_arn(scope: Construct, id: str, origin_endpoint_arn: str) -> IOriginEndpointpublic static IOriginEndpoint fromOriginEndpointArn(Construct scope, String id, String originEndpointArn)public static IOriginEndpoint FromOriginEndpointArn(Construct scope, string id, string originEndpointArn)func FromOriginEndpointArn(Scope Construct, Id *string, OriginEndpointArn *string) IOriginEndpointstatic#
Creates an OriginEndpoint construct that represents an external (imported) Origin Endpoint from its ARN.

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

fromOriginEndpointAttributes(scope: Construct, id: string, attrs: OriginEndpointAttributes): IOriginEndpoint@staticmethod def from_origin_endpoint_attributes(scope: Construct, id: str, attrs: OriginEndpointAttributes) -> IOriginEndpointpublic static IOriginEndpoint fromOriginEndpointAttributes(Construct scope, String id, OriginEndpointAttributes attrs)public static IOriginEndpoint FromOriginEndpointAttributes(Construct scope, string id, OriginEndpointAttributes attrs)func FromOriginEndpointAttributes(Scope Construct, Id *string, Attrs OriginEndpointAttributes) IOriginEndpointstatic#
Creates an OriginEndpoint construct that represents an external (imported) Origin Endpoint.
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.