1. Packages
  2. Cloudflare
  3. API Docs
  4. Healthcheck
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

cloudflare.Healthcheck

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

    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("httpHealthCheck", {
        zoneId: _var.cloudflare_zone_id,
        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("tcpHealthCheck", {
        zoneId: _var.cloudflare_zone_id,
        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("httpHealthCheck",
        zone_id=var["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=[cloudflare.HealthcheckHeaderArgs(
            header="Host",
            values=["example.com"],
        )],
        timeout=10,
        retries=2,
        interval=60,
        consecutive_fails=3,
        consecutive_successes=2)
    # TCP Healthcheck
    tcp_health_check = cloudflare.Healthcheck("tcpHealthCheck",
        zone_id=var["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, "httpHealthCheck", &cloudflare.HealthcheckArgs{
    			ZoneId:      pulumi.Any(_var.Cloudflare_zone_id),
    			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, "tcpHealthCheck", &cloudflare.HealthcheckArgs{
    			ZoneId:      pulumi.Any(_var.Cloudflare_zone_id),
    			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("httpHealthCheck", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            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("tcpHealthCheck", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            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) {
            var httpHealthCheck = new Healthcheck("httpHealthCheck", HealthcheckArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .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());
    
            var tcpHealthCheck = new Healthcheck("tcpHealthCheck", HealthcheckArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .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
        properties:
          zoneId: ${var.cloudflare_zone_id}
          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
        properties:
          zoneId: ${var.cloudflare_zone_id}
          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

    new Healthcheck(name: string, args: HealthcheckArgs, opts?: CustomResourceOptions);
    @overload
    def Healthcheck(resource_name: 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,
                    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,
                    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)
    @overload
    def Healthcheck(resource_name: str,
                    args: HealthcheckArgs,
                    opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    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.
    ZoneId string
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    CheckRegions 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.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    ConsecutiveSuccesses 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.
    ExpectedBody 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.
    ExpectedCodes 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.
    FollowRedirects bool
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    Headers List<HealthcheckHeader>
    The header name.
    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.
    ZoneId string
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    CheckRegions []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.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    ConsecutiveSuccesses 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.
    ExpectedBody 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.
    ExpectedCodes []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.
    FollowRedirects bool
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    Headers []HealthcheckHeaderArgs
    The header name.
    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.
    zoneId String
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails Integer
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses 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.
    expectedBody 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.
    expectedCodes 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.
    followRedirects Boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers List<HealthcheckHeader>
    The header name.
    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.
    zoneId string
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    allowInsecure boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails number
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses 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.
    expectedBody 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.
    expectedCodes 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.
    followRedirects boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers HealthcheckHeader[]
    The header name.
    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[HealthcheckHeaderArgs]
    The header name.
    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.
    zoneId String
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails Number
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses 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.
    expectedBody 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.
    expectedCodes 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.
    followRedirects Boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers List<Property Map>
    The header name.
    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:

    CreatedOn string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    Last modified time.
    CreatedOn string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    Last modified time.
    createdOn String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    Last modified time.
    createdOn string
    Creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn 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.
    createdOn String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn 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.
    The following state arguments are supported:
    Address string
    The hostname or IP address of the origin server to run health checks on.
    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    CheckRegions 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.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    ConsecutiveSuccesses int
    The number of consecutive successes required from a health check before changing the health to healthy. Defaults to 1.
    CreatedOn string
    Creation time.
    Description string
    A human-readable description of the health check.
    ExpectedBody 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.
    ExpectedCodes 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.
    FollowRedirects bool
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    Headers List<HealthcheckHeader>
    The header name.
    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.
    ModifiedOn 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.
    ZoneId 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.
    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    CheckRegions []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.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    ConsecutiveSuccesses int
    The number of consecutive successes required from a health check before changing the health to healthy. Defaults to 1.
    CreatedOn string
    Creation time.
    Description string
    A human-readable description of the health check.
    ExpectedBody 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.
    ExpectedCodes []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.
    FollowRedirects bool
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    Headers []HealthcheckHeaderArgs
    The header name.
    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.
    ModifiedOn 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.
    ZoneId 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.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails Integer
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses Integer
    The number of consecutive successes required from a health check before changing the health to healthy. Defaults to 1.
    createdOn String
    Creation time.
    description String
    A human-readable description of the health check.
    expectedBody 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.
    expectedCodes 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.
    followRedirects Boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers List<HealthcheckHeader>
    The header name.
    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.
    modifiedOn 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.
    zoneId 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.
    allowInsecure boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails number
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses number
    The number of consecutive successes required from a health check before changing the health to healthy. Defaults to 1.
    createdOn string
    Creation time.
    description string
    A human-readable description of the health check.
    expectedBody 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.
    expectedCodes 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.
    followRedirects boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers HealthcheckHeader[]
    The header name.
    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.
    modifiedOn 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.
    zoneId 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[HealthcheckHeaderArgs]
    The header name.
    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.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS. Defaults to false.
    checkRegions 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.
    consecutiveFails Number
    The number of consecutive fails required from a health check before changing the health to unhealthy. Defaults to 1.
    consecutiveSuccesses Number
    The number of consecutive successes required from a health check before changing the health to healthy. Defaults to 1.
    createdOn String
    Creation time.
    description String
    A human-readable description of the health check.
    expectedBody 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.
    expectedCodes 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.
    followRedirects Boolean
    Follow redirects if the origin returns a 3xx status code. Defaults to false.
    headers List<Property Map>
    The header name.
    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.
    modifiedOn 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.
    zoneId String
    The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.

    Supporting Types

    HealthcheckHeader, HealthcheckHeaderArgs

    Header string
    The header name.
    Values List<string>
    A list of string values for the header.
    Header string
    The header name.
    Values []string
    A list of string values for the header.
    header String
    The header name.
    values List<String>
    A list of string values for the header.
    header string
    The header name.
    values string[]
    A list of string values for the header.
    header str
    The header name.
    values Sequence[str]
    A list of string values for the header.
    header String
    The header name.
    values List<String>
    A list of string values for the header.

    Import

    Use the Zone ID and Healthcheck ID to import.

    $ pulumi import cloudflare:index/healthcheck:Healthcheck example <zone_id>/<healthcheck_id>
    

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi