LoadBalancerMonitor

class LoadBalancerMonitor : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleLoadBalancerMonitor = new cloudflare.LoadBalancerMonitor("example_load_balancer_monitor", {
accountId: "023e105f4ecef8ad9ca31a8372d0c353",
allowInsecure: true,
consecutiveDown: 0,
consecutiveUp: 0,
description: "Login page monitor",
expectedBody: "alive",
expectedCodes: "2xx",
followRedirects: true,
header: {
Host: ["example.com"],
"X-App-ID": ["abc123"],
},
interval: 0,
method: "GET",
path: "/health",
port: 0,
probeZone: "example.com",
retries: 0,
timeout: 0,
type: "https",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_load_balancer_monitor = cloudflare.LoadBalancerMonitor("example_load_balancer_monitor",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
allow_insecure=True,
consecutive_down=0,
consecutive_up=0,
description="Login page monitor",
expected_body="alive",
expected_codes="2xx",
follow_redirects=True,
header={
"Host": ["example.com"],
"X-App-ID": ["abc123"],
},
interval=0,
method="GET",
path="/health",
port=0,
probe_zone="example.com",
retries=0,
timeout=0,
type="https")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleLoadBalancerMonitor = new Cloudflare.LoadBalancerMonitor("example_load_balancer_monitor", new()
{
AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
AllowInsecure = true,
ConsecutiveDown = 0,
ConsecutiveUp = 0,
Description = "Login page monitor",
ExpectedBody = "alive",
ExpectedCodes = "2xx",
FollowRedirects = true,
Header =
{
{ "Host", new[]
{
"example.com",
} },
{ "X-App-ID", new[]
{
"abc123",
} },
},
Interval = 0,
Method = "GET",
Path = "/health",
Port = 0,
ProbeZone = "example.com",
Retries = 0,
Timeout = 0,
Type = "https",
});
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.NewLoadBalancerMonitor(ctx, "example_load_balancer_monitor", &cloudflare.LoadBalancerMonitorArgs{
AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
AllowInsecure: pulumi.Bool(true),
ConsecutiveDown: pulumi.Int(0),
ConsecutiveUp: pulumi.Int(0),
Description: pulumi.String("Login page monitor"),
ExpectedBody: pulumi.String("alive"),
ExpectedCodes: pulumi.String("2xx"),
FollowRedirects: pulumi.Bool(true),
Header: pulumi.StringArrayMap{
"Host": pulumi.StringArray{
pulumi.String("example.com"),
},
"X-App-ID": pulumi.StringArray{
pulumi.String("abc123"),
},
},
Interval: pulumi.Int(0),
Method: pulumi.String("GET"),
Path: pulumi.String("/health"),
Port: pulumi.Int(0),
ProbeZone: pulumi.String("example.com"),
Retries: pulumi.Int(0),
Timeout: pulumi.Int(0),
Type: pulumi.String("https"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.LoadBalancerMonitor;
import com.pulumi.cloudflare.LoadBalancerMonitorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleLoadBalancerMonitor = new LoadBalancerMonitor("exampleLoadBalancerMonitor", LoadBalancerMonitorArgs.builder()
.accountId("023e105f4ecef8ad9ca31a8372d0c353")
.allowInsecure(true)
.consecutiveDown(0)
.consecutiveUp(0)
.description("Login page monitor")
.expectedBody("alive")
.expectedCodes("2xx")
.followRedirects(true)
.header(Map.ofEntries(
Map.entry("Host", "example.com"),
Map.entry("X-App-ID", "abc123")
))
.interval(0)
.method("GET")
.path("/health")
.port(0)
.probeZone("example.com")
.retries(0)
.timeout(0)
.type("https")
.build());
}
}
resources:
exampleLoadBalancerMonitor:
type: cloudflare:LoadBalancerMonitor
name: example_load_balancer_monitor
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
allowInsecure: true
consecutiveDown: 0
consecutiveUp: 0
description: Login page monitor
expectedBody: alive
expectedCodes: 2xx
followRedirects: true
header:
Host:
- example.com
X-App-ID:
- abc123
interval: 0
method: GET
path: /health
port: 0
probeZone: example.com
retries: 0
timeout: 0
type: https

Import

$ pulumi import cloudflare:index/loadBalancerMonitor:LoadBalancerMonitor example '<account_id>/<monitor_id>'

Properties

Link copied to clipboard
val accountId: Output<String>

Identifier

Link copied to clipboard
val allowInsecure: Output<Boolean>

Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val consecutiveDown: Output<Int>

To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.

Link copied to clipboard
val consecutiveUp: Output<Int>

To be marked healthy the monitored origin must pass this healthcheck N consecutive times.

Link copied to clipboard
val createdOn: Output<String>
Link copied to clipboard
val description: Output<String>?

Object description.

Link copied to clipboard
val expectedBody: Output<String>?

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. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val expectedCodes: Output<String>?

The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard

Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val header: Output<Map<String, List<String>>>?

The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val interval: Output<Int>

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.

Link copied to clipboard
val method: Output<String>

The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.

Link copied to clipboard
val modifiedOn: Output<String>
Link copied to clipboard
val path: Output<String>

The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val port: Output<Int>

The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).

Link copied to clipboard
val probeZone: Output<String>?

Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val retries: Output<Int>

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

Link copied to clipboard
val timeout: Output<Int>

The timeout (in seconds) before marking the health check as failed.

Link copied to clipboard
val type: Output<String>

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. Available values: "http", "https", "tcp", "udpicmp", "icmpping", "smtp".

Link copied to clipboard
val urn: Output<String>