AWS CloudFormation
User Guide (Version )

AWS::S3::Bucket CorsRule

Specifies a cross-origin access rule for an Amazon S3 bucket.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "AllowedHeaders" : [ String, ... ], "AllowedMethods" : [ String, ... ], "AllowedOrigins" : [ String, ... ], "ExposedHeaders" : [ String, ... ], "Id" : String, "MaxAge" : Integer }

YAML

AllowedHeaders: - String AllowedMethods: - String AllowedOrigins: - String ExposedHeaders: - String Id: String MaxAge: Integer

Properties

AllowedHeaders

Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.

Required: No

Type: List of String

Update requires: No interruption

AllowedMethods

An HTTP method that you allow the origin to execute. Valid values are GET, PUT, HEAD, POST, and DELETE.

Required: Yes

Type: List of String

Update requires: No interruption

AllowedOrigins

One or more origins you want customers to be able to access the bucket from.

Required: Yes

Type: List of String

Update requires: No interruption

ExposedHeaders

One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

Required: No

Type: List of String

Update requires: No interruption

Id

A unique identifier for this rule. The value must be no more than 255 characters.

Required: No

Type: String

Update requires: No interruption

MaxAge

The time in seconds that your browser is to cache the preflight response for the specified resource.

Required: No

Type: Integer

Update requires: No interruption

On this page: