Data Source: aws_lb

Provides information about a Load Balancer.

This data source can prove useful when a module accepts an LB as an input variable and needs to, for example, determine the security groups associated with it, etc.

Example Usage

variable "lb_arn" {
  type    = "string"
  default = ""
}

variable "lb_name" {
  type    = "string"
  default = ""
}

data "aws_lb" "test" {
  arn  = "${var.lb_arn}"
  name = "${var.lb_name}"
}

Argument Reference

The following arguments are supported:

  • arn - (Optional) The full ARN of the load balancer.
  • name - (Optional) The unique name of the load balancer.

Attributes Reference

See the LB Resource for details on the returned attributes - they are identical.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/lb.html