-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(cloudfront): Name length of cache policy #18918
Description
What is the problem?
When introducing a CachePolicy to a CloudFront distribution via CDK the automatic generated name could grow beyond 128 characters. This will cause the CloudFormation stack to fail as the request will be answered as a bad request.
Reproduction Steps
This appears if the constructs and stacks are nested and the parent logical ids are rather long.
What did you expect to happen?
CDK should not generate names longer than the limit to avoid those errors as the naming generation is sometimes hard to track.
What actually happened?
The CFN message is rather useless as we figured that root cause out by reproducing the error with all params in the management console. The CFN message reads: Resource handler returned message: "Invalid request provided: AWS::CloudFront::CachePolicy"
No further errors are provided.
CDK CLI Version
2.8.0
Framework Version
2.8.0
Node.js Version
16.13.2
OS
Windows 11
Language
Typescript
Language Version
3.9.10
Other information
No response