Describe the bug
Lambda function description has length limit of 256 characters, but it is not currently validated by CDK
Expected Behavior
Lambda function description length should be validated at build time and build should fail if length is above 256 char limit
Current Behavior
Lambda function description length is not validated and issue will be caught at deployment time
Reproduction Steps
const stack = new cdk.Stack();
new lambda.Function(stack, 'MyFunction', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
description: 'a'.repeat(257),
});
Possible Solution
Validate description length:
if (props.description && !Token.isUnresolved(props.description)) {
if (props.description.length > 256) {
throw new Error(`Function description can not be longer than 256 characters but has ${props.description.length} characters.`);
}
}
Additional Information/Context
No response
CDK CLI Version
2.21.1
Framework Version
No response
Node.js Version
v14.19.1
OS
Ubuntu 20
Language
Typescript
Language Version
3.8.3
Other information
No response
Describe the bug
Lambda function description has length limit of 256 characters, but it is not currently validated by CDK
Expected Behavior
Lambda function description length should be validated at build time and build should fail if length is above 256 char limit
Current Behavior
Lambda function description length is not validated and issue will be caught at deployment time
Reproduction Steps
Possible Solution
Validate description length:
Additional Information/Context
No response
CDK CLI Version
2.21.1
Framework Version
No response
Node.js Version
v14.19.1
OS
Ubuntu 20
Language
Typescript
Language Version
3.8.3
Other information
No response