1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. TargetPool
Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi

gcp.compute.TargetPool

Explore with Pulumi AI

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 and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
    name: "default",
    requestPath: "/",
    checkIntervalSec: 1,
    timeoutSec: 1,
});
const _default = new gcp.compute.TargetPool("default", {
    name: "instance-pool",
    instances: [
        "us-central1-a/myinstance1",
        "us-central1-b/myinstance2",
    ],
    healthChecks: defaultHttpHealthCheck.name,
});
Copy
import pulumi
import pulumi_gcp as gcp

default_http_health_check = gcp.compute.HttpHealthCheck("default",
    name="default",
    request_path="/",
    check_interval_sec=1,
    timeout_sec=1)
default = gcp.compute.TargetPool("default",
    name="instance-pool",
    instances=[
        "us-central1-a/myinstance1",
        "us-central1-b/myinstance2",
    ],
    health_checks=default_http_health_check.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
			Name:             pulumi.String("default"),
			RequestPath:      pulumi.String("/"),
			CheckIntervalSec: pulumi.Int(1),
			TimeoutSec:       pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewTargetPool(ctx, "default", &compute.TargetPoolArgs{
			Name: pulumi.String("instance-pool"),
			Instances: pulumi.StringArray{
				pulumi.String("us-central1-a/myinstance1"),
				pulumi.String("us-central1-b/myinstance2"),
			},
			HealthChecks: defaultHttpHealthCheck.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
    {
        Name = "default",
        RequestPath = "/",
        CheckIntervalSec = 1,
        TimeoutSec = 1,
    });

    var @default = new Gcp.Compute.TargetPool("default", new()
    {
        Name = "instance-pool",
        Instances = new[]
        {
            "us-central1-a/myinstance1",
            "us-central1-b/myinstance2",
        },
        HealthChecks = defaultHttpHealthCheck.Name,
    });

});
Copy
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()
            .name("default")
            .requestPath("/")
            .checkIntervalSec(1)
            .timeoutSec(1)
            .build());

        var default_ = new TargetPool("default", TargetPoolArgs.builder()
            .name("instance-pool")
            .instances(            
                "us-central1-a/myinstance1",
                "us-central1-b/myinstance2")
            .healthChecks(defaultHttpHealthCheck.name())
            .build());

    }
}
Copy
resources:
  default:
    type: gcp:compute:TargetPool
    properties:
      name: instance-pool
      instances:
        - us-central1-a/myinstance1
        - us-central1-b/myinstance2
      healthChecks: ${defaultHttpHealthCheck.name}
  defaultHttpHealthCheck:
    type: gcp:compute:HttpHealthCheck
    name: default
    properties:
      name: default
      requestPath: /
      checkIntervalSec: 1
      timeoutSec: 1
Copy

Create TargetPool Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TargetPool(name: string, args?: TargetPoolArgs, opts?: CustomResourceOptions);
@overload
def TargetPool(resource_name: str,
               args: Optional[TargetPoolArgs] = None,
               opts: Optional[ResourceOptions] = None)

@overload
def TargetPool(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               backup_pool: Optional[str] = None,
               description: Optional[str] = None,
               failover_ratio: Optional[float] = None,
               health_checks: Optional[str] = None,
               instances: Optional[Sequence[str]] = None,
               name: Optional[str] = None,
               project: Optional[str] = None,
               region: Optional[str] = None,
               security_policy: Optional[str] = None,
               session_affinity: Optional[str] = None)
func NewTargetPool(ctx *Context, name string, args *TargetPoolArgs, opts ...ResourceOption) (*TargetPool, error)
public TargetPool(string name, TargetPoolArgs? args = null, CustomResourceOptions? opts = null)
public TargetPool(String name, TargetPoolArgs args)
public TargetPool(String name, TargetPoolArgs args, CustomResourceOptions options)
type: gcp:compute:TargetPool
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args TargetPoolArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args TargetPoolArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args TargetPoolArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args TargetPoolArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TargetPoolArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var targetPoolResource = new Gcp.Compute.TargetPool("targetPoolResource", new()
{
    BackupPool = "string",
    Description = "string",
    FailoverRatio = 0,
    HealthChecks = "string",
    Instances = new[]
    {
        "string",
    },
    Name = "string",
    Project = "string",
    Region = "string",
    SecurityPolicy = "string",
    SessionAffinity = "string",
});
Copy
example, err := compute.NewTargetPool(ctx, "targetPoolResource", &compute.TargetPoolArgs{
	BackupPool:    pulumi.String("string"),
	Description:   pulumi.String("string"),
	FailoverRatio: pulumi.Float64(0),
	HealthChecks:  pulumi.String("string"),
	Instances: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:            pulumi.String("string"),
	Project:         pulumi.String("string"),
	Region:          pulumi.String("string"),
	SecurityPolicy:  pulumi.String("string"),
	SessionAffinity: pulumi.String("string"),
})
Copy
var targetPoolResource = new TargetPool("targetPoolResource", TargetPoolArgs.builder()
    .backupPool("string")
    .description("string")
    .failoverRatio(0)
    .healthChecks("string")
    .instances("string")
    .name("string")
    .project("string")
    .region("string")
    .securityPolicy("string")
    .sessionAffinity("string")
    .build());
Copy
target_pool_resource = gcp.compute.TargetPool("targetPoolResource",
    backup_pool="string",
    description="string",
    failover_ratio=0,
    health_checks="string",
    instances=["string"],
    name="string",
    project="string",
    region="string",
    security_policy="string",
    session_affinity="string")
Copy
const targetPoolResource = new gcp.compute.TargetPool("targetPoolResource", {
    backupPool: "string",
    description: "string",
    failoverRatio: 0,
    healthChecks: "string",
    instances: ["string"],
    name: "string",
    project: "string",
    region: "string",
    securityPolicy: "string",
    sessionAffinity: "string",
});
Copy
type: gcp:compute:TargetPool
properties:
    backupPool: string
    description: string
    failoverRatio: 0
    healthChecks: string
    instances:
        - string
    name: string
    project: string
    region: string
    securityPolicy: string
    sessionAffinity: string
Copy

TargetPool Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TargetPool resource accepts the following input properties:

BackupPool string
URL to the backup target pool. Must also set failover_ratio.
Description Changes to this property will trigger replacement. string
Textual description field.
FailoverRatio Changes to this property will trigger replacement. double
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
HealthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
Instances 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.
Name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
SecurityPolicy string
The resource URL for the security policy associated with this target pool.
SessionAffinity Changes to this property will trigger replacement. 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").
BackupPool string
URL to the backup target pool. Must also set failover_ratio.
Description Changes to this property will trigger replacement. string
Textual description field.
FailoverRatio Changes to this property will trigger replacement. float64
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
HealthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
Instances []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.
Name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
SecurityPolicy string
The resource URL for the security policy associated with this target pool.
SessionAffinity Changes to this property will trigger replacement. 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").
backupPool String
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. String
Textual description field.
failoverRatio Changes to this property will trigger replacement. Double
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks String
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. String
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Where the target pool resides. Defaults to project region.
securityPolicy String
The resource URL for the security policy associated with this target pool.
sessionAffinity Changes to this property will trigger replacement. 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").
backupPool string
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. string
Textual description field.
failoverRatio Changes to this property will trigger replacement. number
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
securityPolicy string
The resource URL for the security policy associated with this target pool.
sessionAffinity Changes to this property will trigger replacement. 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").
backup_pool str
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. str
Textual description field.
failover_ratio Changes to this property will trigger replacement. float
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
health_checks str
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances Sequence[str]
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.
name Changes to this property will trigger replacement. str
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Where the target pool resides. Defaults to project region.
security_policy str
The resource URL for the security policy associated with this target pool.
session_affinity Changes to this property will trigger replacement. str
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").
backupPool String
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. String
Textual description field.
failoverRatio Changes to this property will trigger replacement. Number
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks String
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. String
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Where the target pool resides. Defaults to project region.
securityPolicy String
The resource URL for the security policy associated with this target pool.
sessionAffinity Changes to this property will trigger replacement. 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").

Outputs

All input properties are implicitly available as output properties. Additionally, the TargetPool resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.
id string
The provider-assigned unique ID for this managed resource.
selfLink string
The URI of the created resource.
id str
The provider-assigned unique ID for this managed resource.
self_link str
The URI of the created resource.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.

Look up Existing TargetPool Resource

Get an existing TargetPool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TargetPoolState, opts?: CustomResourceOptions): TargetPool
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup_pool: Optional[str] = None,
        description: Optional[str] = None,
        failover_ratio: Optional[float] = None,
        health_checks: Optional[str] = None,
        instances: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        security_policy: Optional[str] = None,
        self_link: Optional[str] = None,
        session_affinity: Optional[str] = None) -> TargetPool
func GetTargetPool(ctx *Context, name string, id IDInput, state *TargetPoolState, opts ...ResourceOption) (*TargetPool, error)
public static TargetPool Get(string name, Input<string> id, TargetPoolState? state, CustomResourceOptions? opts = null)
public static TargetPool get(String name, Output<String> id, TargetPoolState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
BackupPool string
URL to the backup target pool. Must also set failover_ratio.
Description Changes to this property will trigger replacement. string
Textual description field.
FailoverRatio Changes to this property will trigger replacement. double
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
HealthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
Instances 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.
Name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
SecurityPolicy string
The resource URL for the security policy associated with this target pool.
SelfLink string
The URI of the created resource.
SessionAffinity Changes to this property will trigger replacement. 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").
BackupPool string
URL to the backup target pool. Must also set failover_ratio.
Description Changes to this property will trigger replacement. string
Textual description field.
FailoverRatio Changes to this property will trigger replacement. float64
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
HealthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
Instances []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.
Name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
SecurityPolicy string
The resource URL for the security policy associated with this target pool.
SelfLink string
The URI of the created resource.
SessionAffinity Changes to this property will trigger replacement. 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").
backupPool String
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. String
Textual description field.
failoverRatio Changes to this property will trigger replacement. Double
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks String
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. String
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Where the target pool resides. Defaults to project region.
securityPolicy String
The resource URL for the security policy associated with this target pool.
selfLink String
The URI of the created resource.
sessionAffinity Changes to this property will trigger replacement. 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").
backupPool string
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. string
Textual description field.
failoverRatio Changes to this property will trigger replacement. number
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks string
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Where the target pool resides. Defaults to project region.
securityPolicy string
The resource URL for the security policy associated with this target pool.
selfLink string
The URI of the created resource.
sessionAffinity Changes to this property will trigger replacement. 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").
backup_pool str
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. str
Textual description field.
failover_ratio Changes to this property will trigger replacement. float
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
health_checks str
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances Sequence[str]
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.
name Changes to this property will trigger replacement. str
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Where the target pool resides. Defaults to project region.
security_policy str
The resource URL for the security policy associated with this target pool.
self_link str
The URI of the created resource.
session_affinity Changes to this property will trigger replacement. str
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").
backupPool String
URL to the backup target pool. Must also set failover_ratio.
description Changes to this property will trigger replacement. String
Textual description field.
failoverRatio Changes to this property will trigger replacement. Number
Ratio (0 to 1) of failed nodes before using the backup pool (which must also be set).
healthChecks String
List of zero or one health check name or self_link. Only legacy gcp.compute.HttpHealthCheck is supported.
instances 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.
name Changes to this property will trigger replacement. String
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Where the target pool resides. Defaults to project region.
securityPolicy String
The resource URL for the security policy associated with this target pool.
selfLink String
The URI of the created resource.
sessionAffinity Changes to this property will trigger replacement. 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").

Import

Target pools can be imported using any of the following formats:

  • projects/{{project}}/regions/{{region}}/targetPools/{{name}}

  • {{project}}/{{region}}/{{name}}

  • {{region}}/{{name}}

  • {{name}}

When using the pulumi import command, target pools can be imported using one of the formats above. For example:

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

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.