CorsRule
A rule for a CORS policy. 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.
Contents
- AllowedHeaders
-
Specifies which headers are allowed in a preflight
OPTIONSrequest through theAccess-Control-Request-Headersheader. Each header name that is specified inAccess-Control-Request-Headersmust have a corresponding entry in the rule. Only the headers that were requested are sent back.This element can contain only one wildcard character (*).
Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 100 items.
Length Constraints: Minimum length of 1. Maximum length of 8192.
Pattern:
[\u0009\u000A\u000D\u0020-\u00FF]+Required: Yes
- AllowedOrigins
-
One or more response headers that you want users to be able to access from their applications (for example, from a JavaScript
XMLHttpRequestobject).Each CORS rule must have at least one
AllowedOriginselement. The string value can include only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard character to allow cross-origin access for all origins.Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 100 items.
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
[\u0009\u000A\u000D\u0020-\u00FF]+Required: Yes
- AllowedMethods
-
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one
AllowedMethodsand oneAllowedOriginselement.Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 4 items.
Valid Values:
PUT | GET | DELETE | HEADRequired: No
- ExposeHeaders
-
One or more headers in the response that you want users to be able to access from their applications (for example, from a JavaScript
XMLHttpRequestobject).This element is optional for each rule.
Type: Array of strings
Array Members: Minimum number of 0 items. Maximum number of 100 items.
Length Constraints: Minimum length of 1. Maximum length of 8192.
Pattern:
[\u0009\u000A\u000D\u0020-\u00FF]+Required: No
- MaxAgeSeconds
-
The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one
MaxAgeSecondselement.Type: Integer
Valid Range: Minimum value of 0. Maximum value of 2147483647.
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: