Menu
AWS Elemental MediaStore
User Guide

Adding a CORS Policy to a Container

This section explains how to add a cross-origin resource sharing (CORS) configuration to an AWS Elemental MediaStore container. CORS allows client web applications that are loaded in one domain to interact with resources in another domain.

To configure your container to allow cross-origin requests, you add a CORS policy to the container. A CORS policy defines rules that identify the origins that you allow to access your container, the operations (HTTP methods) supported for each origin, and other operation-specific information.

When you add a CORS policy to the container, the container policies (that govern access rights to the container) continue to apply.

To add a CORS policy (console)

  1. Open the AWS Elemental MediaStore console at https://console.aws.amazon.com/mediastore/.

  2. On the Containers page, choose the name of the container that you want to create a CORS policy for.

    The container details page appears.

  3. In the Container CORS policy section, choose Create CORS policy.

  4. Insert the policy in JSON format, and then choose Save.

To add a CORS policy (AWS CLI)

  • In the AWS CLI, use the put-cors-policy command.

    Example:

    aws mediastore put-cors-policy --container-name ExampleContainer --cors-policy '[{"AllowedOrigins": ["*"],"AllowedMethods": ["GET"],"AllowedHeaders": ["*"],"ExposeHeaders": ["*"], "MaxAgeSeconds":3000}]' --region ap-southeast-2 --endpoint https://mediastore.ap-southeast-2.amazonaws.com/

    This command has no return value.