You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type-safe-api generates prepareSpecLambdaName using the stack prefix. When used with a branch name and stack name over a certain length, it causes a function name longer than 64 characters which is the limit from Lambda.
Expected Behavior
All generated function names will be less than 64 characters in length.
Current Behavior
cdk synth fails with Error: Function name can not be longer than 64 characters but has 66 characters.
The full error message before this exception appears to be a dump of a javascript source.
Reproduction Steps
Create a stack with a type-safe-api in a stack with a name over 34 characters long. Or use PDK Pipeline with feature branches enabled and have the combination of the branch name and the stack name over 34 characters long. e.g. feature-branch-Dev-MyLongStackName.
Describe the bug
type-safe-api generates
prepareSpecLambdaName
using the stack prefix. When used with a branch name and stack name over a certain length, it causes a function name longer than 64 characters which is the limit from Lambda.Expected Behavior
All generated function names will be less than 64 characters in length.
Current Behavior
cdk synth fails with
Error: Function name can not be longer than 64 characters but has 66 characters.
The full error message before this exception appears to be a dump of a javascript source.
Reproduction Steps
Create a stack with a type-safe-api in a stack with a name over 34 characters long. Or use PDK Pipeline with feature branches enabled and have the combination of the branch name and the stack name over 34 characters long. e.g.
feature-branch-Dev-MyLongStackName
.cdk synth will fail
Possible Solution
https://github.com/aws/aws-pdk/blob/4057d69b68e329d7434af4c3cd0ef7d17856c8b2/packages/type-safe-api/src/construct/type-safe-rest-api.ts#L128C11-L128C32 generates the ParseSpec name.
aws-pdk/packages/type-safe-api/src/construct/type-safe-rest-api.ts
Line 224 in 4057d69
Create a function to check the length and generate a shorter alternative.
Additional Information/Context
No response
PDK version used
0.22.17
What languages are you seeing this issue on?
Typescript
Environment details (OS name and version, etc.)
MacOS 13.6
The text was updated successfully, but these errors were encountered: