Google Cloud Build Worker Pool
This page shows how to write Terraform for Cloud Build Worker Pool and write them securely.
google_cloudbuild_worker_pool (Terraform)
The Worker Pool in Cloud Build can be configured in Terraform with the resource name google_cloudbuild_worker_pool. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
The following arguments are supported:
location- (Required) The location for the resourcename- (Required) User-defined name of theWorkerPool.
network_config- (Optional) Network configuration for theWorkerPool. Structure is documented below.project- (Optional) The project for the resourceworker_config- (Optional) Configuration to be used for a creating workers in theWorkerPool. Structure is documented below.
The network_config block supports:
peered_network- (Required) Immutable. The network definition that the workers are peered to. If this section is left empty, the workers will be peered toWorkerPool.project_idon the service producer network. Must be in the formatprojects/[project]/global/networks/[network], where[project]is a project number, such as12345, and[network]is the name of a VPC network in the project. See (https://cloud.google.com/cloud-build/docs/custom-workers/set-up-custom-worker-pool-environment#understanding_the_network_configuration_options)
The worker_config block supports:
disk_size_gb- (Optional) Size of the disk attached to the worker, in GB. See (https://cloud.google.com/cloud-build/docs/custom-workers/worker-pool-config-file). Specify a value of up to 1000. If0is specified, Cloud Build will use a standard disk size.machine_type- (Optional) Machine type of a worker, such asn1-standard-1. See (https://cloud.google.com/cloud-build/docs/custom-workers/worker-pool-config-file). If left blank, Cloud Build will usen1-standard-1.no_external_ip- (Optional) If true, workers are created without any public address, which prevents network egress to public IPs.
In addition to the arguments listed above, the following computed attributes are exported:
id- an identifier for the resource with formatprojects/[[project]]/locations/[[location]]/workerPools/[[name]]create_time- Output only. Time at which the request to create theWorkerPoolwas received.delete_time- Output only. Time at which the request to delete theWorkerPoolwas received.state- Output only. WorkerPool state. Possible values: STATE_UNSPECIFIED, PENDING, APPROVED, REJECTED, CANCELLEDupdate_time- Output only. Time at which the request to update theWorkerPoolwas received.
Explanation in Terraform Registry
Definition of custom Cloud Build WorkerPools for running jobs with custom configuration and custom networking. -> This resource is not currently public, and requires allow-listing of projects prior to use.
Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.