Data Source: aws_lb_target_group

Provides information about a Load Balancer Target Group.

This data source can prove useful when a module accepts an LB Target Group as an input variable and needs to know its attributes. It can also be used to get the ARN of an LB Target Group for use in other resources, given LB Target Group name.

Example Usage

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

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

data "aws_lb_target_group" "test" {
  arn  = "${var.lb_tg_arn}"
  name = "${var.lb_tg_name}"
}

Argument Reference

The following arguments are supported:

  • arn - (Optional) The full ARN of the target group.
  • name - (Optional) The unique name of the target group.

Attributes Reference

See the LB Target Group 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_target_group.html