Class LoadBalancerMonitor
If you're using Cloudflare's Load Balancing to load-balance across multiple origin servers or data centers, you configure one of these Monitors to actively check the availability of those servers over HTTP(S) or TCP.
Example Usage
HTTP Monitor
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
var httpMonitor = new Cloudflare.LoadBalancerMonitor("httpMonitor", new Cloudflare.LoadBalancerMonitorArgs
{
AllowInsecure = false,
Description = "example http load balancer",
ExpectedBody = "alive",
ExpectedCodes = "2xx",
FollowRedirects = true,
Headers =
{
new Cloudflare.Inputs.LoadBalancerMonitorHeaderArgs
{
Header = "Host",
Values =
{
"example.com",
},
},
},
Interval = 60,
Method = "GET",
Path = "/health",
Retries = 5,
Timeout = 7,
Type = "http",
});
}
}
TCP Monitor
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
var tcpMonitor = new Cloudflare.LoadBalancerMonitor("tcpMonitor", new Cloudflare.LoadBalancerMonitorArgs
{
Description = "example tcp load balancer",
Interval = 60,
Method = "connection_established",
Retries = 5,
Timeout = 7,
Type = "tcp",
});
}
}
Inherited Members
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class LoadBalancerMonitor : CustomResource
Constructors
View SourceLoadBalancerMonitor(String, LoadBalancerMonitorArgs, CustomResourceOptions)
Create a LoadBalancerMonitor resource with the given unique name, arguments, and options.
Declaration
public LoadBalancerMonitor(string name, LoadBalancerMonitorArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| LoadBalancerMonitorArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAllowInsecure
Do not validate the certificate when monitor use HTTPS. Only valid if type is "http" or "https".
Declaration
public Output<bool?> AllowInsecure { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
CreatedOn
The RFC3339 timestamp of when the load balancer monitor was created.
Declaration
public Output<string> CreatedOn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Free text description.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExpectedBody
A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if type is "http" or "https". Default: "".
Declaration
public Output<string> ExpectedBody { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExpectedCodes
The expected HTTP response code or code range of the health check. Eg 2xx. Only valid and required if type is "http" or "https".
Declaration
public Output<string> ExpectedCodes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
FollowRedirects
Follow redirects if returned by the origin. Only valid if type is "http" or "https".
Declaration
public Output<bool?> FollowRedirects { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Headers
The header name.
Declaration
public Output<ImmutableArray<LoadBalancerMonitorHeader>> Headers { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LoadBalancerMonitorHeader>> |
Interval
The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Default: 60.
Declaration
public Output<int?> Interval { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Method
The method to use for the health check. Valid values are any valid HTTP verb if type is "http" or "https", or connection_established if type is "tcp". Default: "GET" if type is "http" or "https", or "connection_established" if type is "tcp" .
Declaration
public Output<string> Method { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ModifiedOn
The RFC3339 timestamp of when the load balancer monitor was last modified.
Declaration
public Output<string> ModifiedOn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Path
The endpoint path to health check against. Default: "/". Only valid if type is "http" or "https".
Declaration
public Output<string> Path { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
Declaration
public Output<int?> Port { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Retries
The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2.
Declaration
public Output<int?> Retries { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Timeout
The timeout (in seconds) before marking the health check as failed. Default: 5.
Declaration
public Output<int?> Timeout { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Type
The protocol to use for the healthcheck. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'. Default: "http".
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, LoadBalancerMonitorState, CustomResourceOptions)
Get an existing LoadBalancerMonitor resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static LoadBalancerMonitor Get(string name, Input<string> id, LoadBalancerMonitorState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| LoadBalancerMonitorState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| LoadBalancerMonitor |