Class WorkflowTemplate


  • public class WorkflowTemplate
    extends com.pulumi.resources.CustomResource
    A Workflow Template is a reusable workflow configuration. It defines a graph of jobs with information on where to run those jobs. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.dataproc.WorkflowTemplate; import com.pulumi.gcp.dataproc.WorkflowTemplateArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplateJobArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplateJobSparkJobArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplateJobPrestoJobArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigMasterConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigSoftwareConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigArgs; import com.pulumi.gcp.dataproc.inputs.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var template = new WorkflowTemplate("template", WorkflowTemplateArgs.builder() .jobs( WorkflowTemplateJobArgs.builder() .sparkJob(WorkflowTemplateJobSparkJobArgs.builder() .mainClass("SomeClass") .build()) .stepId("someJob") .build(), WorkflowTemplateJobArgs.builder() .prerequisiteStepIds("someJob") .prestoJob(WorkflowTemplateJobPrestoJobArgs.builder() .queryFileUri("someuri") .build()) .stepId("otherJob") .build()) .location("us-central1") .placement(WorkflowTemplatePlacementArgs.builder() .managedCluster(WorkflowTemplatePlacementManagedClusterArgs.builder() .clusterName("my-cluster") .config(WorkflowTemplatePlacementManagedClusterConfigArgs.builder() .gceClusterConfig(WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigArgs.builder() .tags( "foo", "bar") .zone("us-central1-a") .build()) .masterConfig(WorkflowTemplatePlacementManagedClusterConfigMasterConfigArgs.builder() .diskConfig(WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigArgs.builder() .bootDiskSizeGb(15) .bootDiskType("pd-ssd") .build()) .machineType("n1-standard-1") .numInstances(1) .build()) .secondaryWorkerConfig(WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigArgs.builder() .numInstances(2) .build()) .softwareConfig(WorkflowTemplatePlacementManagedClusterConfigSoftwareConfigArgs.builder() .imageVersion("2.0.35-debian10") .build()) .workerConfig(WorkflowTemplatePlacementManagedClusterConfigWorkerConfigArgs.builder() .diskConfig(WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigArgs.builder() .bootDiskSizeGb(10) .numLocalSsds(2) .build()) .machineType("n1-standard-2") .numInstances(3) .build()) .build()) .build()) .build()) .build()); } } ``` ## Import WorkflowTemplate can be imported using any of these accepted formats* `projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}` * `{{project}}/{{location}}/{{name}}` * `{{location}}/{{name}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WorkflowTemplate using one of the formats above. For exampletf import { id = "projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}" to = google_dataproc_workflow_template.default } ```sh $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> dagTimeout()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.Object>> effectiveLabels()  
      static WorkflowTemplate get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, WorkflowTemplateState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.List<WorkflowTemplateJob>> jobs()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()  
      com.pulumi.core.Output<java.lang.String> location()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<WorkflowTemplateParameter>>> parameters()  
      com.pulumi.core.Output<WorkflowTemplatePlacement> placement()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.Object>> pulumiLabels()  
      com.pulumi.core.Output<java.lang.String> updateTime()  
      com.pulumi.core.Output<java.lang.Integer> version()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkflowTemplate

        public WorkflowTemplate​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • WorkflowTemplate

        public WorkflowTemplate​(java.lang.String name,
                                WorkflowTemplateArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • WorkflowTemplate

        public WorkflowTemplate​(java.lang.String name,
                                WorkflowTemplateArgs args,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        Output only. The time template was created.
      • dagTimeout

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> dagTimeout()
        Returns:
        (Beta only) Optional. Timeout duration for the DAG of jobs. You can use "s", "m", "h", and "d" suffixes for second, minute, hour, and day duration values, respectively. The timeout duration must be from 10 minutes ("10m") to 24 hours ("24h" or "1d"). The timer begins when the first job is submitted. If the workflow is running at the end of the timeout period, any remaining jobs are cancelled, the workflow is ended, and if the workflow was running on a (/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), the cluster is deleted.
      • effectiveLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.Object>> effectiveLabels()
        Returns:
        All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
      • jobs

        public com.pulumi.core.Output<java.util.List<WorkflowTemplateJob>> jobs()
        Returns:
        Required. The Directed Acyclic Graph of Jobs to submit.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance. Label **keys** must contain 1 to 63 characters, and must conform to (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a template.
      • location

        public com.pulumi.core.Output<java.lang.String> location()
        Returns:
        The location for the resource
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. * For `projects.regions.workflowTemplates`, the resource name of the template has the following format: `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` * For `projects.locations.workflowTemplates`, the resource name of the template has the following format: `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
      • parameters

        public com.pulumi.core.Output<java.util.Optional<java.util.List<WorkflowTemplateParameter>>> parameters()
        Returns:
        Template parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated.
      • placement

        public com.pulumi.core.Output<WorkflowTemplatePlacement> placement()
        Returns:
        Required. WorkflowTemplate scheduling information.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The project for the resource
      • pulumiLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.Object>> pulumiLabels()
        Returns:
        The combination of labels configured directly on the resource and default labels configured on the provider.
      • updateTime

        public com.pulumi.core.Output<java.lang.String> updateTime()
        Returns:
        Output only. The time template was last updated.
      • version

        public com.pulumi.core.Output<java.lang.Integer> version()
        Returns:
        Used to perform a consistent read-modify-write. This field should be left blank for a `CreateWorkflowTemplate` request. It is required for an `UpdateWorkflowTemplate` request, and must match the current server version. A typical update template flow would fetch the current template with a `GetWorkflowTemplate` request, which will return the current template with the `version` field filled in with the current server version. The user updates other fields in the template, then returns it as part of the `UpdateWorkflowTemplate` request.
      • get

        public static WorkflowTemplate get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           WorkflowTemplateState state,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.