UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

188 lines • 7.92 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Pipeline = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * The main pipeline entity and all the necessary metadata for launching and managing linked jobs. * * To get more information about Pipeline, see: * * * [API documentation](https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dataflow) * * ## Example Usage * * ### Data Pipeline Pipeline * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const serviceAccount = new gcp.serviceaccount.Account("service_account", { * accountId: "my-account", * displayName: "Service Account", * }); * const primary = new gcp.dataflow.Pipeline("primary", { * name: "my-pipeline", * displayName: "my-pipeline", * type: "PIPELINE_TYPE_BATCH", * state: "STATE_ACTIVE", * region: "us-central1", * workload: { * dataflowLaunchTemplateRequest: { * projectId: "my-project", * gcsPath: "gs://my-bucket/path", * launchParameters: { * jobName: "my-job", * parameters: { * name: "wrench", * }, * environment: { * numWorkers: 5, * maxWorkers: 5, * zone: "us-centra1-a", * serviceAccountEmail: serviceAccount.email, * network: "default", * tempLocation: "gs://my-bucket/tmp_dir", * bypassTempDirValidation: false, * machineType: "E2", * additionalUserLabels: { * context: "test", * }, * workerRegion: "us-central1", * workerZone: "us-central1-a", * enableStreamingEngine: false, * }, * update: false, * transformNameMapping: { * name: "wrench", * }, * }, * location: "us-central1", * }, * }, * scheduleInfo: { * schedule: "* */2 * * *", * }, * }); * ``` * * ## Import * * Pipeline can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/pipelines/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, Pipeline can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataflow/pipeline:Pipeline default projects/{{project}}/locations/{{region}}/pipelines/{{name}} * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{region}}/{{name}} * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{name}} * ``` */ class Pipeline extends pulumi.CustomResource { /** * Get an existing Pipeline 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, id, state, opts) { return new Pipeline(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:dataflow/pipeline:Pipeline'; /** * Returns true if the given object is an instance of Pipeline. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Pipeline.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["displayName"] = state?.displayName; resourceInputs["jobCount"] = state?.jobCount; resourceInputs["lastUpdateTime"] = state?.lastUpdateTime; resourceInputs["name"] = state?.name; resourceInputs["pipelineSources"] = state?.pipelineSources; resourceInputs["project"] = state?.project; resourceInputs["region"] = state?.region; resourceInputs["scheduleInfo"] = state?.scheduleInfo; resourceInputs["schedulerServiceAccountEmail"] = state?.schedulerServiceAccountEmail; resourceInputs["state"] = state?.state; resourceInputs["type"] = state?.type; resourceInputs["workload"] = state?.workload; } else { const args = argsOrState; if (args?.state === undefined && !opts.urn) { throw new Error("Missing required property 'state'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["displayName"] = args?.displayName; resourceInputs["name"] = args?.name; resourceInputs["pipelineSources"] = args?.pipelineSources; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; resourceInputs["scheduleInfo"] = args?.scheduleInfo; resourceInputs["schedulerServiceAccountEmail"] = args?.schedulerServiceAccountEmail; resourceInputs["state"] = args?.state; resourceInputs["type"] = args?.type; resourceInputs["workload"] = args?.workload; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["jobCount"] = undefined /*out*/; resourceInputs["lastUpdateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Pipeline.__pulumiType, name, resourceInputs, opts); } } exports.Pipeline = Pipeline; //# sourceMappingURL=pipeline.js.map