Skip to content

Conversation

@badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

When creating a ResponseHeadersPolicy, if we set accessControlAllowCredentials to true in the CORS configuration and include a string containing * in accessControlAllowHeaders, it causes a deployment error. I added validation to prevent this in advance.

10:57:02 PM | CREATE_FAILED        | AWS::CloudFront::ResponseHeadersPolicy      | Dev-PriCo
ach/MainS...ponseHeadersPolicy
Resource handler returned message: "Invalid request provided: AWS::CloudFront::ResponseHeade
rsPolicy: The parameter Access-Control-Allow-Headers cannot contain * when allowCredentials
is true. (Service: CloudFront, Status Code: 400, Request ID: 9298af67-dfb6-4ddc-9cd6-b301e8f
eed3e) (SDK Attempt Count: 1)" (RequestToken: 2cbce7b6-8501-7bf8-aeb8-6781277473a0, HandlerE
rrorCode: InvalidRequest)

Description of changes

Add validation for ResponseHeadersPolicy.

Describe any new or updated permissions being added

None

Description of how you validated changes

Add unit test

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Aug 22, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team August 22, 2025 14:06
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Aug 22, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@badmintoncryer badmintoncryer changed the title chore(aws-cloudfront): add validation for configuring response headers policy chore(cloudfront): add validation for configuring response headers policy Aug 22, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review August 22, 2025 14:36

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ozelalisen ozelalisen self-assigned this Sep 1, 2025
@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 8400b2b into aws:main Sep 1, 2025
18 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2025
@badmintoncryer badmintoncryer deleted the rsp branch September 1, 2025 23:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants