TargetPoolArgs

data class TargetPoolArgs(val backupPool: Output<String>? = null, val description: Output<String>? = null, val failoverRatio: Output<Double>? = null, val healthChecks: Output<String>? = null, val instances: Output<List<String>>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val securityPolicy: Output<String>? = null, val sessionAffinity: Output<String>? = null) : ConvertibleToJava<TargetPoolArgs>

Manages a Target Pool within GCE. This is a collection of instances used as target of a network load balancer (Forwarding Rule). For more information see [the official

  • documentation](https://cloud.google.com/compute/docs/load-balancing/network/target-pools) and API.

Example Usage

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 com.pulumi.gcp.compute.TargetPool;
import com.pulumi.gcp.compute.TargetPoolArgs;
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 defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
.requestPath("/")
.checkIntervalSec(1)
.timeoutSec(1)
.build());
var defaultTargetPool = new TargetPool("defaultTargetPool", TargetPoolArgs.builder()
.instances(
"us-central1-a/myinstance1",
"us-central1-b/myinstance2")
.healthChecks(defaultHttpHealthCheck.name())
.build());
}
}

Import

Target pools can be imported using any of the following formats

$ pulumi import gcp:compute/targetPool:TargetPool default projects/{{project}}/regions/{{region}}/targetPools/{{name}}
$ pulumi import gcp:compute/targetPool:TargetPool default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/targetPool:TargetPool default {{region}}/{{name}}
$ pulumi import gcp:compute/targetPool:TargetPool default {{name}}

Constructors

Link copied to clipboard
constructor(backupPool: Output<String>? = null, description: Output<String>? = null, failoverRatio: Output<Double>? = null, healthChecks: Output<String>? = null, instances: Output<List<String>>? = null, name: Output<String>? = null, project: Output<String>? = null, region: Output<String>? = null, securityPolicy: Output<String>? = null, sessionAffinity: Output<String>? = null)

Properties

Link copied to clipboard
val backupPool: Output<String>? = null

URL to the backup target pool. Must also set failover\_ratio.

Link copied to clipboard
val description: Output<String>? = null

Textual description field.

Link copied to clipboard
val failoverRatio: Output<Double>? = null

Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).

Link copied to clipboard
val healthChecks: Output<String>? = null

List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.

Link copied to clipboard
val instances: Output<List<String>>? = null

List of instances in the pool. They can be given as URLs, or in the form of "zone/name". Note that the instances need not exist at the time of target pool creation, so there is no need to use the interpolation to create a dependency on the instances from the target pool.

Link copied to clipboard
val name: Output<String>? = null

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val region: Output<String>? = null

Where the target pool resides. Defaults to project region.

Link copied to clipboard
val securityPolicy: Output<String>? = null

) The resource URL for the security policy associated with this target pool.

Link copied to clipboard
val sessionAffinity: Output<String>? = null

How to distribute load. Options are "NONE" (no affinity). "CLIENT\_IP" (hash of the source/dest addresses / ports), and "CLIENT\_IP\_PROTO" also includes the protocol (default "NONE").

Functions

Link copied to clipboard
open override fun toJava(): TargetPoolArgs