@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
176 lines • 7.54 kB
JavaScript
;
// *** 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.WorkflowTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Workflow Template is a reusable workflow configuration. It defines a graph of jobs with information on where to run those jobs.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const template = new gcp.dataproc.WorkflowTemplate("template", {
* name: "template-example",
* location: "us-central1",
* placement: {
* managedCluster: {
* clusterName: "my-cluster",
* config: {
* gceClusterConfig: {
* zone: "us-central1-a",
* tags: [
* "foo",
* "bar",
* ],
* },
* masterConfig: {
* numInstances: 1,
* machineType: "n1-standard-1",
* diskConfig: {
* bootDiskType: "pd-ssd",
* bootDiskSizeGb: 15,
* },
* },
* workerConfig: {
* numInstances: 3,
* machineType: "n1-standard-2",
* diskConfig: {
* bootDiskSizeGb: 10,
* numLocalSsds: 2,
* },
* },
* secondaryWorkerConfig: {
* numInstances: 2,
* },
* softwareConfig: {
* imageVersion: "2.0.35-debian10",
* },
* },
* },
* },
* jobs: [
* {
* stepId: "someJob",
* sparkJob: {
* mainClass: "SomeClass",
* },
* },
* {
* stepId: "otherJob",
* prerequisiteStepIds: ["someJob"],
* prestoJob: {
* queryFileUri: "someuri",
* },
* },
* ],
* });
* ```
*
* ## Import
*
* WorkflowTemplate can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, WorkflowTemplate can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default {{location}}/{{name}}
* ```
*/
class WorkflowTemplate extends pulumi.CustomResource {
/**
* Get an existing WorkflowTemplate 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 WorkflowTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of WorkflowTemplate. 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'] === WorkflowTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["dagTimeout"] = state ? state.dagTimeout : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["encryptionConfig"] = state ? state.encryptionConfig : undefined;
resourceInputs["jobs"] = state ? state.jobs : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["placement"] = state ? state.placement : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.jobs === undefined) && !opts.urn) {
throw new Error("Missing required property 'jobs'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.placement === undefined) && !opts.urn) {
throw new Error("Missing required property 'placement'");
}
resourceInputs["dagTimeout"] = args ? args.dagTimeout : undefined;
resourceInputs["encryptionConfig"] = args ? args.encryptionConfig : undefined;
resourceInputs["jobs"] = args ? args.jobs : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["placement"] = args ? args.placement : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(WorkflowTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.WorkflowTemplate = WorkflowTemplate;
/** @internal */
WorkflowTemplate.__pulumiType = 'gcp:dataproc/workflowTemplate:WorkflowTemplate';
//# sourceMappingURL=workflowTemplate.js.map