How to link AWS CloudFront distribution to AWS Elemental MediaPackage from PHP SDK

527 views Asked by At

I want to link CloudFront from MediaPackage, This is possible from AWS Elemental MediaPackage console but I need to do this from my coding I use PHP.

I don't see an option from CreateChannel function to quick enable as it was on console.

enter image description here enter image description here

https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-mediapackage-2017-10-12.html#createchannel

Do I need to create from CloudFront SDK and configure all option?

This is how my auto-generated CloudFront from my Elemental MediaPackage console looks.

enter image description here enter image description here enter image description here enter image description here enter image description here

need help.

2

There are 2 answers

1
neatnate On BEST ANSWER

I noticed the same thing when looking through the PHP SDK MediaPackage documentation. It looks like what you will need to do is use SDK's CloudFront client to create the CloudFront distribution after creating the MediaPackage channel and endpoint. There are instructions on this page for doing this. The instructions are under the heading "Creating a Distribution from Amazon CloudFront."

https://docs.aws.amazon.com/mediapackage/latest/ug/cdns-cf.html#cdns-create-cf

0
Matthew Bournival On

As you've already discovered, the MediaPackage /origin_endpoints API does not currently provide the option to associate a CloudFront distribution similar to the AWS MediaPackage console experience.

Since the previously suggested workaround involves querying the CloudFront API directly, I have submitted a feature request to implement this feature within the API.

As with any product feature request for an AWS service, I cannot provide any details on if or when such a feature would be implemented.