Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cloudfront): Name length of cache policy #18918

Closed
ghost opened this issue Feb 10, 2022 · 3 comments · Fixed by #18953
Closed

(cloudfront): Name length of cache policy #18918

ghost opened this issue Feb 10, 2022 · 3 comments · Fixed by #18953
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. in-progress This issue is being actively worked on. p1

Comments

@ghost
Copy link

ghost commented Feb 10, 2022

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

@ghost ghost added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2022
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Feb 10, 2022
@ghost
Copy link
Author

ghost commented Feb 10, 2022

Note: I could make a pull request with an attempt to fix this.

@NGL321 NGL321 added p1 in-progress This issue is being actively worked on. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 14, 2022
@NGL321
Copy link
Contributor

NGL321 commented Feb 14, 2022

Thanks @RigoIce! That would be great 😄

@mergify mergify bot closed this as completed in #18953 Feb 22, 2022
mergify bot pushed a commit that referenced this issue Feb 22, 2022
Closes #18918

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

robertd added a commit to robertd/aws-cdk that referenced this issue Feb 22, 2022
Closes aws#18918

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants