- 
                Notifications
    You must be signed in to change notification settings 
- Fork 9.8k
Closed
Labels
enhancementRequests to existing resources that expand the functionality or scope.Requests to existing resources that expand the functionality or scope.service/elbv2Issues and PRs that pertain to the elbv2 service.Issues and PRs that pertain to the elbv2 service.
Milestone
Description
Description
A new Transforms argument has been added to ELBv2 listener rules. I imagine this will be a new block in aws_lb_listener_rule.
Affected Resource(s) or Data Source(s)
- aws_lb_listener_rule
Potential Terraform Configuration
resource "aws_lb_listener_rule" "example" {
  listener_arn = aws_lb_listener.front_end.arn
  transform {
    type = "host-header-rewrite"
    host_header_rewrite {
      rewrites = [
        {
          regex = "^mywebsite-(.+).com$"
          replace = "internal.dev.$1.myweb.com"
        }
      ]
    }
  }
}
resource "aws_lb_listener_rule" "example" {
  listener_arn = aws_lb_listener.front_end.arn
  transform {
    type = "url-rewrite"
    url_rewrite {
      rewrites = [
        {
          regex = "^/dp/([A-Za-z0-9]+)/?$"
          replace = "product.php?id=$1"
        }
      ]
    }
  }
}References
API documentation: https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateRule.html
User documentation: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/rule-transforms.html
Would you like to implement the enhancement?
No
jeanguanda, rodrigorfk, koraven, leanenkaa, trevorrea and 31 more
Metadata
Metadata
Assignees
Labels
enhancementRequests to existing resources that expand the functionality or scope.Requests to existing resources that expand the functionality or scope.service/elbv2Issues and PRs that pertain to the elbv2 service.Issues and PRs that pertain to the elbv2 service.