cloudflare.Healthcheck
Explore with Pulumi AI
Standalone Health Checks provide a way to monitor origin servers without needing a Cloudflare Load Balancer.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
// HTTPS Healthcheck
const httpHealthCheck = new cloudflare.Healthcheck("http_health_check", {
zoneId: cloudflareZoneId,
name: "http-health-check",
description: "example http health check",
address: "example.com",
suspended: false,
checkRegions: [
"WEU",
"EEU",
],
type: "HTTPS",
port: 443,
method: "GET",
path: "/health",
expectedBody: "alive",
expectedCodes: [
"2xx",
"301",
],
followRedirects: true,
allowInsecure: false,
headers: [{
header: "Host",
values: ["example.com"],
}],
timeout: 10,
retries: 2,
interval: 60,
consecutiveFails: 3,
consecutiveSuccesses: 2,
});
// TCP Healthcheck
const tcpHealthCheck = new cloudflare.Healthcheck("tcp_health_check", {
zoneId: cloudflareZoneId,
name: "tcp-health-check",
description: "example tcp health check",
address: "example.com",
suspended: false,
checkRegions: [
"WEU",
"EEU",
],
type: "TCP",
port: 22,
method: "connection_established",
timeout: 10,
retries: 2,
interval: 60,
consecutiveFails: 3,
consecutiveSuccesses: 2,
});
import pulumi
import pulumi_cloudflare as cloudflare
# HTTPS Healthcheck
http_health_check = cloudflare.Healthcheck("http_health_check",
zone_id=cloudflare_zone_id,
name="http-health-check",
description="example http health check",
address="example.com",
suspended=False,
check_regions=[
"WEU",
"EEU",
],
type="HTTPS",
port=443,
method="GET",
path="/health",
expected_body="alive",
expected_codes=[
"2xx",
"301",
],
follow_redirects=True,
allow_insecure=False,
headers=[{
"header": "Host",
"values": ["example.com"],
}],
timeout=10,
retries=2,
interval=60,
consecutive_fails=3,
consecutive_successes=2)
# TCP Healthcheck
tcp_health_check = cloudflare.Healthcheck("tcp_health_check",
zone_id=cloudflare_zone_id,
name="tcp-health-check",
description="example tcp health check",
address="example.com",
suspended=False,
check_regions=[
"WEU",
"EEU",
],
type="TCP",
port=22,
method="connection_established",
timeout=10,
retries=2,
interval=60,
consecutive_fails=3,
consecutive_successes=2)
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// HTTPS Healthcheck
_, err := cloudflare.NewHealthcheck(ctx, "http_health_check", &cloudflare.HealthcheckArgs{
ZoneId: pulumi.Any(cloudflareZoneId),
Name: pulumi.String("http-health-check"),
Description: pulumi.String("example http health check"),
Address: pulumi.String("example.com"),
Suspended: pulumi.Bool(false),
CheckRegions: pulumi.StringArray{
pulumi.String("WEU"),
pulumi.String("EEU"),
},
Type: pulumi.String("HTTPS"),
Port: pulumi.Int(443),
Method: pulumi.String("GET"),
Path: pulumi.String("/health"),
ExpectedBody: pulumi.String("alive"),
ExpectedCodes: pulumi.StringArray{
pulumi.String("2xx"),
pulumi.String("301"),
},
FollowRedirects: pulumi.Bool(true),
AllowInsecure: pulumi.Bool(false),
Headers: cloudflare.HealthcheckHeaderArray{
&cloudflare.HealthcheckHeaderArgs{
Header: pulumi.String("Host"),
Values: pulumi.StringArray{
pulumi.String("example.com"),
},
},
},
Timeout: pulumi.Int(10),
Retries: pulumi.Int(2),
Interval: pulumi.Int(60),
ConsecutiveFails: pulumi.Int(3),
ConsecutiveSuccesses: pulumi.Int(2),
})
if err != nil {
return err
}
// TCP Healthcheck
_, err = cloudflare.NewHealthcheck(ctx, "tcp_health_check", &cloudflare.HealthcheckArgs{
ZoneId: pulumi.Any(cloudflareZoneId),
Name: pulumi.String("tcp-health-check"),
Description: pulumi.String("example tcp health check"),
Address: pulumi.String("example.com"),
Suspended: pulumi.Bool(false),
CheckRegions: pulumi.StringArray{
pulumi.String("WEU"),
pulumi.String("EEU"),
},
Type: pulumi.String("TCP"),
Port: pulumi.Int(22),
Method: pulumi.String("connection_established"),
Timeout: pulumi.Int(10),
Retries: pulumi.Int(2),
Interval: pulumi.Int(60),
ConsecutiveFails: pulumi.Int(3),
ConsecutiveSuccesses: pulumi.Int(2),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
// HTTPS Healthcheck
var httpHealthCheck = new Cloudflare.Healthcheck("http_health_check", new()
{
ZoneId = cloudflareZoneId,
Name = "http-health-check",
Description = "example http health check",
Address = "example.com",
Suspended = false,
CheckRegions = new[]
{
"WEU",
"EEU",
},
Type = "HTTPS",
Port = 443,
Method = "GET",
Path = "/health",
ExpectedBody = "alive",
ExpectedCodes = new[]
{
"2xx",
"301",
},
FollowRedirects = true,
AllowInsecure = false,
Headers = new[]
{
new Cloudflare.Inputs.HealthcheckHeaderArgs
{
Header = "Host",
Values = new[]
{
"example.com",
},
},
},
Timeout = 10,
Retries = 2,
Interval = 60,
ConsecutiveFails = 3,
ConsecutiveSuccesses = 2,
});
// TCP Healthcheck
var tcpHealthCheck = new Cloudflare.Healthcheck("tcp_health_check", new()
{
ZoneId = cloudflareZoneId,
Name = "tcp-health-check",
Description = "example tcp health check",
Address = "example.com",
Suspended = false,
CheckRegions = new[]
{
"WEU",
"EEU",
},
Type = "TCP",
Port = 22,
Method = "connection_established",
Timeout = 10,
Retries = 2,
Interval = 60,
ConsecutiveFails = 3,
ConsecutiveSuccesses = 2,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Healthcheck;
import com.pulumi.cloudflare.HealthcheckArgs;
import com.pulumi.cloudflare.inputs.HealthcheckHeaderArgs;
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) {
// HTTPS Healthcheck
var httpHealthCheck = new Healthcheck("httpHealthCheck", HealthcheckArgs.builder()
.zoneId(cloudflareZoneId)
.name("http-health-check")
.description("example http health check")
.address("example.com")
.suspended(false)
.checkRegions(
"WEU",
"EEU")
.type("HTTPS")
.port(443)
.method("GET")
.path("/health")
.expectedBody("alive")
.expectedCodes(
"2xx",
"301")
.followRedirects(true)
.allowInsecure(false)
.headers(HealthcheckHeaderArgs.builder()
.header("Host")
.values("example.com")
.build())
.timeout(10)
.retries(2)
.interval(60)
.consecutiveFails(3)
.consecutiveSuccesses(2)
.build());
// TCP Healthcheck
var tcpHealthCheck = new Healthcheck("tcpHealthCheck", HealthcheckArgs.builder()
.zoneId(cloudflareZoneId)
.name("tcp-health-check")
.description("example tcp health check")
.address("example.com")
.suspended(false)
.checkRegions(
"WEU",
"EEU")
.type("TCP")
.port(22)
.method("connection_established")
.timeout(10)
.retries(2)
.interval(60)
.consecutiveFails(3)
.consecutiveSuccesses(2)
.build());
}
}
resources:
# HTTPS Healthcheck
httpHealthCheck:
type: cloudflare:Healthcheck
name: http_health_check
properties:
zoneId: ${cloudflareZoneId}
name: http-health-check
description: example http health check
address: example.com
suspended: false
checkRegions:
- WEU
- EEU
type: HTTPS
port: 443
method: GET
path: /health
expectedBody: alive
expectedCodes:
- 2xx
- '301'
followRedirects: true
allowInsecure: false
headers:
- header: Host
values:
- example.com
timeout: 10
retries: 2
interval: 60
consecutiveFails: 3
consecutiveSuccesses: 2
# TCP Healthcheck
tcpHealthCheck:
type: cloudflare:Healthcheck
name: tcp_health_check
properties:
zoneId: ${cloudflareZoneId}
name: tcp-health-check
description: example tcp health check
address: example.com
suspended: false
checkRegions:
- WEU
- EEU
type: TCP
port: 22
method: connection_established
timeout: 10
retries: 2
interval: 60
consecutiveFails: 3
consecutiveSuccesses: 2
Create Healthcheck Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Healthcheck(name: string, args: HealthcheckArgs, opts?: CustomResourceOptions);
@overload
def Healthcheck(resource_name: str,
args: HealthcheckArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Healthcheck(resource_name: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
zone_id: Optional[str] = None,
type: Optional[str] = None,
name: Optional[str] = None,
interval: Optional[int] = None,
method: Optional[str] = None,
expected_body: Optional[str] = None,
expected_codes: Optional[Sequence[str]] = None,
follow_redirects: Optional[bool] = None,
headers: Optional[Sequence[HealthcheckHeaderArgs]] = None,
consecutive_successes: Optional[int] = None,
description: Optional[str] = None,
consecutive_fails: Optional[int] = None,
path: Optional[str] = None,
port: Optional[int] = None,
retries: Optional[int] = None,
suspended: Optional[bool] = None,
timeout: Optional[int] = None,
check_regions: Optional[Sequence[str]] = None,
allow_insecure: Optional[bool] = None)
func NewHealthcheck(ctx *Context, name string, args HealthcheckArgs, opts ...ResourceOption) (*Healthcheck, error)
public Healthcheck(string name, HealthcheckArgs args, CustomResourceOptions? opts = null)
public Healthcheck(String name, HealthcheckArgs args)
public Healthcheck(String name, HealthcheckArgs args, CustomResourceOptions options)
type: cloudflare:Healthcheck
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args HealthcheckArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args HealthcheckArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HealthcheckArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HealthcheckArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HealthcheckArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var healthcheckResource = new Cloudflare.Healthcheck("healthcheckResource", new()
{
Address = "string",
ZoneId = "string",
Type = "string",
Name = "string",
Interval = 0,
Method = "string",
ExpectedBody = "string",
ExpectedCodes = new[]
{
"string",
},
FollowRedirects = false,
Headers = new[]
{
new Cloudflare.Inputs.HealthcheckHeaderArgs
{
Header = "string",
Values = new[]
{
"string",
},
},
},
ConsecutiveSuccesses = 0,
Description = "string",
ConsecutiveFails = 0,
Path = "string",
Port = 0,
Retries = 0,
Suspended = false,
Timeout = 0,
CheckRegions = new[]
{
"string",
},
AllowInsecure = false,
});
example, err := cloudflare.NewHealthcheck(ctx, "healthcheckResource", &cloudflare.HealthcheckArgs{
Address: pulumi.String("string"),
ZoneId: pulumi.String("string"),
Type: pulumi.String("string"),
Name: pulumi.String("string"),
Interval: pulumi.Int(0),
Method: pulumi.String("string"),
ExpectedBody: pulumi.String("string"),
ExpectedCodes: pulumi.StringArray{
pulumi.String("string"),
},
FollowRedirects: pulumi.Bool(false),
Headers: cloudflare.HealthcheckHeaderArray{
&cloudflare.HealthcheckHeaderArgs{
Header: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
ConsecutiveSuccesses: pulumi.Int(0),
Description: pulumi.String("string"),
ConsecutiveFails: pulumi.Int(0),
Path: pulumi.String("string"),
Port: pulumi.Int(0),
Retries: pulumi.Int(0),
Suspended: pulumi.Bool(false),
Timeout: pulumi.Int(0),
CheckRegions: pulumi.StringArray{
pulumi.String("string"),
},
AllowInsecure: pulumi.Bool(false),
})
var healthcheckResource = new Healthcheck("healthcheckResource", HealthcheckArgs.builder()
.address("string")
.zoneId("string")
.type("string")
.name("string")
.interval(0)
.method("string")
.expectedBody("string")
.expectedCodes("string")
.followRedirects(false)
.headers(HealthcheckHeaderArgs.builder()
.header("string")
.values("string")
.build())
.consecutiveSuccesses(0)
.description("string")
.consecutiveFails(0)
.path("string")
.port(0)
.retries(0)
.suspended(false)
.timeout(0)
.checkRegions("string")
.allowInsecure(false)
.build());
healthcheck_resource = cloudflare.Healthcheck("healthcheckResource",
address="string",
zone_id="string",
type="string",
name="string",
interval=0,
method="string",
expected_body="string",
expected_codes=["string"],
follow_redirects=False,
headers=[{
"header": "string",
"values": ["string"],
}],
consecutive_successes=0,
description="string",
consecutive_fails=0,
path="string",
port=0,
retries=0,
suspended=False,
timeout=0,
check_regions=["string"],
allow_insecure=False)
const healthcheckResource = new cloudflare.Healthcheck("healthcheckResource", {
address: "string",
zoneId: "string",
type: "string",
name: "string",
interval: 0,
method: "string",
expectedBody: "string",
expectedCodes: ["string"],
followRedirects: false,
headers: [{
header: "string",
values: ["string"],
}],
consecutiveSuccesses: 0,
description: "string",
consecutiveFails: 0,
path: "string",
port: 0,
retries: 0,
suspended: false,
timeout: 0,
checkRegions: ["string"],
allowInsecure: false,
});
type: cloudflare:Healthcheck
properties:
address: string
allowInsecure: false
checkRegions:
- string
consecutiveFails: 0
consecutiveSuccesses: 0
description: string
expectedBody: string
expectedCodes:
- string
followRedirects: false
headers:
- header: string
values:
- string
interval: 0
method: string
name: string
path: string
port: 0
retries: 0
suspended: false
timeout: 0
type: string
zoneId: string
Healthcheck Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Healthcheck resource accepts the following input properties:
- Address string
- The hostname or IP address of the origin server to run health checks on.
- Name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- Type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Allow
Insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - Check
Regions List<string> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - Consecutive
Fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - Consecutive
Successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - Description string
- A human-readable description of the health check.
- Expected
Body 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.
- Expected
Codes List<string> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- Follow
Redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - Headers
List<Healthcheck
Header> - 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.
- Interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - Method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - Path string
- The endpoint path to health check against. Defaults to
/
. - Port int
- Port number to connect to for the health check. Defaults to
80
. - Retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - Suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - Timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
- Address string
- The hostname or IP address of the origin server to run health checks on.
- Name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- Type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Allow
Insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - Check
Regions []string - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - Consecutive
Fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - Consecutive
Successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - Description string
- A human-readable description of the health check.
- Expected
Body 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.
- Expected
Codes []string - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- Follow
Redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - Headers
[]Healthcheck
Header Args - 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.
- Interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - Method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - Path string
- The endpoint path to health check against. Defaults to
/
. - Port int
- Port number to connect to for the health check. Defaults to
80
. - Retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - Suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - Timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
- address String
- The hostname or IP address of the origin server to run health checks on.
- name String
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- type String
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- allow
Insecure Boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions List<String> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails Integer - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes Integer - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - description String
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes List<String> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects Boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
List<Healthcheck
Header> - 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.
- interval Integer
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method String
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - path String
- The endpoint path to health check against. Defaults to
/
. - port Integer
- Port number to connect to for the health check. Defaults to
80
. - retries Integer
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended Boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout Integer
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
- address string
- The hostname or IP address of the origin server to run health checks on.
- name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- allow
Insecure boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions string[] - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails number - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes number - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - description string
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes string[] - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
Healthcheck
Header[] - 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.
- interval number
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - path string
- The endpoint path to health check against. Defaults to
/
. - port number
- Port number to connect to for the health check. Defaults to
80
. - retries number
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout number
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
- address str
- The hostname or IP address of the origin server to run health checks on.
- name str
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- type str
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- allow_
insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check_
regions Sequence[str] - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive_
fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive_
successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - description str
- A human-readable description of the health check.
- expected_
body str - 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.
- expected_
codes Sequence[str] - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow_
redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
Sequence[Healthcheck
Header Args] - 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.
- interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method str
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - path str
- The endpoint path to health check against. Defaults to
/
. - port int
- Port number to connect to for the health check. Defaults to
80
. - retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
- address String
- The hostname or IP address of the origin server to run health checks on.
- name String
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- type String
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- allow
Insecure Boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions List<String> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails Number - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes Number - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - description String
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes List<String> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects Boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers List<Property Map>
- 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.
- interval Number
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method String
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - path String
- The endpoint path to health check against. Defaults to
/
. - port Number
- Port number to connect to for the health check. Defaults to
80
. - retries Number
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended Boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout Number
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Healthcheck resource produces the following output properties:
- Created
On string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Last modified time.
- Created
On string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Last modified time.
- created
On String - Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Last modified time.
- created
On string - Creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - Last modified time.
- created_
on str - Creation time.
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
on str - Last modified time.
- created
On String - Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Last modified time.
Look up Existing Healthcheck Resource
Get an existing Healthcheck resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: HealthcheckState, opts?: CustomResourceOptions): Healthcheck
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
allow_insecure: Optional[bool] = None,
check_regions: Optional[Sequence[str]] = None,
consecutive_fails: Optional[int] = None,
consecutive_successes: Optional[int] = None,
created_on: Optional[str] = None,
description: Optional[str] = None,
expected_body: Optional[str] = None,
expected_codes: Optional[Sequence[str]] = None,
follow_redirects: Optional[bool] = None,
headers: Optional[Sequence[HealthcheckHeaderArgs]] = None,
interval: Optional[int] = None,
method: Optional[str] = None,
modified_on: Optional[str] = None,
name: Optional[str] = None,
path: Optional[str] = None,
port: Optional[int] = None,
retries: Optional[int] = None,
suspended: Optional[bool] = None,
timeout: Optional[int] = None,
type: Optional[str] = None,
zone_id: Optional[str] = None) -> Healthcheck
func GetHealthcheck(ctx *Context, name string, id IDInput, state *HealthcheckState, opts ...ResourceOption) (*Healthcheck, error)
public static Healthcheck Get(string name, Input<string> id, HealthcheckState? state, CustomResourceOptions? opts = null)
public static Healthcheck get(String name, Output<String> id, HealthcheckState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Address string
- The hostname or IP address of the origin server to run health checks on.
- Allow
Insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - Check
Regions List<string> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - Consecutive
Fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - Consecutive
Successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - Created
On string - Creation time.
- Description string
- A human-readable description of the health check.
- Expected
Body 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.
- Expected
Codes List<string> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- Follow
Redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - Headers
List<Healthcheck
Header> - 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.
- Interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - Method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - Modified
On string - Last modified time.
- Name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- Path string
- The endpoint path to health check against. Defaults to
/
. - Port int
- Port number to connect to for the health check. Defaults to
80
. - Retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - Suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - Timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - Type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Address string
- The hostname or IP address of the origin server to run health checks on.
- Allow
Insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - Check
Regions []string - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - Consecutive
Fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - Consecutive
Successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - Created
On string - Creation time.
- Description string
- A human-readable description of the health check.
- Expected
Body 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.
- Expected
Codes []string - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- Follow
Redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - Headers
[]Healthcheck
Header Args - 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.
- Interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - Method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - Modified
On string - Last modified time.
- Name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- Path string
- The endpoint path to health check against. Defaults to
/
. - Port int
- Port number to connect to for the health check. Defaults to
80
. - Retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - Suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - Timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - Type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- address String
- The hostname or IP address of the origin server to run health checks on.
- allow
Insecure Boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions List<String> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails Integer - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes Integer - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - created
On String - Creation time.
- description String
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes List<String> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects Boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
List<Healthcheck
Header> - 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.
- interval Integer
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method String
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - modified
On String - Last modified time.
- name String
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- path String
- The endpoint path to health check against. Defaults to
/
. - port Integer
- Port number to connect to for the health check. Defaults to
80
. - retries Integer
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended Boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout Integer
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - type String
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- address string
- The hostname or IP address of the origin server to run health checks on.
- allow
Insecure boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions string[] - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails number - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes number - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - created
On string - Creation time.
- description string
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes string[] - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
Healthcheck
Header[] - 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.
- interval number
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method string
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - modified
On string - Last modified time.
- name string
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- path string
- The endpoint path to health check against. Defaults to
/
. - port number
- Port number to connect to for the health check. Defaults to
80
. - retries number
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout number
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - type string
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- address str
- The hostname or IP address of the origin server to run health checks on.
- allow_
insecure bool - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check_
regions Sequence[str] - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive_
fails int - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive_
successes int - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - created_
on str - Creation time.
- description str
- A human-readable description of the health check.
- expected_
body str - 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.
- expected_
codes Sequence[str] - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow_
redirects bool - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers
Sequence[Healthcheck
Header Args] - 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.
- interval int
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method str
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - modified_
on str - Last modified time.
- name str
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- path str
- The endpoint path to health check against. Defaults to
/
. - port int
- Port number to connect to for the health check. Defaults to
80
. - retries int
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended bool
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout int
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - type str
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- address String
- The hostname or IP address of the origin server to run health checks on.
- allow
Insecure Boolean - Do not validate the certificate when the health check uses HTTPS. Defaults to
false
. - check
Regions List<String> - A list of regions from which to run health checks. If not set, Cloudflare will pick a default region. Available values:
WNAM
,ENAM
,WEU
,EEU
,NSAM
,SSAM
,OC
,ME
,NAF
,SAF
,IN
,SEAS
,NEAS
,ALL_REGIONS
. - consecutive
Fails Number - The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to
1
. - consecutive
Successes Number - The number of consecutive successes required from a health check before changing the health to healthy. Defaults to
1
. - created
On String - Creation time.
- description String
- A human-readable description of the health check.
- expected
Body 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.
- expected
Codes List<String> - The expected HTTP response codes (e.g. '200') or code ranges (e.g. '2xx' for all codes starting with 2) of the health check.
- follow
Redirects Boolean - Follow redirects if the origin returns a 3xx status code. Defaults to
false
. - headers List<Property Map>
- 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.
- interval Number
- The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase the load on the origin as we check from multiple locations. Defaults to
60
. - method String
- The HTTP method to use for the health check. Available values:
connection_established
,GET
,HEAD
. - modified
On String - Last modified time.
- name String
- A short name to identify the health check. Only alphanumeric characters, hyphens, and underscores are allowed.
- path String
- The endpoint path to health check against. Defaults to
/
. - port Number
- Port number to connect to for the health check. Defaults to
80
. - retries Number
- The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Defaults to
2
. - suspended Boolean
- If suspended, no health checks are sent to the origin. Defaults to
false
. - timeout Number
- The timeout (in seconds) before marking the health check as failed. Defaults to
5
. - type String
- The protocol to use for the health check. Available values:
TCP
,HTTP
,HTTPS
. - zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Supporting Types
HealthcheckHeader, HealthcheckHeaderArgs
Import
Use the Zone ID and Healthcheck ID to import.
$ pulumi import cloudflare:index/healthcheck:Healthcheck example <zone_id>/<healthcheck_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.