CorsRule

class aws_cdk.aws_s3.CorsRule(*, allowed_methods, allowed_origins, allowed_headers=None, exposed_headers=None, id=None, max_age=None)

Bases: object

__init__(*, allowed_methods, allowed_origins, allowed_headers=None, exposed_headers=None, id=None, max_age=None)

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

Parameters
  • allowed_methods (List[HttpMethods]) – An HTTP method that you allow the origin to execute.

  • allowed_origins (List[str]) – One or more origins you want customers to be able to access the bucket from.

  • allowed_headers (Optional[List[str]]) – Headers that are specified in the Access-Control-Request-Headers header. Default: - No headers allowed.

  • exposed_headers (Optional[List[str]]) – One or more headers in the response that you want customers to be able to access from their applications. Default: - No headers exposed.

  • id (Optional[str]) – A unique identifier for this rule. Default: - No id specified.

  • max_age (Union[int, float, None]) – The time in seconds that your browser is to cache the preflight response for the specified resource. Default: - No caching.

Attributes

allowed_headers

Headers that are specified in the Access-Control-Request-Headers header.

default :default: - No headers allowed.

Return type

Optional[List[str]]

allowed_methods

An HTTP method that you allow the origin to execute.

Return type

List[HttpMethods]

allowed_origins

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

Return type

List[str]

exposed_headers

One or more headers in the response that you want customers to be able to access from their applications.

default :default: - No headers exposed.

Return type

Optional[List[str]]

id

A unique identifier for this rule.

default :default: - No id specified.

Return type

Optional[str]

max_age

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

default :default: - No caching.

Return type

Union[int, float, None]