terraform/website/source/docs/providers/aws/d/alb.html.markdown

1.0 KiB

layout page_title sidebar_current description
aws AWS: aws_alb docs-aws-datasource-alb-x Provides an Application Load Balancer data source.

aws_alb

Provides information about an Application Load Balancer.

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

Example Usage

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

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

data "aws_alb" "test" {
  arn  = "${var.alb_arn}"
  name = "${var.alb_arn}"
}

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.

~> NOTE: When both arn and name are specified, arn takes precedence.

Attributes Reference

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