FEATURES PRICING ABOUT DOCS LOGIN

aws_alb

Provides an Application Load Balancer resource.

Example Usage

# Create a new load balancer
resource "aws_alb" "test" {
  name            = "test-alb-tf"
  internal        = false
  security_groups = ["${aws_security_group.alb_sg.id}"]
  subnets         = ["${aws_subnet.public.*.id}"]

  enable_deletion_protection = true

  access_logs {
    bucket = "${aws_s3_bucket.alb_logs.bucket}"
    prefix = "test-alb"
  }

  tags {
    Environment = "production"
  }
}

Argument Reference

The following arguments are supported:

Access Logs (access_logs) support the following:

Attributes Reference

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

Import

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

$ terraform import aws_alb.bar arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188

See the source of this document at Terraform.io

REQUEST A DEMO