com.pulumi.gcp.compute.kotlin.HttpHealthCheckArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.HttpHealthCheckArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* An HttpHealthCheck resource. This resource defines a template for how
* individual VMs should be checked for health, via HTTP.
* > **Note:** gcp.compute.HttpHealthCheck is a legacy health check.
* The newer [gcp.compute.HealthCheck](https://www.terraform.io/docs/providers/google/r/compute_health_check.html)
* should be preferred for all uses except
* [Network Load Balancers](https://cloud.google.com/compute/docs/load-balancing/network/)
* which still require the legacy version.
* To get more information about HttpHealthCheck, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks)
* * How-to Guides
* * [Adding Health Checks](https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)
* ## Example Usage
* ### Http Health Check Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.HttpHealthCheck("default", {
* name: "authentication-health-check",
* requestPath: "/health_check",
* timeoutSec: 1,
* checkIntervalSec: 1,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.HttpHealthCheck("default",
* name="authentication-health-check",
* request_path="/health_check",
* timeout_sec=1,
* check_interval_sec=1)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.HttpHealthCheck("default", new()
* {
* Name = "authentication-health-check",
* RequestPath = "/health_check",
* TimeoutSec = 1,
* CheckIntervalSec = 1,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
* Name: pulumi.String("authentication-health-check"),
* RequestPath: pulumi.String("/health_check"),
* TimeoutSec: pulumi.Int(1),
* CheckIntervalSec: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.HttpHealthCheck;
* import com.pulumi.gcp.compute.HttpHealthCheckArgs;
* 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 default_ = new HttpHealthCheck("default", HttpHealthCheckArgs.builder()
* .name("authentication-health-check")
* .requestPath("/health_check")
* .timeoutSec(1)
* .checkIntervalSec(1)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:HttpHealthCheck
* properties:
* name: authentication-health-check
* requestPath: /health_check
* timeoutSec: 1
* checkIntervalSec: 1
* ```
*
* ## Import
* HttpHealthCheck can be imported using any of these accepted formats:
* * `projects/{{project}}/global/httpHealthChecks/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, HttpHealthCheck can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default projects/{{project}}/global/httpHealthChecks/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default {{name}}
* ```
* @property checkIntervalSec How often (in seconds) to send a health check. The default value is 5
* seconds.
* @property description An optional description of this resource. Provide this property when
* you create the resource.
* @property healthyThreshold A so-far unhealthy instance will be marked healthy after this many
* consecutive successes. The default value is 2.
* @property host The value of the host header in the HTTP health check request. If
* left empty (default value), the public IP on behalf of which this
* health check is performed will be used.
* @property 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.
* - - -
* @property port The TCP port number for the HTTP health check request.
* The default value is 80.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property requestPath The request path of the HTTP health check request.
* The default value is /.
* @property 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.
* @property unhealthyThreshold A so-far healthy instance will be marked unhealthy after this many
* consecutive failures. The default value is 2.
*/
public data class HttpHealthCheckArgs(
public val checkIntervalSec: Output? = null,
public val description: Output? = null,
public val healthyThreshold: Output? = null,
public val host: Output? = null,
public val name: Output? = null,
public val port: Output? = null,
public val project: Output? = null,
public val requestPath: Output? = null,
public val timeoutSec: Output? = null,
public val unhealthyThreshold: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.HttpHealthCheckArgs =
com.pulumi.gcp.compute.HttpHealthCheckArgs.builder()
.checkIntervalSec(checkIntervalSec?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.healthyThreshold(healthyThreshold?.applyValue({ args0 -> args0 }))
.host(host?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.port(port?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.requestPath(requestPath?.applyValue({ args0 -> args0 }))
.timeoutSec(timeoutSec?.applyValue({ args0 -> args0 }))
.unhealthyThreshold(unhealthyThreshold?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [HttpHealthCheckArgs].
*/
@PulumiTagMarker
public class HttpHealthCheckArgsBuilder internal constructor() {
private var checkIntervalSec: Output? = null
private var description: Output? = null
private var healthyThreshold: Output? = null
private var host: Output? = null
private var name: Output? = null
private var port: Output? = null
private var project: Output? = null
private var requestPath: Output? = null
private var timeoutSec: Output? = null
private var unhealthyThreshold: Output? = null
/**
* @param value How often (in seconds) to send a health check. The default value is 5
* seconds.
*/
@JvmName("xmnitsuohqktburj")
public suspend fun checkIntervalSec(`value`: Output) {
this.checkIntervalSec = value
}
/**
* @param value An optional description of this resource. Provide this property when
* you create the resource.
*/
@JvmName("odrnwhtmqkytjwfx")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value A so-far unhealthy instance will be marked healthy after this many
* consecutive successes. The default value is 2.
*/
@JvmName("dmavjfsrjwkdmdet")
public suspend fun healthyThreshold(`value`: Output) {
this.healthyThreshold = value
}
/**
* @param value The value of the host header in the HTTP health check request. If
* left empty (default value), the public IP on behalf of which this
* health check is performed will be used.
*/
@JvmName("pepmtqhfiuurxoko")
public suspend fun host(`value`: Output) {
this.host = value
}
/**
* @param value 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.
* - - -
*/
@JvmName("ymqpmmxvwfadkwvp")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The TCP port number for the HTTP health check request.
* The default value is 80.
*/
@JvmName("aoujdixgiipbnrok")
public suspend fun port(`value`: Output) {
this.port = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("nskmvbmnglurtxnr")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The request path of the HTTP health check request.
* The default value is /.
*/
@JvmName("finueygujdynggvt")
public suspend fun requestPath(`value`: Output) {
this.requestPath = value
}
/**
* @param value 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.
*/
@JvmName("smgrenfpaeiulybk")
public suspend fun timeoutSec(`value`: Output) {
this.timeoutSec = value
}
/**
* @param value A so-far healthy instance will be marked unhealthy after this many
* consecutive failures. The default value is 2.
*/
@JvmName("bgchrutqcfjyveam")
public suspend fun unhealthyThreshold(`value`: Output) {
this.unhealthyThreshold = value
}
/**
* @param value How often (in seconds) to send a health check. The default value is 5
* seconds.
*/
@JvmName("vlskddxatlakconk")
public suspend fun checkIntervalSec(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.checkIntervalSec = mapped
}
/**
* @param value An optional description of this resource. Provide this property when
* you create the resource.
*/
@JvmName("owjukehkdfyjlchi")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value A so-far unhealthy instance will be marked healthy after this many
* consecutive successes. The default value is 2.
*/
@JvmName("rtmjnblsptpusugl")
public suspend fun healthyThreshold(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.healthyThreshold = mapped
}
/**
* @param value The value of the host header in the HTTP health check request. If
* left empty (default value), the public IP on behalf of which this
* health check is performed will be used.
*/
@JvmName("nesfbxnkcnketmsm")
public suspend fun host(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.host = mapped
}
/**
* @param value 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.
* - - -
*/
@JvmName("pehaencgtvrhckss")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The TCP port number for the HTTP health check request.
* The default value is 80.
*/
@JvmName("bkjapkvkbrdsdyur")
public suspend fun port(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.port = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("vupluwyfqgbpyanr")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value The request path of the HTTP health check request.
* The default value is /.
*/
@JvmName("hviswdvwuttubqeu")
public suspend fun requestPath(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requestPath = mapped
}
/**
* @param value 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.
*/
@JvmName("dvrrnduwcikwwwow")
public suspend fun timeoutSec(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.timeoutSec = mapped
}
/**
* @param value A so-far healthy instance will be marked unhealthy after this many
* consecutive failures. The default value is 2.
*/
@JvmName("uniovaobjtyqlngn")
public suspend fun unhealthyThreshold(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.unhealthyThreshold = mapped
}
internal fun build(): HttpHealthCheckArgs = HttpHealthCheckArgs(
checkIntervalSec = checkIntervalSec,
description = description,
healthyThreshold = healthyThreshold,
host = host,
name = name,
port = port,
project = project,
requestPath = requestPath,
timeoutSec = timeoutSec,
unhealthyThreshold = unhealthyThreshold,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy