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

resource aws_cloudfront_function #19315

Merged
merged 16 commits into from
May 17, 2021

Conversation

ZsoltPath
Copy link
Contributor

@ZsoltPath ZsoltPath commented May 11, 2021

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

Closes #19225

CHANGELOG entries:

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSCloudfrontFunction_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudfrontFunction_basic -timeout 180m
=== RUN   TestAccAWSCloudfrontFunction_basic
=== PAUSE TestAccAWSCloudfrontFunction_basic
=== CONT  TestAccAWSCloudfrontFunction_basic
--- PASS: TestAccAWSCloudfrontFunction_basic (23.55s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       23.624s

$ make testacc TESTARGS='-run=TestAccAWSCloudfrontFunction_disappears'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudfrontFunction_disappears -timeout 180m
=== RUN   TestAccAWSCloudfrontFunction_disappears
=== PAUSE TestAccAWSCloudfrontFunction_disappears
=== CONT  TestAccAWSCloudfrontFunction_disappears
--- PASS: TestAccAWSCloudfrontFunction_disappears (18.14s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       18.207s

$ make testacc TESTARGS='-run=TestAccAWSCloudfrontFunction_codeUpdate'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudfrontFunction_codeUpdate -timeout 180m
=== RUN   TestAccAWSCloudfrontFunction_codeUpdate
=== PAUSE TestAccAWSCloudfrontFunction_codeUpdate
=== CONT  TestAccAWSCloudfrontFunction_codeUpdate
--- PASS: TestAccAWSCloudfrontFunction_codeUpdate (39.62s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       39.699s

$ make testacc TESTARGS='-run=TestAccAWSCloudfrontFunction_Update_nameOnly'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudfrontFunction_Update_nameOnly -timeout 180m
=== RUN   TestAccAWSCloudfrontFunction_Update_nameOnly
=== PAUSE TestAccAWSCloudfrontFunction_Update_nameOnly
=== CONT  TestAccAWSCloudfrontFunction_Update_nameOnly
--- PASS: TestAccAWSCloudfrontFunction_Update_nameOnly (40.86s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       40.931s

$ make testacc TESTARGS='-run=TestAccAWSCloudFrontDistribution_orderedCacheBehavior'==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudFrontDistribution_orderedCacheBehavior -timeout 180m
=== RUN   TestAccAWSCloudFrontDistribution_orderedCacheBehavior
=== PAUSE TestAccAWSCloudFrontDistribution_orderedCacheBehavior
=== RUN   TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== PAUSE TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
=== CONT  TestAccAWSCloudFrontDistribution_orderedCacheBehavior
=== CONT  TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (362.78s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (371.19s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       371.261s

$ make testacc TESTARGS='-run=TestAccDataSourceAWSCloudfrontFunction_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAWSCloudfrontFunction_basic -timeout 180m
=== RUN   TestAccDataSourceAWSCloudfrontFunction_basic
=== PAUSE TestAccDataSourceAWSCloudfrontFunction_basic
=== CONT  TestAccDataSourceAWSCloudfrontFunction_basic
    data_source_aws_cloudfront_function_test.go:17: Step 1/1 error: Check failed: 1 error occurred:
                * Check 4/9 error: data.aws_cloudfront_function.test: Attribute 'last_modified' expected "2021-05-11T16:08:33Z", got "2021-05-11T16:08:32Z"
        
--- FAIL: TestAccDataSourceAWSCloudfrontFunction_basic (13.33s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-aws/aws       13.400s
FAIL
make: *** [GNUmakefile:28: testacc] Error 1

...

@ZsoltPath ZsoltPath changed the title F aws cloudfront function resource aws_cloudfront_function May 11, 2021
@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 May 11, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 11, 2021
@github-actions
Copy link

Thank you for your contribution! 🚀

Please note that the CHANGELOG.md file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the Contributing Guide for additional pull request review items.

Remove any changes to the CHANGELOG.md file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request.

Copy link

@cristiangraz cristiangraz left a comment

Choose a reason for hiding this comment

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

Thanks for putting this PR together! A few minor comments.

website/docs/r/cloudfront_distribution.html.markdown Outdated Show resolved Hide resolved
aws/resource_aws_cloudfront_distribution.go Outdated Show resolved Hide resolved
website/docs/r/cloudfront_distribution.html.markdown Outdated Show resolved Hide resolved
@ZsoltPath ZsoltPath marked this pull request as ready for review May 12, 2021 12:34
@ZsoltPath ZsoltPath requested a review from a team as a code owner May 12, 2021 12:34
@ZsoltPath
Copy link
Contributor Author

@ewbankkit, @cristiangraz thanks for the reviews!

I think it's good to go now.

@ewbankkit ewbankkit self-assigned this May 12, 2021
@ewbankkit
Copy link
Contributor

@ZsoltPath Thanks for the contribution 👏.
In order to get this merged quicker I may want to make some minor changes and push them to this fork. Are you able to select Allow edits from maintainers for this PR?

@ewbankkit
Copy link
Contributor

Please add a CHANGELOG entry file .changelog/19315.txt:

```release-note:enhancement
resource/aws_cloudfront_distribution: Add `function_association` argument
```

```release-note:new-resource
aws_cloudfront_function
```

```release-note:new-data-source
aws_cloudfront_function
```

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label May 13, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAWSCloudfrontFunction_\|TestAccAWSCloudfrontFunction_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAWSCloudfrontFunction_\|TestAccAWSCloudfrontFunction_ -timeout 180m
=== RUN   TestAccDataSourceAWSCloudfrontFunction_basic
=== PAUSE TestAccDataSourceAWSCloudfrontFunction_basic
=== RUN   TestAccAWSCloudfrontFunction_basic
=== PAUSE TestAccAWSCloudfrontFunction_basic
=== RUN   TestAccAWSCloudfrontFunction_disappears
=== PAUSE TestAccAWSCloudfrontFunction_disappears
=== RUN   TestAccAWSCloudfrontFunction_Publish
=== PAUSE TestAccAWSCloudfrontFunction_Publish
=== RUN   TestAccAWSCloudfrontFunction_Update_Code
=== PAUSE TestAccAWSCloudfrontFunction_Update_Code
=== RUN   TestAccAWSCloudfrontFunction_Update_Comment
=== PAUSE TestAccAWSCloudfrontFunction_Update_Comment
=== CONT  TestAccDataSourceAWSCloudfrontFunction_basic
=== CONT  TestAccAWSCloudfrontFunction_Update_Code
=== CONT  TestAccAWSCloudfrontFunction_Update_Comment
=== CONT  TestAccAWSCloudfrontFunction_basic
=== CONT  TestAccAWSCloudfrontFunction_disappears
=== CONT  TestAccAWSCloudfrontFunction_Publish
--- PASS: TestAccAWSCloudfrontFunction_disappears (14.39s)
--- PASS: TestAccDataSourceAWSCloudfrontFunction_basic (16.75s)
--- PASS: TestAccAWSCloudfrontFunction_basic (17.56s)
--- PASS: TestAccAWSCloudfrontFunction_Publish (25.04s)
--- PASS: TestAccAWSCloudfrontFunction_Update_Code (26.09s)
--- PASS: TestAccAWSCloudfrontFunction_Update_Comment (28.11s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	31.224s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAWSCloudfrontFunction_\|TestAccAWSCloudfrontFunction_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAWSCloudfrontFunction_\|TestAccAWSCloudfrontFunction_ -timeout 180m
=== RUN   TestAccDataSourceAWSCloudfrontFunction_basic
=== PAUSE TestAccDataSourceAWSCloudfrontFunction_basic
=== RUN   TestAccAWSCloudfrontFunction_basic
=== PAUSE TestAccAWSCloudfrontFunction_basic
=== RUN   TestAccAWSCloudfrontFunction_disappears
=== PAUSE TestAccAWSCloudfrontFunction_disappears
=== RUN   TestAccAWSCloudfrontFunction_Publish
=== PAUSE TestAccAWSCloudfrontFunction_Publish
=== RUN   TestAccAWSCloudfrontFunction_Associated
=== PAUSE TestAccAWSCloudfrontFunction_Associated
=== RUN   TestAccAWSCloudfrontFunction_Update_Code
=== PAUSE TestAccAWSCloudfrontFunction_Update_Code
=== RUN   TestAccAWSCloudfrontFunction_Update_Comment
=== PAUSE TestAccAWSCloudfrontFunction_Update_Comment
=== CONT  TestAccDataSourceAWSCloudfrontFunction_basic
=== CONT  TestAccAWSCloudfrontFunction_disappears
=== CONT  TestAccAWSCloudfrontFunction_Publish
=== CONT  TestAccAWSCloudfrontFunction_Associated
=== CONT  TestAccAWSCloudfrontFunction_Update_Comment
=== CONT  TestAccAWSCloudfrontFunction_Update_Code
=== CONT  TestAccAWSCloudfrontFunction_basic
=== CONT  TestAccDataSourceAWSCloudfrontFunction_basic
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
=== CONT  TestAccAWSCloudfrontFunction_disappears
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
=== CONT  TestAccAWSCloudfrontFunction_Associated
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
--- SKIP: TestAccDataSourceAWSCloudfrontFunction_basic (1.33s)
--- SKIP: TestAccAWSCloudfrontFunction_Associated (1.33s)
--- SKIP: TestAccAWSCloudfrontFunction_disappears (1.33s)
=== CONT  TestAccAWSCloudfrontFunction_Update_Comment
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
--- SKIP: TestAccAWSCloudfrontFunction_Update_Comment (1.33s)
=== CONT  TestAccAWSCloudfrontFunction_Publish
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
--- SKIP: TestAccAWSCloudfrontFunction_Publish (1.33s)
=== CONT  TestAccAWSCloudfrontFunction_Update_Code
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
--- SKIP: TestAccAWSCloudfrontFunction_Update_Code (1.33s)
=== CONT  TestAccAWSCloudfrontFunction_basic
    provider_test.go:721: skipping tests; partition aws-us-gov does not support cloudfront service
--- SKIP: TestAccAWSCloudfrontFunction_basic (1.33s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.348s

@ewbankkit ewbankkit merged commit a874d85 into hashicorp:main May 17, 2021
@github-actions github-actions bot added this to the v3.41.0 milestone May 17, 2021
@ZsoltPath ZsoltPath deleted the f-aws_cloudfront_function branch May 18, 2021 09:20
@ghost
Copy link

ghost commented May 19, 2021

This has been released in version 3.41.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!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 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.

Feature Request: CloudFront Functions
3 participants