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 IAM 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 - arn:aws:lambda:us-west-2:123456789012:function:my-function . - Partial ARN - 123456789012: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]) – AWS::Lambda::Url.InvokeMode.

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

Link

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.
import aws_cdk.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 IAM 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 .

Link

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

Return type

str

cors

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

Link

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

Return type

Union[IResolvable, CorsProperty, None]

invoke_mode

AWS::Lambda::Url.InvokeMode.

Link

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

Return type

Optional[str]

qualifier

The alias name.

Link

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

Return type

Optional[str]

target_function_arn

The name of the Lambda function.

Name formats - Function name - my-function .

  • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function .

  • Partial ARN - 123456789012: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.

Link

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

Return type

str