1. Registry
  2. Packages
  3. Google Cloud (GCP)
  4. API Docs
  5. cloudbuild
  6. getWorkerPool
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi

    To get more information about Cloudbuild worker pool, see:

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const name = gcp.cloudbuild.getWorkerPool({
        project: "your-project-id",
        name: "your-pool",
        location: "europe-west1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    name = gcp.cloudbuild.get_worker_pool(project="your-project-id",
        name="your-pool",
        location="europe-west1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/cloudbuild"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudbuild.LookupWorkerPool(ctx, &cloudbuild.LookupWorkerPoolArgs{
    			Project:  pulumi.StringRef("your-project-id"),
    			Name:     "your-pool",
    			Location: "europe-west1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var name = Gcp.CloudBuild.GetWorkerPool.Invoke(new()
        {
            Project = "your-project-id",
            Name = "your-pool",
            Location = "europe-west1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.cloudbuild.CloudbuildFunctions;
    import com.pulumi.gcp.cloudbuild.inputs.GetWorkerPoolArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var name = CloudbuildFunctions.getWorkerPool(GetWorkerPoolArgs.builder()
                .project("your-project-id")
                .name("your-pool")
                .location("europe-west1")
                .build());
    
        }
    }
    
    variables:
      name:
        fn::invoke:
          function: gcp:cloudbuild:getWorkerPool
          arguments:
            project: your-project-id
            name: your-pool
            location: europe-west1
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_cloudbuild_worker_pool" "name" {
      project  = "your-project-id"
      name     = "your-pool"
      location = "europe-west1"
    }
    

    Using getWorkerPool

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getWorkerPool(args: GetWorkerPoolArgs, opts?: InvokeOptions): Promise<GetWorkerPoolResult>
    function getWorkerPoolOutput(args: GetWorkerPoolOutputArgs, opts?: InvokeOutputOptions): Output<GetWorkerPoolResult>
    def get_worker_pool(location: Optional[str] = None,
                        name: Optional[str] = None,
                        project: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetWorkerPoolResult
    def get_worker_pool_output(location: pulumi.Input[Optional[str]] = None,
                        name: pulumi.Input[Optional[str]] = None,
                        project: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOutputOptions] = None) -> Output[GetWorkerPoolResult]
    func LookupWorkerPool(ctx *Context, args *LookupWorkerPoolArgs, opts ...InvokeOption) (*LookupWorkerPoolResult, error)
    func LookupWorkerPoolOutput(ctx *Context, args *LookupWorkerPoolOutputArgs, opts ...InvokeOption) LookupWorkerPoolResultOutput

    > Note: This function is named LookupWorkerPool in the Go SDK.

    public static class GetWorkerPool 
    {
        public static Task<GetWorkerPoolResult> InvokeAsync(GetWorkerPoolArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkerPoolResult> Invoke(GetWorkerPoolInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkerPoolResult> Invoke(GetWorkerPoolInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetWorkerPoolResult> getWorkerPool(GetWorkerPoolArgs args, InvokeOptions options)
    public static Output<GetWorkerPoolResult> getWorkerPool(GetWorkerPoolArgs args, InvokeOptions options)
    public static Output<GetWorkerPoolResult> getWorkerPool(GetWorkerPoolArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: gcp:cloudbuild/getWorkerPool:getWorkerPool
      arguments:
        # arguments dictionary
    data "gcp_cloudbuild_get_worker_pool" "name" {
        # arguments
    }

    The following arguments are supported:

    Location string
    The Cloud Build location for the worker pool.
    Name string
    User-defined name of the worker pool.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    Location string
    The Cloud Build location for the worker pool.
    Name string
    User-defined name of the worker pool.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    location string
    The Cloud Build location for the worker pool.
    name string
    User-defined name of the worker pool.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    location String
    The Cloud Build location for the worker pool.
    name String
    User-defined name of the worker pool.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    location string
    The Cloud Build location for the worker pool.
    name string
    User-defined name of the worker pool.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    location str
    The Cloud Build location for the worker pool.
    name str
    User-defined name of the worker pool.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    location String
    The Cloud Build location for the worker pool.
    name String
    User-defined name of the worker pool.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.


    getWorkerPool Result

    The following output properties are available:

    Annotations Dictionary<string, string>
    CreateTime string
    DeleteTime string
    DeletionPolicy string
    DisplayName string
    EffectiveAnnotations Dictionary<string, string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    NetworkConfigs List<GetWorkerPoolNetworkConfig>
    PrivateServiceConnects List<GetWorkerPoolPrivateServiceConnect>
    State string
    Uid string
    UpdateTime string
    WorkerConfigs List<GetWorkerPoolWorkerConfig>
    Project string
    Annotations map[string]string
    CreateTime string
    DeleteTime string
    DeletionPolicy string
    DisplayName string
    EffectiveAnnotations map[string]string
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    NetworkConfigs []GetWorkerPoolNetworkConfig
    PrivateServiceConnects []GetWorkerPoolPrivateServiceConnect
    State string
    Uid string
    UpdateTime string
    WorkerConfigs []GetWorkerPoolWorkerConfig
    Project string
    annotations map(string)
    create_time string
    delete_time string
    deletion_policy string
    display_name string
    effective_annotations map(string)
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    network_configs list(object)
    private_service_connects list(object)
    state string
    uid string
    update_time string
    worker_configs list(object)
    project string
    annotations {[key: string]: string}
    createTime string
    deleteTime string
    deletionPolicy string
    displayName string
    effectiveAnnotations {[key: string]: string}
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    networkConfigs GetWorkerPoolNetworkConfig[]
    privateServiceConnects GetWorkerPoolPrivateServiceConnect[]
    state string
    uid string
    updateTime string
    workerConfigs GetWorkerPoolWorkerConfig[]
    project string
    annotations Map<String>
    createTime String
    deleteTime String
    deletionPolicy String
    displayName String
    effectiveAnnotations Map<String>
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    networkConfigs List<Property Map>
    privateServiceConnects List<Property Map>
    state String
    uid String
    updateTime String
    workerConfigs List<Property Map>
    project String

    Supporting Types

    GetWorkerPoolNetworkConfig

    PeeredNetwork string
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    PeeredNetworkIpRange string
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    PeeredNetwork string
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    PeeredNetworkIpRange string
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    peered_network string
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    peered_network_ip_range string
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    peeredNetwork String
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    peeredNetworkIpRange String
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    peeredNetwork string
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    peeredNetworkIpRange string
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    peered_network str
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    peered_network_ip_range str
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.
    peeredNetwork String
    Required. Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered to WorkerPool.project_id on the service producer network. Must be in the format projects/{project}/global/networks/{network}, where {project} is a project number, such as 12345, and {network} is the name of a VPC network in the project. See Understanding network configuration options
    peeredNetworkIpRange String
    Optional. Immutable. Subnet IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. 192.168.0.0/29 would specify an IP range starting at 192.168.0.0 with a prefix size of 29 bits. /16 would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of /24 will be used.

    GetWorkerPoolPrivateServiceConnect

    NetworkAttachment string
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    RouteAllTraffic bool
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    NetworkAttachment string
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    RouteAllTraffic bool
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    network_attachment string
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    route_all_traffic bool
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    networkAttachment String
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    routeAllTraffic Boolean
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    networkAttachment string
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    routeAllTraffic boolean
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    network_attachment str
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    route_all_traffic bool
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.
    networkAttachment String
    Required. Immutable. The network attachment that the worker network interface is connected to. Must be in the format projects/{project}/regions/{region}/networkAttachments/{networkAttachment}. The region of network attachment must be the same as the worker pool. See Network Attachments
    routeAllTraffic Boolean
    Immutable. Route all traffic through PSC interface. Enable this if you want full control of traffic in the private pool. Configure Cloud NAT for the subnet of network attachment if you need to access public Internet. If false, Only route private IPs, e.g. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 through PSC interface.

    GetWorkerPoolWorkerConfig

    DiskSizeGb int
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    EnableNestedVirtualization bool
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    MachineType string
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    NoExternalIp bool
    If true, workers are created without any public address, which prevents network egress to public IPs.
    DiskSizeGb int
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    EnableNestedVirtualization bool
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    MachineType string
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    NoExternalIp bool
    If true, workers are created without any public address, which prevents network egress to public IPs.
    disk_size_gb number
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    enable_nested_virtualization bool
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    machine_type string
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    no_external_ip bool
    If true, workers are created without any public address, which prevents network egress to public IPs.
    diskSizeGb Integer
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    enableNestedVirtualization Boolean
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    machineType String
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    noExternalIp Boolean
    If true, workers are created without any public address, which prevents network egress to public IPs.
    diskSizeGb number
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    enableNestedVirtualization boolean
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    machineType string
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    noExternalIp boolean
    If true, workers are created without any public address, which prevents network egress to public IPs.
    disk_size_gb int
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    enable_nested_virtualization bool
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    machine_type str
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    no_external_ip bool
    If true, workers are created without any public address, which prevents network egress to public IPs.
    diskSizeGb Number
    Size of the disk attached to the worker, in GB. See Worker pool config file. Specify a value of up to 1000. If 0 is specified, Cloud Build will use a standard disk size.
    enableNestedVirtualization Boolean
    Enable nested virtualization on the worker, if supported by the machine type. See Worker pool config file. If left blank, Cloud Build will set this to false.
    machineType String
    Machine type of a worker, such as n1-standard-1. See Worker pool config file. If left blank, Cloud Build will use n1-standard-1.
    noExternalIp Boolean
    If true, workers are created without any public address, which prevents network egress to public IPs.

    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.
    gcp logo
    Viewing docs for Google Cloud v10.2.0
    published on Tuesday, Oct 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial