FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_alb_listener

Provides an Application Load Balancer Listener resource.

Example Usage

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

resource "aws_alb_target_group" "front_end" {
  # Other parameters...
}

resource "aws_alb_listener" "front_end" {
   load_balancer_arn = "${aws_alb.front_end.arn}"
   port = "443"
   protocol = "HTTPS"
   ssl_policy = "ELBSecurityPolicy-2015-05"
   certificate_arn = "arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4"
   
   default_action {
     target_group_arn = "${aws_alb_target_group.front_end.arn}"
     type = "forward"
   }
}

Argument Reference

The following arguments are supported:

Action Blocks (for default_action) support the following:

Attributes Reference

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

Import

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

$ terraform import aws_alb_listener.front_end arn:aws:elasticloadbalancing:us-west-2:187416307283:listener/app/front-end-alb/8e4497da625e2d8a/9ab28ade35828f96

See the source of this document at Terraform.io