Open ayankowsky opened 4 months ago
Thanks @ayankowsky for reporting this. Indeed, its mentioned in clodufromation as
`` (Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package. This zip file cannot exceed 4MB. For the Handler property, the first part of the handler identifier must be index. For example, index.handler..
Describe the issue
The CDK documentation for
from_inline
states thecode
parameter has a size limit of 4KiB. However, this limit is actually 4MB according to the CloudFormation documentation for ZipFile size, which is whatfrom_inline
will synthesize to.I tested this by providing a string that was larger than 4KB, and CDK successfully synthesized a template without error.
Links
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_lambda/Code.html#aws_cdk.aws_lambda.Code.from_inline https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html