CfnUrlProps

class aws_cdk.aws_lambda.CfnUrlProps(*, auth_type, target_function_arn, cors=None, invoke_mode=None, qualifier=None)

Bases: object

Properties for defining a CfnUrl.

Parameters:
  • auth_type (str) – The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs .

  • target_function_arn (str) – The name of the Lambda function. Name formats - Function name - my-function . - Function ARN - lambda: : :function:my-function . - Partial ARN - :function:my-function . The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • cors (Union[IResolvable, CorsProperty, Dict[str, Any], None]) – The Cross-Origin Resource Sharing (CORS) settings for your function URL.

  • invoke_mode (Optional[str]) – Use one of the following options:. - BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. - RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 20 MB, however, you can request a quota increase .

  • qualifier (Optional[str]) – The alias name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

cfn_url_props = lambda.CfnUrlProps(
    auth_type="authType",
    target_function_arn="targetFunctionArn",

    # the properties below are optional
    cors=lambda.CfnUrl.CorsProperty(
        allow_credentials=False,
        allow_headers=["allowHeaders"],
        allow_methods=["allowMethods"],
        allow_origins=["allowOrigins"],
        expose_headers=["exposeHeaders"],
        max_age=123
    ),
    invoke_mode="invokeMode",
    qualifier="qualifier"
)

Attributes

auth_type

The type of authentication that your function URL uses.

Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-authtype

cors

//developer.mozilla.org/en-US/docs/Web/HTTP/CORS>`_ settings for your function URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-cors

Type:

The `Cross-Origin Resource Sharing (CORS) <https

Type:

//docs.aws.amazon.com/https

invoke_mode

.

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 20 MB, however, you can request a quota increase .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-invokemode

Type:

Use one of the following options

qualifier

The alias name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-qualifier

target_function_arn

The name of the Lambda function.

Name formats - Function name - my-function .

  • Function ARN - lambda:  :  :function:my-function .

  • Partial ARN - :function:my-function .

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-url.html#cfn-lambda-url-targetfunctionarn