(cloudfront): Name length of cache policy #23272
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p3
Describe the bug
When introducing an unnamed CachePolicy to a CloudFront distribution which is deeply nested in constructs the automatic generated name could grow beyond 128 characters, in spite of #18918 / #18953. This will cause the CDK to raise an exception
Expected Behavior
CDK is able to figure out how to make a properly unique policy name without raising exceptions
Current Behavior
CDK is unable to figure out how to make a properly unique policy name without raising exceptions.
In the reproduction case, the offending policy's id is a single character, which is still too long.
Reproduction Steps
Attempt to synth the project that can be cloned from here: https://github.com/jnawk/cdk-cfront-policy-name-too-long
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.54.0
Framework Version
2.54.0
Node.js Version
16.18.1
OS
Ubuntu 22.04.1 LTS
Language
Typescript
Language Version
TS4.9.4
Other information
No response
The text was updated successfully, but these errors were encountered: