1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getHealthcheck
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getHealthcheck

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleHealthcheck = cloudflare.getHealthcheck({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        healthcheckId: "023e105f4ecef8ad9ca31a8372d0c353",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_healthcheck = cloudflare.get_healthcheck(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        healthcheck_id="023e105f4ecef8ad9ca31a8372d0c353")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupHealthcheck(ctx, &cloudflare.LookupHealthcheckArgs{
    			ZoneId:        "023e105f4ecef8ad9ca31a8372d0c353",
    			HealthcheckId: pulumi.StringRef("023e105f4ecef8ad9ca31a8372d0c353"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleHealthcheck = Cloudflare.GetHealthcheck.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            HealthcheckId = "023e105f4ecef8ad9ca31a8372d0c353",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetHealthcheckArgs;
    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) {
            final var exampleHealthcheck = CloudflareFunctions.getHealthcheck(GetHealthcheckArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .healthcheckId("023e105f4ecef8ad9ca31a8372d0c353")
                .build());
    
        }
    }
    
    variables:
      exampleHealthcheck:
        fn::invoke:
          function: cloudflare:getHealthcheck
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            healthcheckId: 023e105f4ecef8ad9ca31a8372d0c353
    

    Using getHealthcheck

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getHealthcheck(args: GetHealthcheckArgs, opts?: InvokeOptions): Promise<GetHealthcheckResult>
    function getHealthcheckOutput(args: GetHealthcheckOutputArgs, opts?: InvokeOptions): Output<GetHealthcheckResult>
    def get_healthcheck(healthcheck_id: Optional[str] = None,
                        zone_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetHealthcheckResult
    def get_healthcheck_output(healthcheck_id: Optional[pulumi.Input[str]] = None,
                        zone_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetHealthcheckResult]
    func LookupHealthcheck(ctx *Context, args *LookupHealthcheckArgs, opts ...InvokeOption) (*LookupHealthcheckResult, error)
    func LookupHealthcheckOutput(ctx *Context, args *LookupHealthcheckOutputArgs, opts ...InvokeOption) LookupHealthcheckResultOutput

    > Note: This function is named LookupHealthcheck in the Go SDK.

    public static class GetHealthcheck 
    {
        public static Task<GetHealthcheckResult> InvokeAsync(GetHealthcheckArgs args, InvokeOptions? opts = null)
        public static Output<GetHealthcheckResult> Invoke(GetHealthcheckInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHealthcheckResult> getHealthcheck(GetHealthcheckArgs args, InvokeOptions options)
    public static Output<GetHealthcheckResult> getHealthcheck(GetHealthcheckArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getHealthcheck:getHealthcheck
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ZoneId string
    Identifier
    HealthcheckId string
    Identifier
    ZoneId string
    Identifier
    HealthcheckId string
    Identifier
    zoneId String
    Identifier
    healthcheckId String
    Identifier
    zoneId string
    Identifier
    healthcheckId string
    Identifier
    zone_id str
    Identifier
    healthcheck_id str
    Identifier
    zoneId String
    Identifier
    healthcheckId String
    Identifier

    getHealthcheck Result

    The following output properties are available:

    Address string
    The hostname or IP address of the origin server to run health checks on.
    CheckRegions List<string>
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    ConsecutiveSuccesses int
    The number of consecutive successes required from a health check before changing the health to healthy.
    CreatedOn string
    Description string
    A human-readable description of the health check.
    FailureReason string
    The current failure reason if status is unhealthy.
    HttpConfig GetHealthcheckHttpConfig
    Parameters specific to an HTTP or HTTPS health check.
    Id string
    Identifier
    Interval int
    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.
    ModifiedOn string
    Name string
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    Retries int
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    Status string
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    Suspended bool
    If suspended, no health checks are sent to the origin.
    TcpConfig GetHealthcheckTcpConfig
    Parameters specific to TCP health check.
    Timeout int
    The timeout (in seconds) before marking the health check as failed.
    Type string
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    ZoneId string
    Identifier
    HealthcheckId string
    Identifier
    Address string
    The hostname or IP address of the origin server to run health checks on.
    CheckRegions []string
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    ConsecutiveFails int
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    ConsecutiveSuccesses int
    The number of consecutive successes required from a health check before changing the health to healthy.
    CreatedOn string
    Description string
    A human-readable description of the health check.
    FailureReason string
    The current failure reason if status is unhealthy.
    HttpConfig GetHealthcheckHttpConfig
    Parameters specific to an HTTP or HTTPS health check.
    Id string
    Identifier
    Interval int
    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.
    ModifiedOn string
    Name string
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    Retries int
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    Status string
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    Suspended bool
    If suspended, no health checks are sent to the origin.
    TcpConfig GetHealthcheckTcpConfig
    Parameters specific to TCP health check.
    Timeout int
    The timeout (in seconds) before marking the health check as failed.
    Type string
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    ZoneId string
    Identifier
    HealthcheckId string
    Identifier
    address String
    The hostname or IP address of the origin server to run health checks on.
    checkRegions List<String>
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    consecutiveFails Integer
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    consecutiveSuccesses Integer
    The number of consecutive successes required from a health check before changing the health to healthy.
    createdOn String
    description String
    A human-readable description of the health check.
    failureReason String
    The current failure reason if status is unhealthy.
    httpConfig GetHealthcheckHttpConfig
    Parameters specific to an HTTP or HTTPS health check.
    id String
    Identifier
    interval Integer
    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.
    modifiedOn String
    name String
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    retries Integer
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    status String
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    suspended Boolean
    If suspended, no health checks are sent to the origin.
    tcpConfig GetHealthcheckTcpConfig
    Parameters specific to TCP health check.
    timeout Integer
    The timeout (in seconds) before marking the health check as failed.
    type String
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    zoneId String
    Identifier
    healthcheckId String
    Identifier
    address string
    The hostname or IP address of the origin server to run health checks on.
    checkRegions string[]
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    consecutiveFails number
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    consecutiveSuccesses number
    The number of consecutive successes required from a health check before changing the health to healthy.
    createdOn string
    description string
    A human-readable description of the health check.
    failureReason string
    The current failure reason if status is unhealthy.
    httpConfig GetHealthcheckHttpConfig
    Parameters specific to an HTTP or HTTPS health check.
    id string
    Identifier
    interval number
    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.
    modifiedOn string
    name string
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    retries number
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    status string
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    suspended boolean
    If suspended, no health checks are sent to the origin.
    tcpConfig GetHealthcheckTcpConfig
    Parameters specific to TCP health check.
    timeout number
    The timeout (in seconds) before marking the health check as failed.
    type string
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    zoneId string
    Identifier
    healthcheckId string
    Identifier
    address str
    The hostname or IP address of the origin server to run health checks on.
    check_regions Sequence[str]
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    consecutive_fails int
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    consecutive_successes int
    The number of consecutive successes required from a health check before changing the health to healthy.
    created_on str
    description str
    A human-readable description of the health check.
    failure_reason str
    The current failure reason if status is unhealthy.
    http_config GetHealthcheckHttpConfig
    Parameters specific to an HTTP or HTTPS health check.
    id str
    Identifier
    interval int
    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.
    modified_on str
    name str
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    retries int
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    status str
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    suspended bool
    If suspended, no health checks are sent to the origin.
    tcp_config GetHealthcheckTcpConfig
    Parameters specific to TCP health check.
    timeout int
    The timeout (in seconds) before marking the health check as failed.
    type str
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    zone_id str
    Identifier
    healthcheck_id str
    Identifier
    address String
    The hostname or IP address of the origin server to run health checks on.
    checkRegions List<String>
    A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
    consecutiveFails Number
    The number of consecutive fails required from a health check before changing the health to unhealthy.
    consecutiveSuccesses Number
    The number of consecutive successes required from a health check before changing the health to healthy.
    createdOn String
    description String
    A human-readable description of the health check.
    failureReason String
    The current failure reason if status is unhealthy.
    httpConfig Property Map
    Parameters specific to an HTTP or HTTPS health check.
    id String
    Identifier
    interval Number
    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.
    modifiedOn String
    name String
    A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
    retries Number
    The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
    status String
    The current status of the origin server according to the health check. Available values: "unknown", "healthy", "unhealthy", "suspended".
    suspended Boolean
    If suspended, no health checks are sent to the origin.
    tcpConfig Property Map
    Parameters specific to TCP health check.
    timeout Number
    The timeout (in seconds) before marking the health check as failed.
    type String
    The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
    zoneId String
    Identifier
    healthcheckId String
    Identifier

    Supporting Types

    GetHealthcheckHttpConfig

    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS.
    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.
    Header Dictionary<string, ImmutableArray<string>>
    The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
    Method string
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    Path string
    The endpoint path to health check against.
    Port int
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.
    AllowInsecure bool
    Do not validate the certificate when the health check uses HTTPS.
    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.
    Header map[string][]string
    The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
    Method string
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    Path string
    The endpoint path to health check against.
    Port int
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS.
    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.
    header Map<String,List<String>>
    The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
    method String
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    path String
    The endpoint path to health check against.
    port Integer
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.
    allowInsecure boolean
    Do not validate the certificate when the health check uses HTTPS.
    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.
    header {[key: string]: string[]}
    The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
    method string
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    path string
    The endpoint path to health check against.
    port number
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.
    allow_insecure bool
    Do not validate the certificate when the health check uses HTTPS.
    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.
    header Mapping[str, Sequence[str]]
    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.
    method str
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    path str
    The endpoint path to health check against.
    port int
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.
    allowInsecure Boolean
    Do not validate the certificate when the health check uses HTTPS.
    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.
    header Map<List<String>>
    The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.
    method String
    The HTTP method to use for the health check. Available values: "GET", "HEAD".
    path String
    The endpoint path to health check against.
    port Number
    Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.

    GetHealthcheckTcpConfig

    Method string
    The TCP connection method to use for the health check. Available values: "connection_established".
    Port int
    Port number to connect to for the health check. Defaults to 80.
    Method string
    The TCP connection method to use for the health check. Available values: "connection_established".
    Port int
    Port number to connect to for the health check. Defaults to 80.
    method String
    The TCP connection method to use for the health check. Available values: "connection_established".
    port Integer
    Port number to connect to for the health check. Defaults to 80.
    method string
    The TCP connection method to use for the health check. Available values: "connection_established".
    port number
    Port number to connect to for the health check. Defaults to 80.
    method str
    The TCP connection method to use for the health check. Available values: "connection_established".
    port int
    Port number to connect to for the health check. Defaults to 80.
    method String
    The TCP connection method to use for the health check. Available values: "connection_established".
    port Number
    Port number to connect to for the health check. Defaults to 80.

    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 v6.1.2 published on Monday, Apr 28, 2025 by Pulumi