UNPKG

@pulumi/gcp

Version:

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

175 lines 7.29 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Pipeline = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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}} * ``` * * ```sh * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{region}}/{{name}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.createTime : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["jobCount"] = state ? state.jobCount : undefined; resourceInputs["lastUpdateTime"] = state ? state.lastUpdateTime : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["pipelineSources"] = state ? state.pipelineSources : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["scheduleInfo"] = state ? state.scheduleInfo : undefined; resourceInputs["schedulerServiceAccountEmail"] = state ? state.schedulerServiceAccountEmail : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["workload"] = state ? state.workload : undefined; } else { const args = argsOrState; if ((!args || args.state === undefined) && !opts.urn) { throw new Error("Missing required property 'state'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["pipelineSources"] = args ? args.pipelineSources : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["scheduleInfo"] = args ? args.scheduleInfo : undefined; resourceInputs["schedulerServiceAccountEmail"] = args ? args.schedulerServiceAccountEmail : undefined; resourceInputs["state"] = args ? args.state : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["workload"] = args ? args.workload : undefined; 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; /** @internal */ Pipeline.__pulumiType = 'gcp:dataflow/pipeline:Pipeline'; //# sourceMappingURL=pipeline.js.map