Amazon CloudFront
Developer Guide (API Version 2016-09-29)

Configuring On-Demand with AWS Elemental MediaStore

If you store on-demand videos in AWS Elemental MediaStore, you can create a CloudFront distribution to serve the content.

To get started, you grant CloudFront access to your AWS Elemental MediaStore container. Then you create a CloudFront distribution and configure it to work with AWS Elemental MediaStore.

  1. Follow the procedure at Allowing Amazon CloudFront to Access Your AWS Elemental MediaStore Container, and then return to these steps to create your distribution.

  2. Create a distribution with the following settings:

    Origin Domain Name

    The data endpoint that is assigned to your AWS Elemental MediaStore container.

    Origin Path

    The folder structure in the AWS Elemental MediaStore container where your objects are stored. For more information, see Origin Path.

    Origin Custom Headers

    Add header names and values if you want CloudFront to include custom headers when it forwards requests to your origin.

    Object Caching

    If the transcoder that you use can't set cache controls on all objects, choose Customize. If your transcoder can set cache controls on all objects, choose Origin Cache Headers.

    Minimum TTL, Maximum TTL, and Default TTL

    Set as appropriate for your caching needs and segment durations.

    Error Caching Minimum TTL

    Set to 5 seconds or less, to help prevent serving stale content.

    For the other settings, you can set specific values based on other technical requirements or the needs of your business. For a list of all the options for web distributions and information about setting them, see Values That You Specify When You Create or Update a Web Distribution.

  3. After you create your distribution and it’s been provisioned, edit the cache behavior to set up cross-origin resource sharing (CORS) for your origin:

    1. Select the distribution, and then choose Distribution Settings.

    2. Choose Behaviors, select your origin, and then choose Edit.

    3. Under Cache Based on Selected Request Headers, choose Whitelist, and then, under Whitelist Headers, select Origin.

    To learn more about CORS, see Configuring CloudFront to Respect Cross-Origin Resource Sharing (CORS) Settings in Configuring CloudFront to Cache Objects Based on Request Headers.

  4. For links in your application (for example, a media player), specify the name of the media file in the same format that you use for other objects that you're distributing using CloudFront.