Skip to content

Correctly handle unset/empty items for CORS configurations in response headers policies #42360

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ankon
Copy link
Contributor

@ankon ankon commented Apr 24, 2025

Fixes #30440

Description

This should fix #30440, by serializing empty/unset items for these elements to Items:[], Quantity:0.

I was thinking of also making the elements completely optional, but that might be too big a change?

Relations

Closes #30440

Output from Acceptance Testing

% make testacc TESTS=TestAccXXX PKG=ec2

...

@ankon ankon requested a review from a team as a code owner April 24, 2025 18:57
Copy link

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

⚠️ We've detected the following potential issues with your pull request

Changelog Entry Required

The proposed change requires a changelog entry. Please see the Changelog Process section of the contributing guide for information on the changelog generation process.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/cloudfront Issues and PRs that pertain to the cloudfront service. size/L Managed by automation to categorize the size of a PR. labels Apr 24, 2025
@ankon ankon marked this pull request as draft April 24, 2025 19:17
@ankon
Copy link
Contributor Author

ankon commented Apr 24, 2025

Marking as draft: It looks like the API explicitly rejects empty lists in at least some of these, and that there are special values (*, ALL) that need to be used. Going to iterate a bit here, and see whether that is something that then would be better as "fix by improved documentation", or whether TF should translate these.

@ankon ankon force-pushed the fix/30440-empty-cors-headers branch from ca0b227 to 4b62a6c Compare April 24, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Waiting for first response or review from a maintainer. service/cloudfront Issues and PRs that pertain to the cloudfront service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
1 participant