FunctionUrlProps

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

Bases: FunctionUrlOptions

Properties for a FunctionUrl.

Parameters:
  • auth_type (Optional[FunctionUrlAuthType]) – The type of authentication that your function URL uses. Default: FunctionUrlAuthType.AWS_IAM

  • cors (Union[FunctionUrlCorsOptions, Dict[str, Any], None]) – The cross-origin resource sharing (CORS) settings for your function URL. Default: - No CORS configuration.

  • invoke_mode (Optional[InvokeMode]) – The type of invocation mode that your Lambda function uses. Default: InvokeMode.BUFFERED

  • function (IFunction) – The function to which this url refers. It can also be an Alias but not a Version.

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 as cdk
from aws_cdk import aws_lambda as lambda_

# 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)
    ),
    invoke_mode=lambda_.InvokeMode.BUFFERED
)

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:
  • No CORS configuration.

function

The function to which this url refers.

It can also be an Alias but not a Version.

invoke_mode

The type of invocation mode that your Lambda function uses.

Default:

InvokeMode.BUFFERED