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

r/aws_cloudfront_distribution: add support for cache policies #14647

Conversation

roberth-k
Copy link
Contributor

@roberth-k roberth-k commented Aug 13, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #14373

When a cache policy is in effect, CloudFront rejects the TTL and ForwardedValues properties. To preserve backwards compatibility, this change maintains the existing TTL defaults in state, but considers them no-ops when a cache policy is set.

Release note for CHANGELOG:

ENHANCEMENTS

* resource/aws_cloudfront_distribution: Add `cache_policy_id` and `origin_request_policy_id` attributes

Output from acceptance testing:

$ make testacc ACCTEST_PARALLELISM=4 TESTARGS=-run=TestAccAWSCloudFrontDistribution_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSCloudFrontDistribution_ -timeout 120m
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (204.84s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (215.53s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (173.24s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (384.94s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (182.00s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (405.86s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (232.95s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (242.71s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_cachePolicies (246.81s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (369.60s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (157.33s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (1.41s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (192.37s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (564.85s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (401.08s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (392.60s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (503.96s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (391.32s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (1.54s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (409.02s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (409.74s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_cachePolicies (246.67s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (338.60s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (338.14s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (336.87s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       1925.152s

@roberth-k roberth-k requested a review from a team August 13, 2020 22:20
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. service/cloudfront Issues and PRs that pertain to the cloudfront service. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Aug 13, 2020
@roberth-k roberth-k force-pushed the f-aws_cloudfront_distribution-cache_policy_id branch from c6b7fdb to 503177d Compare August 14, 2020 07:25
@roberth-k roberth-k force-pushed the f-aws_cloudfront_distribution-cache_policy_id branch from 503177d to 7db0a99 Compare November 7, 2020 10:15
@roberth-k roberth-k requested a review from a team as a code owner November 7, 2020 10:15
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels Nov 7, 2020
@roberth-k roberth-k force-pushed the f-aws_cloudfront_distribution-cache_policy_id branch 2 times, most recently from 22ab50e to 4f2fe59 Compare November 7, 2020 12:41
@roberth-k roberth-k force-pushed the f-aws_cloudfront_distribution-cache_policy_id branch from 4f2fe59 to 419b273 Compare November 12, 2020 19:00
Base automatically changed from master to main January 23, 2021 00:58
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Feb 6, 2021
@ewbankkit
Copy link
Contributor

This PR has been replaced by #17336.

@ewbankkit ewbankkit closed this Feb 6, 2021
@ghost
Copy link

ghost commented Mar 8, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 8, 2021
@roberth-k roberth-k deleted the f-aws_cloudfront_distribution-cache_policy_id branch January 16, 2022 20:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/cloudfront Issues and PRs that pertain to the cloudfront service. size/XL 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
Development

Successfully merging this pull request may close these issues.

2 participants