FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_alb_listener_rule

Provides an Application Load Balancer Listener Rule resource.

Example Usage

# Create a new load balancer
resource "aws_alb" "front_end" {
  # Other parameters...
}

resource "aws_alb_listener" "front_end" {
  # Other parameters
}

resource "aws_alb_listener_rule" "static" {
  listener_arn = "${aws_alb_listener.front_end.arn}"
  priority = 100
  
  action {
    type = "forward"
    target_group_arn = "${aws_alb_target_group.static.arn}"
  }
  
  condition {
    field = "path-pattern"
    values = ["/static/*"]
  }
}

Argument Reference

The following arguments are supported:

Action Blocks (for default_action) support the following:

Condition Blocks (for default_action) support the following:

Attributes Reference

The following attributes are exported in addition to the arguments listed above:

Import

Rules can be imported using their ARN, e.g.

$ terraform import aws_alb_listener_rule.front_end arn:aws:elasticloadbalancing:us-west-2:187416307283:listener-rule/app/test/8e4497da625e2d8a/9ab28ade35828f96/67b3d2d36dd7c26b

See the source of this document at Terraform.io