aws-synthetics: canary name limit is inconsistent with the API #32376
Labels
@aws-cdk/aws-synthetics
Related to Amazon CloudWatch Synthetics
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
When I set the
canaryName
via cdk code then it says the maximum allowed character is 21. But when I do the same thing on AWS Management Console, I can have upto 255 characters.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I expected the CDK to have the same limit to the AWS Management Console API.
Current Behavior
I'm getting this error.
Error: Canary name is too large, must be between 1 and 21 characters, but is 29 (got "Generiskinvalid_id_case_12345")
Reproduction Steps
Create a synthetic resource with canaryName string having length of more than 21 characters.
Possible Solution
aws-cdk/packages/aws-cdk-lib/aws-synthetics/lib/canary.ts
Lines 747 to 753 in bf77e51
In this file, we should update the comparison to be
length > 255
.Additional Information/Context
No response
CDK CLI Version
2.162.1 (build 10aa526)
Framework Version
No response
Node.js Version
v18.18.2
OS
Terminal
Language
TypeScript
Language Version
"aws-cdk-lib": "^2.171.0"
Other information
No response
The text was updated successfully, but these errors were encountered: