TargetPool

class TargetPool : KotlinCustomResource

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}}

Properties

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

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

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

Textual description field.

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

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>?

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instances: Output<List<String>>

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>

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>

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val region: Output<String>

Where the target pool resides. Defaults to project region.

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

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

Link copied to clipboard
val selfLink: Output<String>

The URI of the created resource.

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

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").

Link copied to clipboard
val urn: Output<String>