@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
293 lines (292 loc) • 10.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Definition of custom Cloud Build WorkerPools for running jobs with custom configuration and custom networking.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const pool = new gcp.cloudbuild.WorkerPool("pool", {
* name: "my-pool",
* location: "europe-west1",
* workerConfig: {
* diskSizeGb: 100,
* machineType: "e2-standard-4",
* noExternalIp: false,
* },
* });
* ```
*
* ### Network Config
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const servicenetworking = new gcp.projects.Service("servicenetworking", {
* service: "servicenetworking.googleapis.com",
* disableOnDestroy: false,
* });
* const network = new gcp.compute.Network("network", {
* name: "my-network",
* autoCreateSubnetworks: false,
* }, {
* dependsOn: [servicenetworking],
* });
* const workerRange = new gcp.compute.GlobalAddress("worker_range", {
* name: "worker-pool-range",
* purpose: "VPC_PEERING",
* addressType: "INTERNAL",
* prefixLength: 16,
* network: network.id,
* });
* const workerPoolConn = new gcp.servicenetworking.Connection("worker_pool_conn", {
* network: network.id,
* service: "servicenetworking.googleapis.com",
* reservedPeeringRanges: [workerRange.name],
* }, {
* dependsOn: [servicenetworking],
* });
* const pool = new gcp.cloudbuild.WorkerPool("pool", {
* name: "my-pool",
* location: "europe-west1",
* workerConfig: {
* diskSizeGb: 100,
* machineType: "e2-standard-4",
* noExternalIp: false,
* },
* networkConfig: {
* peeredNetwork: network.id,
* peeredNetworkIpRange: "/29",
* },
* }, {
* dependsOn: [workerPoolConn],
* });
* ```
*
* ## Import
*
* WorkerPool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/workerPools/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, WorkerPool can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:cloudbuild/workerPool:WorkerPool default projects/{{project}}/locations/{{location}}/workerPools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:cloudbuild/workerPool:WorkerPool default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:cloudbuild/workerPool:WorkerPool default {{location}}/{{name}}
* ```
*/
export declare class WorkerPool extends pulumi.CustomResource {
/**
* Get an existing WorkerPool resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: WorkerPoolState, opts?: pulumi.CustomResourceOptions): WorkerPool;
/**
* Returns true if the given object is an instance of WorkerPool. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is WorkerPool;
/**
* User specified annotations. See https://google.aip.dev/128#annotations for more details such as format and size
* limitations. **Note**: This field is non-authoritative, and will only manage the annotations present in your
* configuration. Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
readonly annotations: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Output only. Time at which the request to create the `WorkerPool` was received.
*/
readonly createTime: pulumi.Output<string>;
/**
* Output only. Time at which the request to delete the `WorkerPool` was received.
*/
readonly deleteTime: pulumi.Output<string>;
/**
* A user-specified, human-readable name for the `WorkerPool`. If provided, this value must be 1-63 characters.
*/
readonly displayName: pulumi.Output<string | undefined>;
readonly effectiveAnnotations: pulumi.Output<{
[key: string]: string;
}>;
/**
* The location for the resource
*/
readonly location: pulumi.Output<string>;
/**
* User-defined name of the `WorkerPool`.
*
*
* - - -
*/
readonly name: pulumi.Output<string>;
/**
* Network configuration for the `WorkerPool`. Structure is documented below.
*/
readonly networkConfig: pulumi.Output<outputs.cloudbuild.WorkerPoolNetworkConfig | undefined>;
/**
* Private Service Connect configuration for the pool.
*/
readonly privateServiceConnect: pulumi.Output<outputs.cloudbuild.WorkerPoolPrivateServiceConnect | undefined>;
/**
* The project for the resource
*/
readonly project: pulumi.Output<string>;
/**
* Output only. WorkerPool state. Possible values: STATE_UNSPECIFIED, PENDING, APPROVED, REJECTED, CANCELLED
*/
readonly state: pulumi.Output<string>;
/**
* Output only. A unique identifier for the `WorkerPool`.
*/
readonly uid: pulumi.Output<string>;
/**
* Output only. Time at which the request to update the `WorkerPool` was received.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Configuration to be used for a creating workers in the `WorkerPool`. Structure is documented below.
*/
readonly workerConfig: pulumi.Output<outputs.cloudbuild.WorkerPoolWorkerConfig>;
/**
* Create a WorkerPool resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: WorkerPoolArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering WorkerPool resources.
*/
export interface WorkerPoolState {
/**
* User specified annotations. See https://google.aip.dev/128#annotations for more details such as format and size
* limitations. **Note**: This field is non-authoritative, and will only manage the annotations present in your
* configuration. Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Output only. Time at which the request to create the `WorkerPool` was received.
*/
createTime?: pulumi.Input<string>;
/**
* Output only. Time at which the request to delete the `WorkerPool` was received.
*/
deleteTime?: pulumi.Input<string>;
/**
* A user-specified, human-readable name for the `WorkerPool`. If provided, this value must be 1-63 characters.
*/
displayName?: pulumi.Input<string>;
effectiveAnnotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The location for the resource
*/
location?: pulumi.Input<string>;
/**
* User-defined name of the `WorkerPool`.
*
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* Network configuration for the `WorkerPool`. Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.cloudbuild.WorkerPoolNetworkConfig>;
/**
* Private Service Connect configuration for the pool.
*/
privateServiceConnect?: pulumi.Input<inputs.cloudbuild.WorkerPoolPrivateServiceConnect>;
/**
* The project for the resource
*/
project?: pulumi.Input<string>;
/**
* Output only. WorkerPool state. Possible values: STATE_UNSPECIFIED, PENDING, APPROVED, REJECTED, CANCELLED
*/
state?: pulumi.Input<string>;
/**
* Output only. A unique identifier for the `WorkerPool`.
*/
uid?: pulumi.Input<string>;
/**
* Output only. Time at which the request to update the `WorkerPool` was received.
*/
updateTime?: pulumi.Input<string>;
/**
* Configuration to be used for a creating workers in the `WorkerPool`. Structure is documented below.
*/
workerConfig?: pulumi.Input<inputs.cloudbuild.WorkerPoolWorkerConfig>;
}
/**
* The set of arguments for constructing a WorkerPool resource.
*/
export interface WorkerPoolArgs {
/**
* User specified annotations. See https://google.aip.dev/128#annotations for more details such as format and size
* limitations. **Note**: This field is non-authoritative, and will only manage the annotations present in your
* configuration. Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A user-specified, human-readable name for the `WorkerPool`. If provided, this value must be 1-63 characters.
*/
displayName?: pulumi.Input<string>;
/**
* The location for the resource
*/
location: pulumi.Input<string>;
/**
* User-defined name of the `WorkerPool`.
*
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* Network configuration for the `WorkerPool`. Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.cloudbuild.WorkerPoolNetworkConfig>;
/**
* Private Service Connect configuration for the pool.
*/
privateServiceConnect?: pulumi.Input<inputs.cloudbuild.WorkerPoolPrivateServiceConnect>;
/**
* The project for the resource
*/
project?: pulumi.Input<string>;
/**
* Configuration to be used for a creating workers in the `WorkerPool`. Structure is documented below.
*/
workerConfig?: pulumi.Input<inputs.cloudbuild.WorkerPoolWorkerConfig>;
}