Manages a LoadBalancer Probe Resource.
resource "azurerm_resource_group" "example" {
name = "LoadBalancerRG"
location = "West Europe"
}
resource "azurerm_public_ip" "example" {
name = "PublicIPForLB"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
allocation_method = "Static"
}
resource "azurerm_lb" "example" {
name = "TestLoadBalancer"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
frontend_ip_configuration {
name = "PublicIPAddress"
public_ip_address_id = azurerm_public_ip.example.id
}
}
resource "azurerm_lb_probe" "example" {
loadbalancer_id = azurerm_lb.example.id
name = "ssh-running-probe"
port = 22
}
The following arguments are supported:
name
- (Required) Specifies the name of the Probe. Changing this forces a new resource to be created.loadbalancer_id
- (Required) The ID of the LoadBalancer in which to create the Probe. 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. Defaults to Tcp
.port
- (Required) Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.probe_threshold
- (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
.request_path
- (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.interval_in_seconds
- (Optional) The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.number_of_probes
- (Optional) The number of failed probe attempts after which the backend endpoint is removed from rotation. Default to 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.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Load Balancer Probe.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.Load Balancer Probes can be imported using the resource id
, e.g.
terraform import azurerm_lb_probe.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1