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

Cannot create multiple host-header conditions for ALB Rules #12034

Closed
gavinharcourt opened this issue Feb 13, 2020 · 2 comments
Closed

Cannot create multiple host-header conditions for ALB Rules #12034

gavinharcourt opened this issue Feb 13, 2020 · 2 comments
Labels
service/elbv2 Issues and PRs that pertain to the elbv2 service.

Comments

@gavinharcourt
Copy link

gavinharcourt commented Feb 13, 2020

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 Version

Terraform v0.12.20
+ provider.aws v2.48.0
+ provider.template v2.1.2

Affected Resource(s)

  • aws_lb_listener_rule

Terraform Configuration Files

resource "aws_lb_listener_rule" "this" {
  action {
    type             = "forward"
    target_group_arn = aws_alb_target_group.target-group.arn
  }

  condition {
    field  = "host-header"
    values = ["api-${local.unique_key}.${var.hosted_zone}", "api-shared-staging.${var.hosted_zone}"]
  }

  listener_arn = data.aws_lb_listener.load-balancer-listener.arn
}

Expected Behavior

Created an ALB rule with a multi-condition host-pattern - this is possible to do in the console.

Actual Behavior

Error: condition.0.values: attribute supports 1 item maximum, config has 2 declared

I had expected this to work as 2.42.0 was supposed to include the release of #8126 which I believe would cover this use case.

@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Feb 13, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 13, 2020
@gavinharcourt
Copy link
Author

I've just realised that I updated the deprecated format of defining a condition instead of copying the new example present on the documentation page:

My broken config:

  condition {
    field  = "host-header"
    values = var.host_names
  }

What I should have done:

  condition {
    host_header {
      values = var.host_names
    }
  }

@ghost
Copy link

ghost commented Mar 27, 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!

@hashicorp hashicorp locked and limited conversation to collaborators Mar 27, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

No branches or pull requests

2 participants