Class Healthcheck
Standalone Health Checks provide a way to monitor origin servers without needing a Cloudflare Load Balancer.
Example Usage
TCP Monitor
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
var tcpHealthCheck = new Cloudflare.Healthcheck("tcpHealthCheck", new Cloudflare.HealthcheckArgs
{
ZoneId = @var.Cloudflare_zone_id,
Name = "tcp-health-check",
Description = "example tcp health check",
Address = "example.com",
Suspended = false,
CheckRegions =
{
"WEU",
"EEU",
},
NotificationSuspended = false,
NotificationEmailAddresses =
{
"hostmaster@example.com",
},
Type = "TCP",
Port = "22",
Method = "connection_established",
Timeout = 10,
Retries = 2,
Interval = 60,
ConsecutiveFails = 3,
ConsecutiveSuccesses = 2,
});
}
}
Inherited Members
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class Healthcheck : CustomResource
Constructors
View SourceHealthcheck(String, HealthcheckArgs, CustomResourceOptions)
Create a Healthcheck resource with the given unique name, arguments, and options.
Declaration
public Healthcheck(string name, HealthcheckArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| HealthcheckArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAddress
The hostname or IP address of the origin server to run health checks on.
Declaration
public Output<string> Address { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AllowInsecure
Do not validate the certificate when the health check uses HTTPS. Valid values: true or false (Default: false).
Declaration
public Output<bool?> AllowInsecure { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
CheckRegions
A list of regions from which to run health checks. If not set Cloudflare will pick a default region. Valid values: WNAM, ENAM, WEU, EEU, NSAM, SSAM, OC, ME, NAF, SAF, IN, SEAS, NEAS, ALL_REGIONS.
Declaration
public Output<ImmutableArray<string>> CheckRegions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ConsecutiveFails
The number of consecutive fails required from a health check before changing the health to unhealthy. (Default: 1)
Declaration
public Output<int?> ConsecutiveFails { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
ConsecutiveSuccesses
The number of consecutive successes required from a health check before changing the health to healthy. (Default: 1)
Declaration
public Output<int?> ConsecutiveSuccesses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
CreatedOn
Declaration
public Output<string> CreatedOn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A human-readable description of the health check.
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.
Declaration
public Output<string> ExpectedBody { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExpectedCodes
The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. (Default: ["200"])
Declaration
public Output<ImmutableArray<string>> ExpectedCodes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
FollowRedirects
Follow redirects if the origin returns a 3xx status code. Valid values: true or false (Default: false).
Declaration
public Output<bool?> FollowRedirects { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Headers
The header name.
Declaration
public Output<ImmutableArray<HealthcheckHeader>> Headers { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<HealthcheckHeader>> |
Interval
The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin 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 TCP connection method to use for the health check. Valid values: connection_established (Default: connection_established).
Declaration
public Output<string> Method { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ModifiedOn
Declaration
public Output<string> ModifiedOn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NotificationEmailAddresses
A list of email addresses we want to send the notifications to.
Declaration
public Output<ImmutableArray<string>> NotificationEmailAddresses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
NotificationSuspended
Whether the notifications are suspended or not. Useful for maintenance periods. Valid values: true or false (Default: false).
Declaration
public Output<bool?> NotificationSuspended { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Path
The endpoint path to health check against. (Default: /)
Declaration
public Output<string> Path { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
Port number to connect to for the health check. Valid values are in the rage 0-65535 (Default: 80).
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>> |
Suspended
If suspended, no health checks are sent to the origin. Valid values: true or false (Default: false).
Declaration
public Output<bool?> Suspended { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
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 health check. Valid values: HTTP, HTTPS, TCP.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ZoneId
The DNS zone ID to which apply settings.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, HealthcheckState, CustomResourceOptions)
Get an existing Healthcheck resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Healthcheck Get(string name, Input<string> id, HealthcheckState 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. |
| HealthcheckState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Healthcheck |