Skip to content

azurermLbBackendAddressPoolAddress

Manages a Backend Address within a Backend Address Pool.

-> Note: Backend Addresses can only be added to a standard SKU Load Balancer.

Example Usage

/*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",
  }
);
const dataAzurermLbBackendAddressPoolBackendPoolCr =
  new azurerm.dataAzurermLbBackendAddressPool.DataAzurermLbBackendAddressPool(
    this,
    "backend-pool-cr",
    {
      loadbalancer_id: dataAzurermLbExample.id,
      name: "globalLBBackendPool",
    }
  );
const dataAzurermLbBackendAddressPoolExample =
  new azurerm.dataAzurermLbBackendAddressPool.DataAzurermLbBackendAddressPool(
    this,
    "example_2",
    {
      loadbalancer_id: dataAzurermLbExample.id,
      name: "first",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermLbBackendAddressPoolExample.overrideLogicalId("example");
const dataAzurermVirtualNetworkExample =
  new azurerm.dataAzurermVirtualNetwork.DataAzurermVirtualNetwork(
    this,
    "example_3",
    {
      name: "example-network",
      resource_group_name: "example-resources",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermVirtualNetworkExample.overrideLogicalId("example");
const azurermLbBackendAddressPoolAddressExample =
  new azurerm.lbBackendAddressPoolAddress.LbBackendAddressPoolAddress(
    this,
    "example_4",
    {
      backend_address_pool_id: dataAzurermLbBackendAddressPoolExample.id,
      ip_address: "10.0.0.1",
      name: "example",
      virtual_network_id: dataAzurermVirtualNetworkExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLbBackendAddressPoolAddressExample.overrideLogicalId("example");
new azurerm.lbBackendAddressPoolAddress.LbBackendAddressPoolAddress(
  this,
  "example-1",
  {
    backend_address_ip_configuration_id:
      "${azurerm_lb.backend-lb-R1.frontend_ip_configuration[0].id}",
    backend_address_pool_id: dataAzurermLbBackendAddressPoolBackendPoolCr.id,
    name: "address1",
  }
);
new azurerm.lbBackendAddressPoolAddress.LbBackendAddressPoolAddress(
  this,
  "example-2",
  {
    backend_address_ip_configuration_id:
      "${azurerm_lb.backend-lb-R2.frontend_ip_configuration[0].id}",
    backend_address_pool_id: dataAzurermLbBackendAddressPoolBackendPoolCr.id,
    name: "address2",
  }
);

Arguments Reference

-> Note: Backend Addresses can only be added to a standard SKU Load Balancer. Cross region load balancer is for Load Balancer with global SKU.

The following arguments are supported:

  • backendAddressPoolId - (Required) The ID of the Backend Address Pool. Changing this forces a new Backend Address Pool Address to be created.

  • ipAddress - (Optional) The Static IP Address which should be allocated to this Backend Address Pool.

  • name - (Required) The name which should be used for this Backend Address Pool Address. Changing this forces a new Backend Address Pool Address to be created.

  • virtualNetworkId - (Optional) The ID of the Virtual Network within which the Backend Address Pool should exist.

  • backendAddressIpConfigurationId - (Optional) The ip config ID of the regional load balancer that's added to the global load balancer's backend address pool.

-> Note: For cross-region load balancer, please append the name of the load balancers, virtual machines, and other resources in each region with a -R1 and -R2.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Backend Address Pool Address.

  • inboundNatRulePortMapping - A list of inboundNatRulePortMapping block as defined below.


A inboundNatRulePortMapping block exports the following:

  • inboundNatRuleName - The name of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address.

  • frontendPort - The Frontend Port of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address.

  • backendPort - The Backend Port of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Backend Address Pool Address.
  • read - (Defaults to 5 minutes) Used when retrieving the Backend Address Pool Address.
  • update - (Defaults to 30 minutes) Used when updating the Backend Address Pool Address.
  • delete - (Defaults to 30 minutes) Used when deleting the Backend Address Pool Address.

Import

Backend Address Pool Addresses can be imported using the resourceId, e.g.

terraform import azurerm_lb_backend_address_pool_address.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/loadBalancer1/backendAddressPools/backendAddressPool1/addresses/address1