Skip to content
v2.278.0

Experimental

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

MediaPackageV2Origin Class ​

A CloudFront Origin for AWS Elemental MediaPackage V2 endpoints.

Automatically creates an OAC and wires the origin endpoint policy to grant the CloudFront distribution access.

Uses addToResourcePolicy() on the origin endpoint, which is compatible with other policy statements added to the same endpoint. Do not use this alongside a manually created OriginEndpointPolicy construct for the same endpoint.

Example ​

ts
   declare const endpoint: OriginEndpoint;
   declare const group: ChannelGroup;

   new cloudfront.Distribution(this, 'Dist', {
     defaultBehavior: {
       origin: new MediaPackageV2Origin(endpoint, {
         channelGroup: group,
       }),
     },
   });
python
# endpoint: OriginEndpoint
# group: ChannelGroup


cloudfront.Distribution(self, "Dist",
    default_behavior=cloudfront.BehaviorOptions(
        origin=MediaPackageV2Origin(endpoint,
            channel_group=group
        )
    )
)
java
OriginEndpoint endpoint;
ChannelGroup group;


Distribution.Builder.create(this, "Dist")
        .defaultBehavior(BehaviorOptions.builder()
                .origin(MediaPackageV2Origin.Builder.create(endpoint)
                        .channelGroup(group)
                        .build())
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
OriginEndpoint endpoint;
ChannelGroup group;


new Distribution(this, "Dist", new DistributionProps {
    DefaultBehavior = new BehaviorOptions {
        Origin = new MediaPackageV2Origin(endpoint, new MediaPackageV2OriginProps {
            ChannelGroup = group
        })
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var endpoint OriginEndpoint
var group ChannelGroup


cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: awsmediapackagev2alpha.NewMediaPackageV2Origin(endpoint, &MediaPackageV2OriginProps{
			ChannelGroup: group,
		}),
	},
})

Initializer ​

ts
new MediaPackageV2Origin(endpoint: IOriginEndpoint, props: MediaPackageV2OriginProps)
python
MediaPackageV2Origin(endpoint: IOriginEndpoint, props: MediaPackageV2OriginProps)
java
new MediaPackageV2Origin(IOriginEndpoint endpoint, MediaPackageV2OriginProps props)
csharp
new MediaPackageV2Origin(IOriginEndpoint endpoint, MediaPackageV2OriginProps props)
go
NewMediaPackageV2Origin(Endpoint IOriginEndpoint, Props MediaPackageV2OriginProps)

Methods ​

bind(scope: Construct, options: OriginBindOptions): OriginBindConfigdef bind(self, scope: Construct, options: OriginBindOptions) -> OriginBindConfigpublic OriginBindConfig bind(Construct scope, OriginBindOptions options)public OriginBindConfig Bind(Construct scope, OriginBindOptions options)func Bind(Scope Construct, Options OriginBindOptions) OriginBindConfig #
Binds the origin to the associated Distribution.

Can be used to grant permissions, create dependent resources, etc.