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

Add example for cloudfront_distribution with s3 webhosting endpoint #5947

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gersilex
Copy link

The change adds another example with separate headers.

  • The AWS API (and the resource docs) were unclear about this and this commit clarifies it with an example.
  • Targets current Terraform version.

Fixes #4757

…e change adds another example with separate headers.The AWS API (and the resource docs) were unclear about this and this commit clarifies it with an example.Targets current Terraform version.Closes hashicorp#4757
@bflad bflad added documentation Introduces or discusses updates to documentation. service/s3 Issues and PRs that pertain to the s3 service. service/cloudfront Issues and PRs that pertain to the cloudfront service. and removed service/s3 Issues and PRs that pertain to the s3 service. labels Sep 20, 2018
query_string = false

cookies {
forward = "all"
Copy link
Contributor

Choose a reason for hiding this comment

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

you probably don't need to forward any cookies here, because s3 doesn't care if they are present. It will improve caching on Cloudfront. Same with most of the headers, except CORS ones.

Copy link
Author

Choose a reason for hiding this comment

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

The User-Agent custom_header is used as authentication for the S3 Website endpoint, so if you meant this header, we cannot remove it.

I will remove cookies block tomorrow and run the tests again, to see if it introduced any malbehaviour. Your suggestion sounds very reasonable, though, so I don't think we might expect any issues.

Copy link
Author

Choose a reason for hiding this comment

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

All tests were - of course - successful. Sorry for the delay. Changed the cookie forwarding to none in 754f0a8.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gersilex I actually meant this: https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#headers

However, I've checked that if you don't specify any value here, then it forwards no headers, which is good :)
So it's all good, sorry for confusion.

Copy link
Author

@gersilex gersilex left a comment

Choose a reason for hiding this comment

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

@ekini I added your recommendation and this Pull Request is ready for review again.

Copy link
Author

@gersilex gersilex left a comment

Choose a reason for hiding this comment

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

@ekini I added your recommendation and this Pull Request is ready for review again.

Copy link
Author

@gersilex gersilex left a comment

Choose a reason for hiding this comment

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

As soon as GitHub is fully up and running again, my latest commit 754f0a8 should appear and is ready to be reviewed again.

@ekini I changed the forwarding of cookies to none as suggested by you. As expected, all tests went fine here, sorry for the delay.

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Oct 23, 2018
austinbutler and others added 2 commits December 16, 2018 02:06
Co-Authored-By: gersilex <gersilex@gmail.com>
Co-Authored-By: gersilex <gersilex@gmail.com>
@gersilex
Copy link
Author

@austinbutler Your updates look great. Thank you very much.

@aeschright aeschright requested a review from a team June 25, 2019 21:32
Base automatically changed from master to main January 23, 2021 00:55
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:55
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. service/cloudfront Issues and PRs that pertain to the cloudfront service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TF Cloudfront (origin { domain_name ) not accepting s3 website_endpoint for s3 redirects
5 participants