Skip to content

awsElb

Provides information about a "classic" Elastic Load Balancer (ELB). See LB Data Source if you are looking for "v2" Application Load Balancer (ALB) or Network Load Balancer (NLB).

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

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
/*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK.
You can read more about this at https://cdk.tf/variables*/
const lbName = new cdktf.TerraformVariable(this, "lb_name", {
  default: "",
});
new aws.dataAwsElb.DataAwsElb(this, "test", {
  name: lbName.value,
});

Argument Reference

The following arguments are supported:

  • name - (Required) Unique name of the load balancer.

Attributes Reference

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