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

'redirect_all_requests_to' stripping query string #16454

Closed
FireBall1725 opened this issue Oct 25, 2017 · 5 comments
Closed

'redirect_all_requests_to' stripping query string #16454

FireBall1725 opened this issue Oct 25, 2017 · 5 comments

Comments

@FireBall1725
Copy link

FireBall1725 commented Oct 25, 2017

When creating an S3 bucket to do a site redirect I am running into an issue where the redirect_all_requests_to option will strip out any querystrings.

for example:

redirect_all_requests_to = "https://www.foo.com?bar=test"

will save the following on S3

Hostname: www.foo.com
Protocol: https

The following shows up in the debug logs

module.website.aws_s3_bucket.website_bucket: Modifying... (ID: www.domain.com)
  website.0.redirect_all_requests_to: "https://login.domain.com/idp/startSSO.ping" => "https://login.domain.com/idp/startSSO.ping?PartnerSpId=https%3A%2F%2Fapp.service.com"
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: 2017/10/25 13:33:29 [DEBUG] S3 put bucket website: {
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:   Bucket: "www.domain.com",
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:   WebsiteConfiguration: {
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:     RedirectAllRequestsTo: {
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:       HostName: "login.domain.com/idp/startSSO.ping",
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:       Protocol: "https"
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:     }
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4:   }
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: }
2017-10-25T13:33:29.525-0700 [DEBUG] plugin.terraform-provider-aws_v1.1.0_x4: 2017/10/25 13:33:29 [DEBUG] Waiting for state to become: [success]

So you can see it detects that the url is incorrect, so it updates it to the correct url, but it doesn't actually save it, it strips everything after the query string.

(I changed the domain name in the example above to obfuscate what this is for)

I am running the latest version of Terraform

@FireBall1725
Copy link
Author

FireBall1725 commented Oct 25, 2017

I should mention that if i do it with the ruby api in a manual application, that it does work as expected.

http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Types/RedirectAllRequestsTo.html

Or if i go to the AWS console and manually update the url in there.

@FireBall1725
Copy link
Author

Confirmed that PR#2059 does resolve my issue

@FireBall1725
Copy link
Author

pasted_image_at_2017_10_25_03_33_pm_480 copy

@hashibot
Copy link
Contributor

This issue has been automatically migrated to hashicorp/terraform-provider-aws#2061 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to this issue and let us know.

@ghost
Copy link

ghost commented Apr 6, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants