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 Cache Policy #17336

Merged
merged 13 commits into from
Feb 11, 2021
Merged

CloudFront Cache Policy #17336

merged 13 commits into from
Feb 11, 2021

Conversation

bill-rich
Copy link
Contributor

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

Output from acceptance testing:

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudFrontDistribution_ -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_disappears
=== PAUSE TestAccAWSCloudFrontDistribution_disappears
=== RUN   TestAccAWSCloudFrontDistribution_S3Origin
=== PAUSE TestAccAWSCloudFrontDistribution_S3Origin
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
=== PAUSE TestAccAWSCloudFrontDistribution_S3OriginWithTags
=== RUN   TestAccAWSCloudFrontDistribution_customOrigin
=== PAUSE TestAccAWSCloudFrontDistribution_customOrigin
=== RUN   TestAccAWSCloudFrontDistribution_multiOrigin
=== PAUSE TestAccAWSCloudFrontDistribution_multiOrigin
=== RUN   TestAccAWSCloudFrontDistribution_orderedCacheBehavior
=== PAUSE TestAccAWSCloudFrontDistribution_orderedCacheBehavior
=== RUN   TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== PAUSE TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== RUN   TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName
=== PAUSE TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName
=== RUN   TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID
=== PAUSE TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID
=== RUN   TestAccAWSCloudFrontDistribution_noOptionalItemsConfig
=== PAUSE TestAccAWSCloudFrontDistribution_noOptionalItemsConfig
=== RUN   TestAccAWSCloudFrontDistribution_HTTP11Config
=== PAUSE TestAccAWSCloudFrontDistribution_HTTP11Config
=== RUN   TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig
=== PAUSE TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig
=== RUN   TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig
=== PAUSE TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig
=== RUN   TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== PAUSE TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== RUN   TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers
=== PAUSE TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers
=== RUN   TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners
=== PAUSE TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners
=== RUN   TestAccAWSCloudFrontDistribution_Enabled
=== PAUSE TestAccAWSCloudFrontDistribution_Enabled
=== RUN   TestAccAWSCloudFrontDistribution_RetainOnDelete
=== PAUSE TestAccAWSCloudFrontDistribution_RetainOnDelete
=== RUN   TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== PAUSE TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== RUN   TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers
=== PAUSE TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers
=== RUN   TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn
=== PAUSE TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn
=== RUN   TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate
=== PAUSE TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate
=== RUN   TestAccAWSCloudFrontDistribution_WaitForDeployment
=== PAUSE TestAccAWSCloudFrontDistribution_WaitForDeployment
=== RUN   TestAccAWSCloudFrontDistribution_OriginGroups
=== PAUSE TestAccAWSCloudFrontDistribution_OriginGroups
=== CONT  TestAccAWSCloudFrontDistribution_disappears
=== CONT  TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== CONT  TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners
=== CONT  TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers
=== CONT  TestAccAWSCloudFrontDistribution_Enabled
=== CONT  TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== CONT  TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers
=== CONT  TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName
=== CONT  TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig
=== CONT  TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig
=== CONT  TestAccAWSCloudFrontDistribution_HTTP11Config
=== CONT  TestAccAWSCloudFrontDistribution_noOptionalItemsConfig
=== CONT  TestAccAWSCloudFrontDistribution_OriginGroups
=== CONT  TestAccAWSCloudFrontDistribution_WaitForDeployment
=== CONT  TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID
=== CONT  TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate
=== CONT  TestAccAWSCloudFrontDistribution_multiOrigin
=== CONT  TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames
=== CONT  TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn
=== CONT  TestAccAWSCloudFrontDistribution_RetainOnDelete
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (2.48s)
=== CONT  TestAccAWSCloudFrontDistribution_orderedCacheBehavior
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (2.57s)
=== CONT  TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (181.82s)
=== CONT  TestAccAWSCloudFrontDistribution_S3Origin
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (189.79s)
=== CONT  TestAccAWSCloudFrontDistribution_customOrigin
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (191.64s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (194.28s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (205.76s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (212.63s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (218.51s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (224.00s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (332.41s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (338.10s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (338.61s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (340.35s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (363.33s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (372.26s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (372.13s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (375.30s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (386.71s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (440.79s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (300.25s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (322.06s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (511.21s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (543.53s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	543.842s


==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudFrontCachePolicy_ -timeout 120m
=== RUN   TestAccAWSCloudFrontCachePolicy_basic
=== PAUSE TestAccAWSCloudFrontCachePolicy_basic
=== RUN   TestAccAWSCloudFrontCachePolicy_update
=== PAUSE TestAccAWSCloudFrontCachePolicy_update
=== RUN   TestAccAWSCloudFrontCachePolicy_noneBehavior
=== PAUSE TestAccAWSCloudFrontCachePolicy_noneBehavior
=== CONT  TestAccAWSCloudFrontCachePolicy_basic
=== CONT  TestAccAWSCloudFrontCachePolicy_noneBehavior
=== CONT  TestAccAWSCloudFrontCachePolicy_update
--- PASS: TestAccAWSCloudFrontCachePolicy_basic (14.56s)
--- PASS: TestAccAWSCloudFrontCachePolicy_noneBehavior (14.59s)
--- PASS: TestAccAWSCloudFrontCachePolicy_update (24.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	24.394s

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudFrontDataSourceCachePolicy_basic -timeout 120m
=== RUN   TestAccAWSCloudFrontDataSourceCachePolicy_basic
=== PAUSE TestAccAWSCloudFrontDataSourceCachePolicy_basic
=== CONT  TestAccAWSCloudFrontDataSourceCachePolicy_basic
--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (17.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	17.391s


@bill-rich bill-rich requested a review from a team as a code owner January 28, 2021 17:43
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. 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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 28, 2021
@bill-rich bill-rich changed the title F cloudfront cache policy CloudFront Cache Policy Jan 28, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 28, 2021
@bill-rich bill-rich removed the needs-triage Waiting for first response or review from a maintainer. label Jan 28, 2021
@gdavison gdavison self-assigned this Jan 29, 2021
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

A couple edits are needed in the documentation, and I have a few code suggestions, otherwise looks good.

Acceptance test results in Commercial partition

--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (8.59s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (9.38s)
--- PASS: TestAccAWSCloudFrontCachePolicy_noneBehavior (34.08s)
--- PASS: TestAccAWSCloudFrontCachePolicy_basic (34.26s)
--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (35.82s)
--- PASS: TestAccAWSCloudFrontCachePolicy_update (45.14s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (187.67s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (188.77s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (174.45s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (178.29s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (183.53s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (257.33s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (258.81s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (230.29s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (347.18s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (347.38s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (348.16s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (351.38s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (352.17s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (351.87s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (368.15s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (369.42s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (375.14s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (424.46s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (317.60s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (340.47s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (560.15s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (572.84s)

All tests skipped in GovCloud partition

Comment on lines 231 to 238
minTTL := aws.Int64(int64(m["min_ttl"].(int)))
maxTTL := aws.Int64(int64(m["max_ttl"].(int)))
defaultTTL := aws.Int64(int64(m["default_ttl"].(int)))
if m["cache_policy_id"].(string) != "" {
minTTL = nil
maxTTL = nil
defaultTTL = nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic might be cleaner if it were moved after the &cloudfront.CacheBehavior{} is created and not set the values in the declaration. Something like

cb := &cloudfront.CacheBehavior{
  ...
}
if m["cache_policy_id"].(string) == "" {
  cb. DefaultTTL = aws.Int64(int64(m["default_ttl"].(int)))
  cb. MaxTTL = aws.Int64(int64(m["max_ttl"].(int)))
  cb. MinTTL = aws.Int64(int64(m["min_ttl"].(int)))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. That is much better.

aws/cloudfront_cache_policy_structure.go Outdated Show resolved Hide resolved
Comment on lines 55 to 62
if headersFlat, ok := headersConfigFlat["headers"].([]interface{}); ok && len(headersFlat) == 1 && headersConfigFlat["header_behavior"] != "none" {
headers = expandCloudFrontCachePolicyHeaders(headersFlat[0].(map[string]interface{}))
} else {
headers = nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This and similar cases in the rest of the file could be moved after declaration as above

}
}

func flattenCloudFrontCachePolicy(d *schema.ResourceData, cachePolicy *cloudfront.CachePolicyConfig) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how you made this a shared function. I'd suggest changing the name, since flatten...() functions typically return a native Go type such as []map[string]interface{} or map[string]interface{}. In this case, the function is Setting values on the schema.ResourceData. Maybe something like setCloudFrontCachePolicy() or setFlattenedCloudFrontCachePolicy().

func dataSourceAwsCloudFrontCachePolicyRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).cloudfrontconn

if d.Id() == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the conditionals needed here?


if d.Id() == "" {
if err := dataSourceAwsCloudFrontCachePolicyFindByName(d, conn); err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Error return values should have some context added to them

Comment on lines 23 to 32
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "comment", "test comment"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "default_ttl", "50"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "min_ttl", "1"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "max_ttl", "100"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.cookies_config.0.cookie_behavior", "whitelist"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.cookies_config.0.cookies.0.items.0", "test"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.headers_config.0.header_behavior", "whitelist"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.headers_config.0.headers.0.items.0", "test"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.query_strings_config.0.query_string_behavior", "whitelist"),
resource.TestCheckResourceAttr("data.aws_cloudfront_cache_policy.example", "parameters_in_cache_key_and_forwarded_to_origin.0.query_strings_config.0.query_strings.0.items.0", "test"),
Copy link
Contributor

Choose a reason for hiding this comment

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

We prefer using a variable, such as datasourceName or resourceName as the first parameter for these types of functions

Comment on lines 40 to 41
* `cookies_config` - An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and automatically included in requests that CloudFront sends to the origin. See [Headers Config](#headers-config) for more information.
* `cookies_config` - An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and automatically included in requests that CloudFront sends to the origin. See [Query Strings Config](#query-strings-config) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like some missed edits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Too much copying and pasting!

Comment on lines 64 to 65
* `cookies_config` - (Required) An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and automatically included in requests that CloudFront sends to the origin. See [Headers Config](#headers-config) for more information.
* `cookies_config` - (Required) An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and automatically included in requests that CloudFront sends to the origin. See [Query Strings Config](#query-strings-config) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like missed edits

@yugandharag
Copy link

When will this be merged ?

@pen-pal
Copy link

pen-pal commented Feb 9, 2021

How long till it's released?

Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

One suggestion, and the PR has a merge conflict, otherwise looks good. I'll run the acceptance tests once the conflict is resolved.

Comment on lines 48 to 51
var items []*string
for _, item := range tfMap["items"].(*schema.Set).List() {
items = append(items, aws.String(item.(string)))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not strictly needed, but we have the function expandStringSet() that does this

Suggested change
var items []*string
for _, item := range tfMap["items"].(*schema.Set).List() {
items = append(items, aws.String(item.(string)))
}
items := expandStringSet(tfMap["items"])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I got it rebased, and switched to using expandStringSet. Good to know about that one!

@bill-rich bill-rich force-pushed the f_cloudfront_cache_policy branch from 7ab26bc to 2a146bd Compare February 10, 2021 23:17
@bill-rich bill-rich force-pushed the f_cloudfront_cache_policy branch from 7680ad9 to cc46094 Compare February 11, 2021 00:43
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

Acceptance tests in Commercial partition

--- PASS: TestCloudFrontStructure_expandCachedMethods (0.00s)
--- PASS: TestCloudFrontStructure_expandTrustedSigners (0.00s)
--- PASS: TestCloudFrontStructure_expandHeaders (0.00s)
--- PASS: TestCloudFrontStructure_flattenCookieNames (0.00s)
--- PASS: TestCloudFrontStructure_expandLambdaFunctionAssociations (0.00s)
--- PASS: TestCloudFrontStructure_expandlambdaFunctionAssociations_empty (0.00s)
--- PASS: TestCloudFrontStructure_expandCloudFrontDefaultCacheBehavior (0.01s)
--- PASS: TestCloudFrontStructure_flattenlambdaFunctionAssociations (0.00s)
--- PASS: TestCloudFrontStructure_expandForwardedValues (0.00s)
--- PASS: TestCloudFrontStructure_flattenForwardedValues (0.00s)
--- PASS: TestCloudFrontStructure_expandCookiePreference (0.00s)
--- PASS: TestCloudFrontStructure_flattenQueryStringCacheKeys (0.00s)
--- PASS: TestCloudFrontStructure_expandTrustedSigners_empty (0.00s)
--- PASS: TestCloudFrontStructure_expandAllowedMethods (0.01s)
--- PASS: TestCloudFrontStructure_expandQueryStringCacheKeys (0.04s)
--- PASS: TestCloudFrontStructure_flattenHeaders (0.00s)
--- PASS: TestCloudFrontStructure_expandOrigins (0.00s)
--- PASS: TestCloudFrontStructure_flattenAllowedMethods (0.00s)
--- PASS: TestCloudFrontStructure_flattenCachedMethods (0.00s)
--- PASS: TestCloudFrontStructure_flattenCookiePreference (0.00s)
--- PASS: TestCloudFrontStructure_flattenTrustedSigners (0.00s)
--- PASS: TestCloudFrontStructure_expandCookieNames (0.00s)
--- PASS: TestCloudFrontStructure_expandOriginGroups (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomOriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenOrigins (0.00s)
--- PASS: TestCloudFrontStructure_flattenOriginCustomHeader (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomHeaders (0.00s)
--- PASS: TestCloudFrontStructure_flattenOrigin (0.00s)
--- PASS: TestCloudFrontStructure_flattenOriginGroups (0.00s)
--- PASS: TestCloudFrontStructure_expandS3OriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_expandOrigin (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomOriginConfigSSL (0.00s)
--- PASS: TestCloudFrontStructure_expandOriginCustomHeader (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomOriginConfigSSL (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomHeaders (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomOriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponses (0.00s)
--- PASS: TestCloudFrontStructure_flattenS3OriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomErrorResponses (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponse (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponse_emptyResponseCode (0.00s)
--- PASS: TestCloudFrontStructure_flattenAliases (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomErrorResponse (0.00s)
--- PASS: TestCloudFrontStructure_flattenGeoRestriction_whitelist (0.00s)
--- PASS: TestCloudFrontStructure_expandLoggingConfig_nilValue (0.00s)
--- PASS: TestCloudFrontStructure_expandAliases (0.00s)
--- PASS: TestCloudFrontStructure_flattenGeoRestriction_no_items (0.00s)
--- PASS: TestCloudFrontStructure_expandLoggingConfig (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_acm_certificate_arn (0.00s)
--- PASS: TestCloudFrontStructure_expandGeoRestriction_no_items (0.00s)
--- PASS: TestCloudFrontStructure_expandRestrictions (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_iam_certificate_id (0.00s)
--- PASS: TestCloudFrontStructure_expandGeoRestriction_whitelist (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_cloudfront_default_certificate (0.00s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (11.27s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (11.88s)
--- PASS: TestAccAWSCloudFrontCachePolicy_basic (34.98s)
--- PASS: TestAccAWSCloudFrontCachePolicy_noneBehavior (35.63s)
--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (38.05s)
--- PASS: TestAccAWSCloudFrontCachePolicy_update (47.03s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (209.68s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (180.06s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (217.07s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (232.06s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (203.21s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (243.33s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (166.71s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (389.65s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (390.40s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (395.87s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (397.11s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (365.43s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (179.96s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (421.21s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (421.12s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (424.18s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (435.07s)
--- PASS: TestAccAWSCloudFrontDistribution_originPolicyDefault (435.36s)
--- PASS: TestAccAWSCloudFrontDistribution_originPolicyOrdered (446.05s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (447.90s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (307.94s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (341.68s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (561.74s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (596.62s)

Acceptance tests in GovCloud partition

--- PASS: TestCloudFrontStructure_flattenQueryStringCacheKeys (0.00s)
--- PASS: TestCloudFrontStructure_flattenCookiePreference (0.00s)
--- PASS: TestCloudFrontStructure_expandForwardedValues (0.00s)
--- PASS: TestCloudFrontStructure_flattenForwardedValues (0.00s)
--- PASS: TestCloudFrontStructure_expandlambdaFunctionAssociations_empty (0.00s)
--- PASS: TestCloudFrontStructure_expandHeaders (0.00s)
--- PASS: TestCloudFrontStructure_expandLambdaFunctionAssociations (0.00s)
--- PASS: TestCloudFrontStructure_flattenHeaders (0.00s)
--- PASS: TestCloudFrontStructure_expandTrustedSigners (0.00s)
--- PASS: TestCloudFrontStructure_flattenTrustedSigners (0.00s)
--- PASS: TestCloudFrontStructure_expandCloudFrontDefaultCacheBehavior (0.00s)
--- PASS: TestCloudFrontStructure_flattenlambdaFunctionAssociations (0.00s)
--- PASS: TestCloudFrontStructure_expandQueryStringCacheKeys (0.00s)
--- PASS: TestCloudFrontStructure_expandCookiePreference (0.00s)
--- PASS: TestCloudFrontStructure_expandCookieNames (0.00s)
--- PASS: TestCloudFrontStructure_expandTrustedSigners_empty (0.00s)
--- PASS: TestCloudFrontStructure_flattenAllowedMethods (0.00s)
--- PASS: TestCloudFrontStructure_expandOrigins (0.00s)
--- PASS: TestCloudFrontStructure_expandCachedMethods (0.00s)
--- PASS: TestCloudFrontStructure_expandAllowedMethods (0.00s)
--- PASS: TestCloudFrontStructure_flattenCachedMethods (0.00s)
--- PASS: TestCloudFrontStructure_flattenCookieNames (0.00s)
--- PASS: TestCloudFrontStructure_flattenOrigins (0.00s)
--- PASS: TestCloudFrontStructure_flattenOriginGroups (0.00s)
--- PASS: TestCloudFrontStructure_expandOriginGroups (0.00s)
--- PASS: TestCloudFrontStructure_expandOrigin (0.00s)
--- PASS: TestCloudFrontStructure_flattenOrigin (0.00s)
--- PASS: TestCloudFrontStructure_flattenOriginCustomHeader (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomHeaders (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomHeaders (0.00s)
--- PASS: TestCloudFrontStructure_expandOriginCustomHeader (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomOriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomOriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomOriginConfigSSL (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomOriginConfigSSL (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponse (0.00s)
--- PASS: TestCloudFrontStructure_expandS3OriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenS3OriginConfig (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomErrorResponses (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponses (0.00s)
--- PASS: TestCloudFrontStructure_expandCustomErrorResponse_emptyResponseCode (0.00s)
--- PASS: TestCloudFrontStructure_expandLoggingConfig_nilValue (0.00s)
--- PASS: TestCloudFrontStructure_flattenCustomErrorResponse (0.00s)
--- PASS: TestCloudFrontStructure_expandLoggingConfig (0.00s)
--- PASS: TestCloudFrontStructure_expandAliases (0.00s)
--- PASS: TestCloudFrontStructure_flattenAliases (0.00s)
--- PASS: TestCloudFrontStructure_expandGeoRestriction_whitelist (0.00s)
--- PASS: TestCloudFrontStructure_expandRestrictions (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_acm_certificate_arn (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_iam_certificate_id (0.00s)
--- PASS: TestCloudFrontStructure_expandViewerCertificate_cloudfront_default_certificate (0.00s)
--- PASS: TestCloudFrontStructure_flattenGeoRestriction_no_items (0.00s)
--- PASS: TestCloudFrontStructure_expandGeoRestriction_no_items (0.00s)
--- PASS: TestCloudFrontStructure_flattenGeoRestriction_whitelist (0.00s)
--- SKIP: TestAccAWSCloudFrontDataSourceCachePolicy_basic (0.54s)
--- SKIP: TestAccAWSCloudFrontCachePolicy_basic (0.49s)
--- SKIP: TestAccAWSCloudFrontCachePolicy_update (0.53s)
--- SKIP: TestAccAWSCloudFrontCachePolicy_noneBehavior (0.45s)
--- SKIP: TestAccAWSCloudFrontDistribution_disappears (0.39s)
--- SKIP: TestAccAWSCloudFrontDistribution_S3OriginWithTags (0.38s)
--- SKIP: TestAccAWSCloudFrontDistribution_originPolicyDefault (0.27s)
--- SKIP: TestAccAWSCloudFrontDistribution_S3Origin (0.36s)
--- SKIP: TestAccAWSCloudFrontDistribution_customOrigin (0.41s)
--- SKIP: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (0.42s)
--- SKIP: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (0.41s)
--- SKIP: TestAccAWSCloudFrontDistribution_multiOrigin (0.44s)
--- SKIP: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (0.42s)
--- SKIP: TestAccAWSCloudFrontDistribution_originPolicyOrdered (0.41s)
--- SKIP: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (0.41s)
--- SKIP: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (0.21s)
--- SKIP: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (0.50s)
--- SKIP: TestAccAWSCloudFrontDistribution_HTTP11Config (0.41s)
--- SKIP: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (0.36s)
--- SKIP: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (0.42s)
--- SKIP: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (0.44s)
--- SKIP: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (0.40s)
--- SKIP: TestAccAWSCloudFrontDistribution_RetainOnDelete (0.14s)
--- SKIP: TestAccAWSCloudFrontDistribution_Enabled (0.36s)
--- SKIP: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (0.33s)
--- SKIP: TestAccAWSCloudFrontDistribution_OriginGroups (0.30s)
--- SKIP: TestAccAWSCloudFrontDistribution_WaitForDeployment (0.21s)
--- SKIP: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (0.20s)
--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (0.84s)
--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (0.73s)

@bill-rich bill-rich merged commit 6b44c85 into main Feb 11, 2021
@bill-rich bill-rich deleted the f_cloudfront_cache_policy branch February 11, 2021 23:56
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
github-actions bot pushed a commit that referenced this pull request Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 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 14, 2021
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/XXL 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.

4 participants