Skip to content

aws-cloudfront: cache policy comment length is not validated #31248

@floriangosse

Description

@floriangosse

Describe the bug

CloudFront cache policy have a maximum comment length of 128 but is currently not validated by CDK.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

CDK validates the comment's length.

Current Behavior

CDK doesn't validate the comment's length.

Reproduction Steps

const stack = new cdk.Stack();
new cloudfront.CachePolicy(stack, 'MyCachePolicy', {
	comment: "a".repeat(129)
});

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.37.1

Framework Version

No response

Node.js Version

20

OS

macOS

Language

TypeScript

Language Version

TypeScript 5

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions