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 Distribution: Origin Groups support #7202

Merged
merged 10 commits into from
Mar 17, 2019

Conversation

barrytam20
Copy link
Contributor

@barrytam20 barrytam20 commented Jan 18, 2019

Fixes #6547

Changes proposed in this pull request:

  • Added origin groups resource in resource_aws_cloudfront_distribution
  • added expanding, flattening, and hashing for origin groups in cloudfront_distribution_configuration_structure
  • website documentation update

Output from added unit testing:

make test TEST=./aws TESTARGS='-run=Test.*OriginGroups'
==> Checking that code complies with gofmt requirements...
go test ./aws -timeout=30s -parallel=4
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2.839s

acceptance tests were taken from PR #7145, however, my corporate account is not letting me create buckets and preventing me from running them

@ghost ghost added documentation Introduces or discusses updates to documentation. size/XL Managed by automation to categorize the size of a PR. 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 18, 2019
@barrytam20
Copy link
Contributor Author

@bflad going by the amount of contributor pull requests out there, looks like you guys are busy prepping for the terraform 0.12 release. Any chance you guys can give this a review? We would really like to have this feature

@barrytam20
Copy link
Contributor Author

fixed hash values in test, ran on my personal aws account

make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudFrontDistribution_OriginGroups'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSCloudFrontDistribution_OriginGroups -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_OriginGroups
=== PAUSE TestAccAWSCloudFrontDistribution_OriginGroups
=== CONT  TestAccAWSCloudFrontDistribution_OriginGroups
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (37.06s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       37.098s

@barrytam20
Copy link
Contributor Author

@bflad small bump to get this PR noticed :)

@queeno
Copy link

queeno commented Mar 6, 2019

Hey there, could you please rebase and resolve the conflicts?
Thanks :-)

@bflad
Copy link
Contributor

bflad commented Mar 6, 2019

Sorry for rebase mess, we have been doing a bunch of bug fixes and cleanup with this resource. 😅

Once that is sorted, we would like to take a look at this but it appears there are two conflicting pull requests for this functionality (this and #7145). Since we cannot merge both as one is not a superset of the other, we ask that the authors work out an arrangement for which pull request to move forward. Thanks so much for your work here so far.

@barrytam20
Copy link
Contributor Author

barrytam20 commented Mar 6, 2019

@queeno @bflad i merged in upstream changes and resolved the conflicts

@cl3086 would you mind if we move forward with this PR as opposed to yours (#7145)? i think this one is a bit further along

@queeno
Copy link

queeno commented Mar 7, 2019

Thanks @barrytam20
Let's try to get this merged and released asap. I have the feeling that many many people around the world will be grateful 👍

@cl3086
Copy link

cl3086 commented Mar 7, 2019

The other PR has been closed @barrytam20 !

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 7, 2019
@bflad bflad added this to the v2.3.0 milestone Mar 7, 2019
@bflad
Copy link
Contributor

bflad commented Mar 7, 2019

Thanks so much @barrytam20 and @cl3086 -- for full transparency I know at least personally I won't be able to look at this for a week or two due to my focus being elsewhere, but at quick glance this looks like its off to a good start and maybe other maintainers or community members can chime in. 👍

@bflad bflad self-assigned this Mar 15, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @barrytam20 👋 Thanks so much for this contribution. I left some initial feedback below which will potentially influence further feedback so stopping here. Please reach out if you have any questions or do not have time to implement these items. 👍

aws/resource_aws_cloudfront_distribution.go Outdated Show resolved Hide resolved
aws/resource_aws_cloudfront_distribution.go Outdated Show resolved Hide resolved
aws/resource_aws_cloudfront_distribution_test.go Outdated Show resolved Hide resolved
aws/resource_aws_cloudfront_distribution.go Outdated Show resolved Hide resolved
aws/structure.go Outdated Show resolved Hide resolved
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 15, 2019
@barrytam20
Copy link
Contributor Author

hey @bflad, thanks for the advice!

i've made some changes as per your recommendations. Output from testing is

Barrys-MBP:terraform-provider-aws barrytam$ make test TEST=./aws TESTARGS='-run=Test.*OriginGroups'
==> Checking that code complies with gofmt requirements...
go test ./aws -timeout=30s -parallel=4
ok  	github.com/barrytam20/terraform-provider-aws/aws	0.271s
Barrys-MBP:terraform-provider-aws barrytam$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudFrontDistribution_OriginGroups'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSCloudFrontDistribution_OriginGroups -timeout 120m
=== RUN   TestAccAWSCloudFrontDistribution_OriginGroups
=== PAUSE TestAccAWSCloudFrontDistribution_OriginGroups
=== CONT  TestAccAWSCloudFrontDistribution_OriginGroups
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (1172.75s)
PASS
ok  	github.com/barrytam20/terraform-provider-aws/aws	1172.793s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Mar 16, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks great, @barrytam20, thanks so much for the updates 🚀

--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (1987.24s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (517.03s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (2576.87s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (1100.14s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (1106.13s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (1175.69s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (1101.07s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (1987.73s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (1991.00s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (1.87s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (1.82s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (1986.48s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (1103.66s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (1175.76s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1769.72s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (1993.18s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (1993.35s)


##### Members Arguments

* `ordered_origin_group_member` (Required) - The [ordered_origin_group_member](#ordered-origin-group-member-arguments) that are in the group. There is a minimum of two ordered_origin_group_members, with the order determining failover priority
Copy link
Contributor

Choose a reason for hiding this comment

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

One last documentation update required since the schema was updated, but since it is very minor and everything else looks great, will fix this on merge so we can get this out there and start fixing some other (unrelated) aws_cloudfront_distribution bugs. 😄

@bflad bflad merged commit c3a70fa into hashicorp:master Mar 17, 2019
bflad added a commit that referenced this pull request Mar 17, 2019
…s to match PR #7202 changes

Also switches example references from `aws_s3_bucket.X.bucket_domain_name` to `aws_s3_bucket.X.bucket_regional_domain_name` to match the acceptance testing and prevent issues like #4540
bflad added a commit that referenced this pull request Mar 17, 2019
@bflad
Copy link
Contributor

bflad commented Mar 21, 2019

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

@ghost
Copy link

ghost commented Mar 31, 2020

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 and limited conversation to collaborators Mar 31, 2020
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. enhancement Requests to existing resources that expand the functionality or scope. 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.

Feature Request: Cloudfront Origin Failover
4 participants