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

Feature request: Update aws_lb_listener_rule to support new conditions #8441

Closed
facundovictor opened this issue Apr 25, 2019 · 4 comments
Closed
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@facundovictor
Copy link

facundovictor commented Apr 25, 2019

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 "me too" comments, 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

Description

The listener rules support new conditions, as explained from aws cli man:

          [
            {
              "Field": "string",
              "Values": ["string", ...],
              "HostHeaderConfig": {
                "Values": ["string", ...]
              },
              "PathPatternConfig": {
                "Values": ["string", ...]
              },
              "HttpHeaderConfig": {
                "HttpHeaderName": "string",
                "Values": ["string", ...]
              },
              "QueryStringConfig": {
                "Values": [
                  {
                    "Key": "string",
                    "Value": "string"
                  }
                  ...
                ]
              },
              "HttpRequestMethodConfig": {
                "Values": ["string", ...]
              },
              "SourceIpConfig": {
                "Values": ["string", ...]
              }
            }
            ...
          ]

New or Affected Resource(s)

aws_alb_listener_rule
aws_lb_listener_rule

Potential Terraform Configuration

resource "aws_lb_listener_rule" "myrule" {
  listener_arn = "${aws_lb_listener.mylistener.arn}"

  action {
    type = "redirect"

    redirect {
      port        = "443"
      protocol    = "HTTPS"
      status_code = "HTTP_301"
    }
  }

  # NOTE: Here I'm only adding conditions that are new!

  condition {
    field  = "http-header"
   
    # This would be optional
    values = ["my-header-value"] 

    # Optional: for when using http-header"
    http_header_name = "header-name"
  }

  condition {
    field  = "http-request-method"
   
    # This would be optional
    values = ["my-http-method"] 
  }

  condition {
    field  = "query-string"
   
    # This would be optional
    query_string_values = {
      key1 = "value1"
      key2 = "value2"
    }
  }

  condition {
    field  = "source-ip"

    # This would be optional
    values = ["10.0.0.1"] 
  }
}

References

https://aws.amazon.com/blogs/aws/new-advanced-request-routing-for-aws-application-load-balancers/

@facundovictor facundovictor added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 25, 2019
@facundovictor facundovictor changed the title Feature request: Update elbv2 listener rules to support new conditions Feature request: Update aws_lb_listener_rule to support new conditions Apr 25, 2019
@ewbankkit
Copy link
Contributor

I think this is a duplicate of #8126.

@facundovictor
Copy link
Author

Thanks @ewbankkit closing this one as duplicate of #8126

@kalyanreddy7833
Copy link

@facundovictor : hi , i couldn't see any new condition for path-pattern which supports multiple values. can you help me with an example. Appreciate for your help.

@ghost
Copy link

ghost commented Nov 3, 2019

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!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

No branches or pull requests

3 participants