Show / Hide Table of Contents

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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Healthcheck
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class Healthcheck : CustomResource

Constructors

View Source

Healthcheck(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 Source

Address

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>
View Source

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>>
View Source

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>>
View Source

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>>
View Source

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>>
View Source

CreatedOn

Declaration
public Output<string> CreatedOn { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A human-readable description of the health check.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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: [&quot;200&quot;])

Declaration
public Output<ImmutableArray<string>> ExpectedCodes { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

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>>
View Source

Headers

The header name.

Declaration
public Output<ImmutableArray<HealthcheckHeader>> Headers { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<HealthcheckHeader>>
View Source

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>>
View Source

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>
View Source

ModifiedOn

Declaration
public Output<string> ModifiedOn { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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>>
View Source

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>>
View Source

Path

The endpoint path to health check against. (Default: /)

Declaration
public Output<string> Path { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

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>>
View Source

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>>
View Source

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>>
View Source

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>
View Source

ZoneId

The DNS zone ID to which apply settings.

Declaration
public Output<string> ZoneId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.