Class RegionHealthCheck
Health Checks determine whether instances are responsive and able to do work. They are an important part of a comprehensive load balancing configuration, as they enable monitoring instances behind load balancers.
Health Checks poll instances at a specified interval. Instances that do not respond successfully to some number of probes in a row are marked as unhealthy. No new connections are sent to unhealthy instances, though existing connections will continue. The health check will continue to poll unhealthy instances. If an instance later responds successfully to some number of consecutive probes, it is marked healthy again and can receive new connections.
To get more information about RegionHealthCheck, see:
- API documentation
- How-to Guides
- Official Documentation
Example Usage - Region Health Check Tcp
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var tcp_region_health_check = new Gcp.Compute.RegionHealthCheck("tcp-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
TcpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckTcpHealthCheckArgs
{
Port = "80",
},
TimeoutSec = 1,
});
}
}
Example Usage - Region Health Check Tcp Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var tcp_region_health_check = new Gcp.Compute.RegionHealthCheck("tcp-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Description = "Health check via tcp",
HealthyThreshold = 4,
TcpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckTcpHealthCheckArgs
{
PortName = "health-check-port",
PortSpecification = "USE_NAMED_PORT",
ProxyHeader = "NONE",
Request = "ARE YOU HEALTHY?",
Response = "I AM HEALTHY",
},
TimeoutSec = 1,
UnhealthyThreshold = 5,
});
}
}
Example Usage - Region Health Check Ssl
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var ssl_region_health_check = new Gcp.Compute.RegionHealthCheck("ssl-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
SslHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckSslHealthCheckArgs
{
Port = "443",
},
TimeoutSec = 1,
});
}
}
Example Usage - Region Health Check Ssl Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var ssl_region_health_check = new Gcp.Compute.RegionHealthCheck("ssl-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Description = "Health check via ssl",
HealthyThreshold = 4,
SslHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckSslHealthCheckArgs
{
PortName = "health-check-port",
PortSpecification = "USE_NAMED_PORT",
ProxyHeader = "NONE",
Request = "ARE YOU HEALTHY?",
Response = "I AM HEALTHY",
},
TimeoutSec = 1,
UnhealthyThreshold = 5,
});
}
}
Example Usage - Region Health Check Http
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var http_region_health_check = new Gcp.Compute.RegionHealthCheck("http-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
HttpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttpHealthCheckArgs
{
Port = "80",
},
TimeoutSec = 1,
});
}
}
Example Usage - Region Health Check Http Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var http_region_health_check = new Gcp.Compute.RegionHealthCheck("http-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Description = "Health check via http",
HealthyThreshold = 4,
HttpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttpHealthCheckArgs
{
Host = "1.2.3.4",
PortName = "health-check-port",
PortSpecification = "USE_NAMED_PORT",
ProxyHeader = "NONE",
RequestPath = "/mypath",
Response = "I AM HEALTHY",
},
TimeoutSec = 1,
UnhealthyThreshold = 5,
});
}
}
Example Usage - Region Health Check Https
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var https_region_health_check = new Gcp.Compute.RegionHealthCheck("https-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
HttpsHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttpsHealthCheckArgs
{
Port = "443",
},
TimeoutSec = 1,
});
}
}
Example Usage - Region Health Check Https Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var https_region_health_check = new Gcp.Compute.RegionHealthCheck("https-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Description = "Health check via https",
HealthyThreshold = 4,
HttpsHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttpsHealthCheckArgs
{
Host = "1.2.3.4",
PortName = "health-check-port",
PortSpecification = "USE_NAMED_PORT",
ProxyHeader = "NONE",
RequestPath = "/mypath",
Response = "I AM HEALTHY",
},
TimeoutSec = 1,
UnhealthyThreshold = 5,
});
}
}
Example Usage - Region Health Check Http2
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var http2_region_health_check = new Gcp.Compute.RegionHealthCheck("http2-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Http2HealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttp2HealthCheckArgs
{
Port = "443",
},
TimeoutSec = 1,
});
}
}
Example Usage - Region Health Check Http2 Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var http2_region_health_check = new Gcp.Compute.RegionHealthCheck("http2-region-health-check", new Gcp.Compute.RegionHealthCheckArgs
{
CheckIntervalSec = 1,
Description = "Health check via http2",
HealthyThreshold = 4,
Http2HealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttp2HealthCheckArgs
{
Host = "1.2.3.4",
PortName = "health-check-port",
PortSpecification = "USE_NAMED_PORT",
ProxyHeader = "NONE",
RequestPath = "/mypath",
Response = "I AM HEALTHY",
},
TimeoutSec = 1,
UnhealthyThreshold = 5,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class RegionHealthCheck : CustomResource
Constructors
View SourceRegionHealthCheck(String, RegionHealthCheckArgs, CustomResourceOptions)
Create a RegionHealthCheck resource with the given unique name, arguments, and options.
Declaration
public RegionHealthCheck(string name, RegionHealthCheckArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RegionHealthCheckArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCheckIntervalSec
How often (in seconds) to send a health check. The default value is 5 seconds.
Declaration
public Output<int?> CheckIntervalSec { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
CreationTimestamp
Creation timestamp in RFC3339 text format.
Declaration
public Output<string> CreationTimestamp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
An optional description of this resource. Provide this property when you create the resource.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
HealthyThreshold
A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.
Declaration
public Output<int?> HealthyThreshold { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Http2HealthCheck
A nested object resource Structure is documented below.
Declaration
public Output<RegionHealthCheckHttp2HealthCheck> Http2HealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckHttp2HealthCheck> |
HttpHealthCheck
A nested object resource Structure is documented below.
Declaration
public Output<RegionHealthCheckHttpHealthCheck> HttpHealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckHttpHealthCheck> |
HttpsHealthCheck
A nested object resource Structure is documented below.
Declaration
public Output<RegionHealthCheckHttpsHealthCheck> HttpsHealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckHttpsHealthCheck> |
LogConfig
Configure logging on this health check. Structure is documented below.
Declaration
public Output<RegionHealthCheckLogConfig> LogConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckLogConfig> |
Name
Name of the resource. Provided by the client when the resource is
created. The name must be 1-63 characters long, and comply with
RFC1035. Specifically, the name must be 1-63 characters long and
match the regular expression a-z? which means
the first character must be a lowercase letter, and all following
characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The Region in which the created health check should reside. If it is not provided, the provider region is used.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SelfLink
The URI of the created resource.
Declaration
public Output<string> SelfLink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SslHealthCheck
A nested object resource Structure is documented below.
Declaration
public Output<RegionHealthCheckSslHealthCheck> SslHealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckSslHealthCheck> |
TcpHealthCheck
A nested object resource Structure is documented below.
Declaration
public Output<RegionHealthCheckTcpHealthCheck> TcpHealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<RegionHealthCheckTcpHealthCheck> |
TimeoutSec
How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.
Declaration
public Output<int?> TimeoutSec { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Type
The type of the health check. One of HTTP, HTTP2, HTTPS, TCP, or SSL.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
UnhealthyThreshold
A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.
Declaration
public Output<int?> UnhealthyThreshold { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Methods
View SourceGet(String, Input<String>, RegionHealthCheckState, CustomResourceOptions)
Get an existing RegionHealthCheck resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static RegionHealthCheck Get(string name, Input<string> id, RegionHealthCheckState 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. |
| RegionHealthCheckState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| RegionHealthCheck |