Data Source: azurermLb
Use this data source to access information about an existing Load Balancer
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 azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermLbExample = new azurerm.dataAzurermLb.DataAzurermLb(
this,
"example",
{
name: "example-lb",
resource_group_name: "example-resources",
}
);
new cdktf.TerraformOutput(this, "loadbalancer_id", {
value: dataAzurermLbExample.id,
});
Argument Reference
-
name- Specifies the name of the Load Balancer. -
resourceGroupName- The name of the Resource Group in which the Load Balancer exists.
Attributes Reference
The following attributes are exported:
-
id- The ID of the Load Balancer. -
frontendIpConfiguration- AfrontendIpConfigurationblock as documented below. -
location- The Azure location where the Load Balancer exists. -
privateIpAddress- The first private IP address assigned to the load balancer infrontendIpConfigurationblocks, if any. -
privateIpAddresses- The list of private IP address assigned to the load balancer infrontendIpConfigurationblocks, if any. -
sku- The SKU of the Load Balancer. -
tags- A mapping of tags assigned to the resource.
A frontendIpConfiguration block exports the following:
name- The name of the Frontend IP Configuration.id- The id of the Frontend IP Configuration.subnetId- The ID of the Subnet which is associated with the IP Configuration.privateIpAddress- Private IP Address to assign to the Load Balancer.privateIpAddressAllocation- The allocation method for the Private IP Address used by this Load Balancer.privateIpAddressVersion- The Private IP Address Version, eitheriPv4oriPv6.publicIpAddressId- The ID of a Public IP Address which is associated with this Load Balancer.zones- A list of Availability Zones which the Load Balancer's IP Addresses should be created in.
Timeouts
The timeouts block allows you to specify timeouts for certain actions:
read- (Defaults to 5 minutes) Used when retrieving the Load Balancer.