Skip to content

azurermLbProbe

Manages a LoadBalancer Probe Resource.

\~> NOTE When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached

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 azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "LoadBalancerRG",
  }
);
const azurermPublicIpExample = new azurerm.publicIp.PublicIp(
  this,
  "example_1",
  {
    allocation_method: "Static",
    location: azurermResourceGroupExample.location,
    name: "PublicIPForLB",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermPublicIpExample.overrideLogicalId("example");
const azurermLbExample = new azurerm.lb.Lb(this, "example_2", {
  frontend_ip_configuration: [
    {
      name: "PublicIPAddress",
      public_ip_address_id: azurermPublicIpExample.id,
    },
  ],
  location: azurermResourceGroupExample.location,
  name: "TestLoadBalancer",
  resource_group_name: azurermResourceGroupExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLbExample.overrideLogicalId("example");
const azurermLbProbeExample = new azurerm.lbProbe.LbProbe(this, "example_3", {
  loadbalancer_id: azurermLbExample.id,
  name: "ssh-running-probe",
  port: 22,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLbProbeExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Probe. Changing this forces a new resource to be created.
  • loadbalancerId - (Required) The ID of the LoadBalancer in which to create the NAT Rule. Changing this forces a new resource to be created.
  • protocol - (Optional) Specifies the protocol of the end point. Possible values are http, https or tcp. If TCP is specified, a received ACK is required for the probe to be successful. If HTTP is specified, a 200 OK response from the specified URI is required for the probe to be successful.
  • port - (Required) Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.
  • probeThreshold - (Optional) The number of consecutive successful or failed probes that allow or deny traffic to this endpoint. Possible values range from 1 to 100. The default value is 1.
  • requestPath - (Optional) The URI used for requesting health status from the backend endpoint. Required if protocol is set to http or https. Otherwise, it is not allowed.
  • intervalInSeconds - (Optional) The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.
  • numberOfProbes - (Optional) The number of failed probe attempts after which the backend endpoint is removed from rotation. The default value is 2. NumberOfProbes multiplied by intervalInSeconds value must be greater or equal to 10.Endpoints are returned to rotation when at least one probe is successful.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Load Balancer Probe.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Load Balancer Probe.
  • update - (Defaults to 30 minutes) Used when updating the Load Balancer Probe.
  • read - (Defaults to 5 minutes) Used when retrieving the Load Balancer Probe.
  • delete - (Defaults to 30 minutes) Used when deleting the Load Balancer Probe.

Import

Load Balancer Probes can be imported using the resourceId, e.g.

terraform import azurerm_lb_probe.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1