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 toAWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
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
]) – Use one of the following options:. -BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
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 theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase .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 users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs .
- cors
//developer.mozilla.org/en-US/docs/Web/HTTP/CORS>`_ settings for your function URL.
- Link:
- 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 theInvoke
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 theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase .
- Link:
- Type:
Use one of the following options
- qualifier
The alias name.
- 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.