CmdID

CmdID / aws / aws mediastore

aws mediastore put-cors-policy

Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests. AWS CLI reference

2 examples 2 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To add a CORS policy

The following put-cors-policy example adds a cross-origin resource sharing (CORS) policy to the specified container. The contents of the CORS policy are in the file named corsPolicy.json.

aws mediastore put-cors-policy --container-name ExampleContainer --cors-policy file://corsPolicy.jsonIdentify
--container-nameThe name of the container that you want to assign the CORS policy to.
--cors-policyThe CORS policy to apply to the container.

Contents of corsPolicy.json:

[
    {
        "AllowedOrigins": [
            "https://www.example.com"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedHeaders": [
            "*"
        ],
        "MaxAgeSeconds": 3000
    }
]

This command produces no output.

Example 2: To edit a CORS policy

The following put-cors-policy example updates the cross-origin resource sharing (CORS) policy that is assigned to the specified container. The contents of the updated CORS policy are in the file named corsPolicy2.json.

Options

2 in the AWS CLI reference
--container-nameThe name of the container that you want to assign the CORS policy to.
--cors-policyThe CORS policy to apply to the container.