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

Query in redirect block of resource aws_lb_listener_rule can no longer be empty #19475

Closed
ballock opened this issue May 21, 2021 · 2 comments
Closed
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service.

Comments

@ballock
Copy link

ballock commented May 21, 2021

After commit b3c7930 it is no longer possible to create an aws_lb_listener_rule that redirects to another URL and skips the query entirely. It used to be possible to create a "" query. A null query field defaults to "#{query}", which forwards the ?query=string to the new website. Skipping the query value does the same.

Terraform CLI and Terraform AWS Provider Version

Tested with Terraform 0.15.4. Affected AWS Provider versions from 3.40 to git master.

Affected Resource(s)

  • aws_lb_listener_rule

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_lb_listener_rule" "my_redirect_rule" {
  listener_arn = aws_lb_listener.my_listener.arn
  priority     = 1

  condition {
    host_header {
      values = ["old.example.com"]
    }
  }

  action {
    type             = "redirect"

    redirect {
      protocol    = "HTTPS"
      port        = "443"
      host        = "new.example.com"
      path        = "/"
      query       = ""
      status_code = "HTTP_301"
    }

  }
}

Expected Behavior

The query field in redirect should be set to empty.

Actual Behavior

│ Error: expected length of action.0.redirect.0.query to be in the range (1 - 128), got 
│ 
│   with aws_lb_listener_rule.my_redirect_rule,
│   on example_rules.tf line 19, in resource "aws_lb_listener_rule" "my_redirect_rule":
│  19:       query       = ""

Steps to Reproduce

  1. terraform apply

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label May 21, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 21, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 21, 2021
@ewbankkit
Copy link
Contributor

@ballock Thanks for raising this issue.
It has already been noticed in #19376. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

No branches or pull requests

2 participants