FunctionUrlCorsOptions — AWS Cloud Development Kit 1.204.0 documentation (original) (raw)

class aws_cdk.aws_lambda.FunctionUrlCorsOptions(*, allow_credentials=None, allowed_headers=None, allowed_methods=None, allowed_origins=None, exposed_headers=None, max_age=None)

Bases: object

Specifies a cross-origin access property for a function URL.

Parameters:

ExampleMetadata:

infused

Example:

fn: lambda.Function

fn.add_function_url( auth_type=lambda_.FunctionUrlAuthType.NONE, cors=lambda.FunctionUrlCorsOptions( # Allow this to be called from websites on https://example.com. # Can also be ['*'] to allow all domain. allowed_origins=["https://example.com"] ) )

Attributes

allow_credentials

Whether to allow cookies or other credentials in requests to your function URL.

Default:

false

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

Default:

allowed_methods

An HTTP method that you allow the origin to execute.

Default:

allowed_origins

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

Default:

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

Default:

max_age

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

Default: