(acm): DomainName length check fails with too long prop due to string encoded tokens. #23565
Labels
@aws-cdk/aws-certificatemanager
Related to Amazon Certificate Manager
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p2
Describe the bug
When creating Certificate where the domainName property contains domain with tokens, the length check fails because the string encoded token causes the length to exceed the maximum even if token resolved to something shorter.
Expected Behavior
Check is only done when string contains no unresolved tokens.
Offending line:
aws-cdk/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts
Line 245 in 3d8df57
Current Behavior
Synthesis failed because length is exceeded due to string encoded token.
Reproduction Steps
Create cdk stack
Add Certificate where the base domain is 54 characters.
Add domainName string where subdomain comes from Token (For example CfnParameter)
Try to synthesize stack.
Possible Solution
Perform check only when tokens are unresolved. Like cdk documentation suggests.
aws-cdk/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts
Line 245 in 3d8df57
Example from docs:
In this context:
Additional Information/Context
No response
CDK CLI Version
2.58.1
Framework Version
No response
Node.js Version
16.19.0
OS
Ubuntu
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: