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

aws_lb_listener_rule doesn't allow blank query since 3.40.0 #19376

Closed
alext opened this issue May 14, 2021 · 3 comments · Fixed by #19496
Closed

aws_lb_listener_rule doesn't allow blank query since 3.40.0 #19376

alext opened this issue May 14, 2021 · 3 comments · Fixed by #19496
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@alext
Copy link
Contributor

alext commented May 14, 2021

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

Terraform CLI and Terraform AWS Provider Version

Terraform: 0.13.6
AWS provider: 3.40.0

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" "bare_domain_redirect" {
  listener_arn = aws_lb_listener.example.arn

  action {
    type = "redirect"

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

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

Expected Behavior

Terraform should validate this correctly as it did in provider versions prior to 3.40.0.

Actual Behavior

terraform validate produced the following error:

Error: expected length of action.0.redirect.0.query to be in the range (1 - 128), got

  on redirect.tf line 12, in resource "aws_lb_listener_rule" "bare_domain_redirect":
  12:       query       = ""

Steps to Reproduce

  1. terraform validate

Important Factoids

It's necessary to specify a blank query parameter here to override the default value of "#{query}" which will preserve any query parameters in the original request. In this instance we don't want the redirect destination to include any parameters from the original request.

References

This looks to have been introduced in #19285 - opening this issue as requested there.

@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label May 14, 2021
@bill-rich bill-rich added the bug Addresses a defect in current functionality. label May 14, 2021
@julian-alarcon
Copy link

julian-alarcon commented May 21, 2021

Terraform 0.13.7 is affected too. As a workaround I needed to pin the version to 3.39

    aws = {
      source  = "hashicorp/aws"
      version = "3.39" # Pinned version to avoid bug https://github.com/hashicorp/terraform-provider-aws/issues/19376
    }

@ewbankkit ewbankkit added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label May 21, 2021
@ewbankkit ewbankkit self-assigned this May 21, 2021
@github-actions github-actions bot added this to the v3.43.0 milestone May 26, 2021
@ghost
Copy link

ghost commented Jun 1, 2021

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

github-actions bot commented Jul 2, 2021

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 Jul 2, 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. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
4 participants