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

class aws_cdk.aws_lambda.FunctionUrlProps(*, auth_type=None, cors=None, function)

Bases: FunctionUrlOptions

Properties for a FunctionUrl.

Parameters:

ExampleMetadata:

fixture=_generated

Example:

The code below shows an example of how to instantiate this type.

The values are placeholders you should change.

import aws_cdk.aws_lambda as lambda_ import aws_cdk.core as cdk

function_: lambda.Function

function_url_props = lambda.FunctionUrlProps( function=function_,

# the properties below are optional
auth_type=lambda_.FunctionUrlAuthType.AWS_IAM,
cors=lambda.FunctionUrlCorsOptions(
    allow_credentials=False,
    allowed_headers=["allowedHeaders"],
    allowed_methods=[lambda_.HttpMethod.GET],
    allowed_origins=["allowedOrigins"],
    exposed_headers=["exposedHeaders"],
    max_age=cdk.Duration.minutes(30)
)

)

Attributes

auth_type

The type of authentication that your function URL uses.

Default:

FunctionUrlAuthType.AWS_IAM

cors

The cross-origin resource sharing (CORS) settings for your function URL.

Default:

function

The function to which this url refers.

It can also be an Alias but not a Version.