cors_policies
Creates, updates, deletes, gets or lists a cors_policies resource.
Overview
| Name | cors_policies |
| Type | Resource |
| Id | aws.mediastore.cors_policies |
Fields
The following fields are returned by SELECT queries:
- get_cors_policy
| Name | Datatype | Description |
|---|---|---|
cors_policy | array | The CORS policy assigned to the container. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_cors_policy | select | region | Returns the cross-origin resource sharing (CORS) configuration information that is set for the container. To use this operation, you must have permission to perform the MediaStore:GetCorsPolicy action. By default, the container owner has this permission and can grant it to others. | |
put_cors_policy | replace | region, ContainerName, CorsPolicy | Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests. For example, you might want to enable a request whose origin is http://www.example.com to access your AWS Elemental MediaStore container at my.example.container.com by using the browser's XMLHttpRequest capability. To enable CORS on a container, you attach a CORS policy to the container. In the CORS policy, you configure rules that identify origins and the HTTP methods that can be executed on your container. The policy can contain up to 398,000 characters. You can add up to 100 rules to a CORS policy. If more than one rule applies, the service uses the first applicable rule listed. To learn more about CORS, see Cross-Origin Resource Sharing (CORS) in AWS Elemental MediaStore. | |
delete_cors_policy | delete | region | Deletes the cross-origin resource sharing (CORS) configuration information that is set for the container. To use this operation, you must have permission to perform the MediaStore:DeleteCorsPolicy action. The container owner has this permission by default and can grant this permission to others. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_cors_policy
Returns the cross-origin resource sharing (CORS) configuration information that is set for the container. To use this operation, you must have permission to perform the MediaStore:GetCorsPolicy action. By default, the container owner has this permission and can grant it to others.
SELECT
cors_policy
FROM aws.mediastore.cors_policies
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_cors_policy
Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests. For example, you might want to enable a request whose origin is http://www.example.com to access your AWS Elemental MediaStore container at my.example.container.com by using the browser's XMLHttpRequest capability. To enable CORS on a container, you attach a CORS policy to the container. In the CORS policy, you configure rules that identify origins and the HTTP methods that can be executed on your container. The policy can contain up to 398,000 characters. You can add up to 100 rules to a CORS policy. If more than one rule applies, the service uses the first applicable rule listed. To learn more about CORS, see Cross-Origin Resource Sharing (CORS) in AWS Elemental MediaStore.
REPLACE aws.mediastore.cors_policies
SET
ContainerName = '{{ ContainerName }}',
CorsPolicy = '{{ CorsPolicy }}'
WHERE
region = '{{ region }}' --required
AND ContainerName = '{{ ContainerName }}' --required
AND CorsPolicy = '{{ CorsPolicy }}' --required;
DELETE examples
- delete_cors_policy
Deletes the cross-origin resource sharing (CORS) configuration information that is set for the container. To use this operation, you must have permission to perform the MediaStore:DeleteCorsPolicy action. The container owner has this permission by default and can grant this permission to others.
DELETE FROM aws.mediastore.cors_policies
WHERE region = '{{ region }}' --required
;