FunctionUrlOptions๏ƒ

class aws_cdk.aws_lambda.FunctionUrlOptions(*, auth_type=None, cors=None, invoke_mode=None)๏ƒ

Bases: object

Options to add a url to a Lambda function.

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

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda as lambda_
# fn: lambda.Function


fn_url = fn.add_function_url(
    auth_type=lambda_.FunctionUrlAuthType.AWS_IAM
)

cloudfront.Distribution(self, "MyDistribution",
    default_behavior=cloudfront.BehaviorOptions(
        origin=origins.FunctionUrlOrigin.with_origin_access_control(fn_url)
    )
)

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.

invoke_mode๏ƒ

The type of invocation mode that your Lambda function uses.

Default:

InvokeMode.BUFFERED