Skip to content

googleDataprocWorkflowTemplate

A Workflow Template is a reusable workflow configuration. It defines a graph of jobs with information on where to run those jobs.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.dataprocWorkflowTemplate.DataprocWorkflowTemplate(this, "template", {
  jobs: [
    {
      spark_job: [
        {
          main_class: "SomeClass",
        },
      ],
      step_id: "someJob",
    },
    {
      prerequisite_step_ids: ["someJob"],
      presto_job: [
        {
          query_file_uri: "someuri",
        },
      ],
      step_id: "otherJob",
    },
  ],
  location: "us-central1",
  name: "template-example",
  placement: [
    {
      managed_cluster: [
        {
          cluster_name: "my-cluster",
          config: [
            {
              gce_cluster_config: [
                {
                  tags: ["foo", "bar"],
                  zone: "us-central1-a",
                },
              ],
              master_config: [
                {
                  disk_config: [
                    {
                      boot_disk_size_gb: 15,
                      boot_disk_type: "pd-ssd",
                    },
                  ],
                  machine_type: "n1-standard-1",
                  num_instances: 1,
                },
              ],
              secondary_worker_config: [
                {
                  num_instances: 2,
                },
              ],
              software_config: [
                {
                  image_version: "2.0.35-debian10",
                },
              ],
              worker_config: [
                {
                  disk_config: [
                    {
                      boot_disk_size_gb: 10,
                      num_local_ssds: 2,
                    },
                  ],
                  machine_type: "n1-standard-2",
                  num_instances: 3,
                },
              ],
            },
          ],
        },
      ],
    },
  ],
});

Argument Reference

The following arguments are supported:

  • jobs - (Required) Required. The Directed Acyclic Graph of Jobs to submit.

  • location - (Required) The location for the resource

  • name - (Required) Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. * For projectsRegionsWorkflowTemplates, the resource name of the template has the following format: projects/{projectId}/regions/{region}/workflowTemplates/{templateId} * For projectsLocationsWorkflowTemplates, the resource name of the template has the following format: projects/{projectId}/locations/{location}/workflowTemplates/{templateId}

  • placement - (Required) Required. WorkflowTemplate scheduling information.

The jobs block supports:

  • hadoopJob - (Optional) Optional. Job is a Hadoop job.

  • hiveJob - (Optional) Optional. Job is a Hive job.

  • labels - (Optional) Optional. The labels to associate with this job. Label keys must be between 1 and 63 characters long, and must conform to the following regular expression: {0,63} No more than 32 labels can be associated with a given job.

  • pigJob - (Optional) Optional. Job is a Pig job.

  • prerequisiteStepIds - (Optional) Optional. The optional list of prerequisite job step_ids. If not specified, the job will start at the beginning of workflow.

  • prestoJob - (Optional) Optional. Job is a Presto job.

  • pysparkJob - (Optional) Optional. Job is a PySpark job.

  • scheduling - (Optional) Optional. Job scheduling configuration.

  • sparkJob - (Optional) Optional. Job is a Spark job.

  • sparkRJob - (Optional) Optional. Job is a SparkR job.

  • sparkSqlJob - (Optional) Optional. Job is a SparkSql job.

  • stepId - (Required) Required. The step id. The id must be unique among all jobs within the template. The step id is used as prefix for job id, as job googDataprocWorkflowStepId label, and in field from other steps. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters.

The placement block supports:

  • clusterSelector - (Optional) Optional. A selector that chooses target cluster for jobs based on metadata. The selector is evaluated at the time each job is submitted.

  • managedCluster - (Optional) A cluster that is managed by the workflow.

The config block supports:

  • autoscalingConfig - (Optional) Optional. Autoscaling config for the policy associated with the cluster. Cluster does not autoscale if this field is unset.

  • encryptionConfig - (Optional) Optional. Encryption settings for the cluster.

  • endpointConfig - (Optional) Optional. Port/endpoint configuration for this cluster

  • gceClusterConfig - (Optional) Optional. The shared Compute Engine config settings for all instances in a cluster.

  • gkeClusterConfig - (Optional) Optional. The Kubernetes Engine config for Dataproc clusters deployed to Kubernetes. Setting this is considered mutually exclusive with Compute Engine-based options such as gceClusterConfig, masterConfig, workerConfig, secondaryWorkerConfig, and autoscalingConfig.

  • initializationActions - (Optional) Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a node's role metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget): ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) if ; then ... master specific actions ... else ... worker specific actions ... fi

  • lifecycleConfig - (Optional) Optional. Lifecycle setting for the cluster.

  • masterConfig - (Optional) Optional. The Compute Engine config settings for additional worker instances in a cluster.

  • metastoreConfig - (Optional) Optional. Metastore configuration.

  • secondaryWorkerConfig - (Optional) Optional. The Compute Engine config settings for additional worker instances in a cluster.

  • securityConfig - (Optional) Optional. Security settings for the cluster.

  • softwareConfig - (Optional) Optional. The config settings for software inside the cluster.

  • stagingBucket - (Optional) Optional. A Cloud Storage bucket used to stage job dependencies, config files, and job driver console output. If you do not specify a staging bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Compute Engine zone where your cluster is deployed, and then create and manage this project-level, per-location bucket (see (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).

  • tempBucket - (Optional) Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, such as Spark and MapReduce history files. If you do not specify a temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or EU) for your cluster's temp bucket according to the Compute Engine zone where your cluster is deployed, and then create and manage this project-level, per-location bucket. The default bucket has a TTL of 90 days, but you can use any TTL (or none) if you specify a bucket.

  • workerConfig - (Optional) Optional. The Compute Engine config settings for additional worker instances in a cluster.


  • dagTimeout - (Optional) (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.

  • labels - (Optional) Optional. 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.

  • parameters - (Optional) Optional. Template parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated.

  • project - (Optional) The project for the resource

  • version - (Optional) Optional. 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.

The hadoopJob block supports:

  • archiveUris - (Optional) Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip.

  • args - (Optional) Optional. The arguments to pass to the driver. Do not include arguments, such as libjars or dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission.

  • fileUris - (Optional) Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks.

  • jarFileUris - (Optional) Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • mainClass - (Optional) The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jarFileUris.

  • mainJarFileUri - (Optional) The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'

  • properties - (Optional) Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code.

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The hiveJob block supports:

  • continueOnFailure - (Optional) Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.

  • jarFileUris - (Optional) Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs.

  • properties - (Optional) Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code.

  • queryFileUri - (Optional) The HCFS URI of the script that contains Hive queries.

  • queryList - (Optional) A list of queries.

  • scriptVariables - (Optional) Optional. Mapping of query variable names to values (equivalent to the Hive command: setName="value";).

The queryList block supports:

  • queries - (Required) Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": } }

The pigJob block supports:

  • continueOnFailure - (Optional) Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.

  • jarFileUris - (Optional) Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • properties - (Optional) Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code.

  • queryFileUri - (Optional) The HCFS URI of the script that contains the Pig queries.

  • queryList - (Optional) A list of queries.

  • scriptVariables - (Optional) Optional. Mapping of query variable names to values (equivalent to the Pig command: name=).

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The queryList block supports:

  • queries - (Required) Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": } }

The prestoJob block supports:

  • clientTags - (Optional) Optional. Presto client tags to attach to this query

  • continueOnFailure - (Optional) Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • outputFormat - (Optional) Optional. The format in which query output will be displayed. See the Presto documentation for supported output formats

  • properties - (Optional) Optional. A mapping of property names to values. Used to set Presto (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to using the --session flag in the Presto CLI

  • queryFileUri - (Optional) The HCFS URI of the script that contains SQL queries.

  • queryList - (Optional) A list of queries.

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The queryList block supports:

  • queries - (Required) Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": } }

The pysparkJob block supports:

  • archiveUris - (Optional) Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.

  • args - (Optional) Optional. The arguments to pass to the driver. Do not include arguments, such as conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.

  • fileUris - (Optional) Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.

  • jarFileUris - (Optional) Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • mainPythonFileUri - (Required) Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file.

  • properties - (Optional) Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.

  • pythonFileUris - (Optional) Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip.

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The scheduling block supports:

  • maxFailuresPerHour - (Optional) Optional. Maximum number of times per hour a driver may be restarted as a result of driver exiting with non-zero code before job is reported failed. A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window. Maximum value is 10.

  • maxFailuresTotal - (Optional) Optional. Maximum number of times in total a driver may be restarted as a result of driver exiting with non-zero code before job is reported failed. Maximum value is 240

The sparkJob block supports:

  • archiveUris - (Optional) Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.

  • args - (Optional) Optional. The arguments to pass to the driver. Do not include arguments, such as conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.

  • fileUris - (Optional) Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.

  • jarFileUris - (Optional) Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • mainClass - (Optional) The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jarFileUris.

  • mainJarFileUri - (Optional) The HCFS URI of the jar file that contains the main class.

  • properties - (Optional) Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The sparkRJob block supports:

  • archiveUris - (Optional) Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.

  • args - (Optional) Optional. The arguments to pass to the driver. Do not include arguments, such as conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.

  • fileUris - (Optional) Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • mainRFileUri - (Required) Required. The HCFS URI of the main R file to use as the driver. Must be a .R file.

  • properties - (Optional) Optional. A mapping of property names to values, used to configure SparkR. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The sparkSqlJob block supports:

  • jarFileUris - (Optional) Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.

  • loggingConfig - (Optional) Optional. The runtime log config for job execution.

  • properties - (Optional) Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Dataproc API may be overwritten.

  • queryFileUri - (Optional) The HCFS URI of the script that contains SQL queries.

  • queryList - (Optional) A list of queries.

  • scriptVariables - (Optional) Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";).

The loggingConfig block supports:

  • driverLogLevels - (Optional) The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'

The queryList block supports:

  • queries - (Required) Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": } }

The parameters block supports:

  • description - (Optional) Optional. Brief description of the parameter. Must not exceed 1024 characters.

  • fields - (Required) Required. Paths to all fields that the parameter replaces. A field is allowed to appear in at most one parameter's list of field paths. A field path is similar in syntax to a .sparkJob.args

  • name - (Required) Required. Parameter name. The parameter name is used as the key, and paired with the parameter value, which are passed to the template when the template is instantiated. The name must contain only capital letters (A-Z), numbers (0-9), and underscores (_), and must not start with a number. The maximum length is 40 characters.

  • validation - (Optional) Optional. Validation rules to be applied to this parameter's value.

The validation block supports:

  • regex - (Optional) Validation based on regular expressions.

  • values - (Optional) Validation based on a list of allowed values.

The regex block supports:

  • regexes - (Required) Required. RE2 regular expressions used to validate the parameter's value. The value must match the regex in its entirety (substring matches are not sufficient).

The values block supports:

  • values - (Required) Required. List of allowed values for the parameter.

The clusterSelector block supports:

  • clusterLabels - (Required) Required. The cluster labels. Cluster must have all labels to match.

  • zone - (Optional) Optional. The zone where workflow process executes. This parameter does not affect the selection of the cluster. If unspecified, the zone of the first cluster matching the selector is used.

The managedCluster block supports:

  • clusterName - (Required) Required. The cluster name prefix. A unique cluster name will be formed by appending a random suffix. The name must contain only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must begin with a letter. Cannot begin or end with hyphen. Must consist of between 2 and 35 characters.

  • config - (Required) Required. The cluster configuration.

  • labels - (Optional) Optional. The labels to associate with this cluster. Label keys must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: {0,63} No more than 32 labels can be associated with a given cluster.

The masterConfig block supports:

  • accelerators - (Optional) Optional. The Compute Engine accelerator configuration for these instances.

  • diskConfig - (Optional) Optional. Disk option config settings.

  • image - (Optional) Optional. The Compute Engine image resource used for cluster instances. The URI can represent an image or image family. Image examples: * https://wwwGoogleapisCom/compute/beta/projects/ If the URI is unspecified, it will be inferred from softwareConfigImageVersion or the system default.

  • machineType - (Optional) Optional. The Compute Engine machine type used for cluster instances. A full URL, partial URI, or short name are valid. Examples: * https://wwwGoogleapisCom/compute/v1/projects/(https://cloudGoogleCom/dataproc/docs/concepts/configuringClusters/autoZone#usingAutoZonePlacement)Feature,YouMustUseTheShortNameOfTheMachineTypeResource,ForExample,n1-standard-2`.

  • minCpuPlatform - (Optional) Optional. Specifies the minimum cpu platform for the Instance Group. See (https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu).

  • numInstances - (Optional) Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1.

  • preemptibility - (Optional) Optional. Specifies the preemptibility of the instance group. The default value for master and worker groups is nonPreemptible. This default cannot be changed. The default value for secondary instances is preemptible. Possible values: PREEMPTIBILITY_UNSPECIFIED, NON_PREEMPTIBLE, PREEMPTIBLE

  • instanceNames - Output only. The list of instance names. Dataproc derives the names from clusterName, numInstances, and the instance group.

  • isPreemptible - Output only. Specifies that this instance group contains preemptible instances.

  • managedGroupConfig - Output only. The config for Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups.

The accelerators block supports:

  • acceleratorCount - (Optional) The number of the accelerator cards of this type exposed to this instance.

  • acceleratorType - (Optional) Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) feature, you must use the short name of the accelerator type resource, for example, nvidiaTeslaK80.

The diskConfig block supports:

  • bootDiskSizeGb - (Optional) Optional. Size in GB of the boot disk (default is 500GB).

  • bootDiskType - (Optional) Optional. Type of the boot disk (default is "pd-standard"). Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or "pd-standard" (Persistent Disk Hard Disk Drive).

  • numLocalSsds - (Optional) Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.

The autoscalingConfig block supports:

  • policy - (Optional) Optional. The autoscaling policy used by the cluster. Only resource names including projectid and location (region) are valid. Examples: * https://wwwGoogleapisCom/compute/v1/projects/ Note that the policy must be in the same project and Dataproc region.

The encryptionConfig block supports:

  • gcePdKmsKeyName - (Optional) Optional. The Cloud KMS key name to use for PD disk encryption for all instances in the cluster.

The endpointConfig block supports:

  • enableHttpPortAccess - (Optional) Optional. If true, enable http access to specific ports on the cluster from external sources. Defaults to false.

  • httpPorts - Output only. The map of port descriptions to URLs. Will only be populated if enable_http_port_access is true.

The gceClusterConfig block supports:

  • internalIpOnly - (Optional) Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internalIpOnly restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses.

  • metadata - (Optional) The Compute Engine metadata entries to add to all instances (see (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).

  • network - (Optional) Optional. The Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither networkUri nor subnetworkUri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see /regions/global/default*default`

  • nodeGroupAffinity - (Optional) Optional. Node Group Affinity for sole-tenant clusters.

  • privateIpv6GoogleAccess - (Optional) Optional. The type of IPv6 access for a cluster. Possible values: PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED, INHERIT_FROM_SUBNETWORK, OUTBOUND, BIDIRECTIONAL

  • reservationAffinity - (Optional) Optional. Reservation Affinity for consuming Zonal reservation.

  • serviceAccount - (Optional) Optional. The (https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) is used.

  • serviceAccountScopes - (Optional) Optional. The URIs of service account scopes to be included in Compute Engine instances. The following base set of scopes is always included: * https://www.googleapis.com/auth/cloud.useraccounts.readonly * https://www.googleapis.com/auth/devstorage.read_write * https://www.googleapis.com/auth/logging.write If no scopes are specified, the following defaults are also provided: * https://www.googleapis.com/auth/bigquery * https://www.googleapis.com/auth/bigtable.admin.table * https://www.googleapis.com/auth/bigtable.data * https://www.googleapis.com/auth/devstorage.full_control

  • shieldedInstanceConfig - (Optional) Optional. Shielded Instance Config for clusters using Compute Engine Shielded VMs. Structure defined below.

  • subnetwork - (Optional) Optional. The Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri. A full URL, partial URI, or short name are valid. Examples: * https://wwwGoogleapisCom/compute/v1/projects//regions/usEast1/subnetworks/sub0 * sub0

  • tags - (Optional) The Compute Engine tags to add to all instances (see (https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).

  • zone - (Optional) Optional. The zone where the Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a non-global Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present. A full URL, partial URI, or short name are valid. Examples: * https://wwwGoogleapisCom/compute/v1/projects/ * usCentral1F

The nodeGroupAffinity block supports:

  • nodeGroup - (Required) Required. The URI of a sole-tenant /zones/us-central1-a/nodeGroups/node-group-1*node-group-1`

The reservationAffinity block supports:

  • consumeReservationType - (Optional) Optional. Type of reservation to consume Possible values: TYPE_UNSPECIFIED, NO_RESERVATION, ANY_RESERVATION, SPECIFIC_RESERVATION

  • key - (Optional) Optional. Corresponds to the label key of reservation resource.

  • values - (Optional) Optional. Corresponds to the label values of reservation resource.

The shieldedInstanceConfig block supports:

cluster_config {
  gce_cluster_config {
    shielded_instance_config {
      enable_secure_boot          = true
      enable_vtpm                 = true
      enable_integrity_monitoring = true
    }
  }
}
  • enableSecureBoot - (Optional) Optional. Defines whether instances have Secure Boot enabled.

  • enableVtpm - (Optional) Optional. Defines whether instances have the vTPM enabled.

  • enableIntegrityMonitoring - (Optional) Optional. Defines whether instances have Integrity Monitoring enabled.

The gkeClusterConfig block supports:

  • namespacedGkeDeploymentTarget - (Optional) Optional. A target for the deployment.

The namespacedGkeDeploymentTarget block supports:

  • clusterNamespace - (Optional) Optional. A namespace within the GKE cluster to deploy into.

  • targetGkeCluster - (Optional) Optional. The target GKE cluster to deploy to. Format: 'projects/{project}/locations/{location}/clusters/{cluster_id}'

The initializationActions block supports:

  • executableFile - (Optional) Required. Cloud Storage URI of executable file.

  • executionTimeout - (Optional) Optional. Amount of time executable has to complete. Default is 10 minutes (see JSON representation of (https://developers.google.com/protocol-buffers/docs/proto3#json)). Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period.

The lifecycleConfig block supports:

  • autoDeleteTime - (Optional) Optional. The time when cluster will be auto-deleted (see JSON representation of (https://developers.google.com/protocol-buffers/docs/proto3#json)).

  • autoDeleteTtl - (Optional) Optional. The lifetime duration of cluster. The cluster will be auto-deleted at the end of this period. Minimum value is 10 minutes; maximum value is 14 days (see JSON representation of (https://developers.google.com/protocol-buffers/docs/proto3#json)).

  • idleDeleteTtl - (Optional) Optional. The duration to keep the cluster alive while idling (when no jobs are running). Passing this threshold will cause the cluster to be deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON representation of (https://developers.google.com/protocol-buffers/docs/proto3#json).

  • idleStartTime - Output only. The time when cluster became idle (most recent job finished) and became eligible for deletion due to idleness (see JSON representation of (https://developers.google.com/protocol-buffers/docs/proto3#json)).

The metastoreConfig block supports:

  • dataprocMetastoreService - (Required) Required. Resource name of an existing Dataproc Metastore service. Example: * projects/

The securityConfig block supports:

  • kerberosConfig - (Optional) Kerberos related configuration.

The kerberosConfig block supports:

  • crossRealmTrustAdminServer - (Optional) Optional. The admin server (IP or hostname) for the remote trusted realm in a cross realm trust relationship.

  • crossRealmTrustKdc - (Optional) Optional. The KDC (IP or hostname) for the remote trusted realm in a cross realm trust relationship.

  • crossRealmTrustRealm - (Optional) Optional. The remote realm the Dataproc on-cluster KDC will trust, should the user enable cross realm trust.

  • crossRealmTrustSharedPassword - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the shared password between the on-cluster Kerberos realm and the remote trusted realm, in a cross realm trust relationship.

  • enableKerberos - (Optional) Optional. Flag to indicate whether to Kerberize the cluster (default: false). Set this field to true to enable Kerberos on a cluster.

  • kdcDbKey - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the master key of the KDC database.

  • keyPassword - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the password to the user provided key. For the self-signed certificate, this password is generated by Dataproc.

  • keystore - (Optional) Optional. The Cloud Storage URI of the keystore file used for SSL encryption. If not provided, Dataproc will provide a self-signed certificate.

  • keystorePassword - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the password to the user provided keystore. For the self-signed certificate, this password is generated by Dataproc.

  • kmsKey - (Optional) Optional. The uri of the KMS key used to encrypt various sensitive files.

  • realm - (Optional) Optional. The name of the on-cluster Kerberos realm. If not specified, the uppercased domain of hostnames will be the realm.

  • rootPrincipalPassword - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the root principal password.

  • tgtLifetimeHours - (Optional) Optional. The lifetime of the ticket granting ticket, in hours. If not specified, or user specifies 0, then default value 10 will be used.

  • truststore - (Optional) Optional. The Cloud Storage URI of the truststore file used for SSL encryption. If not provided, Dataproc will provide a self-signed certificate.

  • truststorePassword - (Optional) Optional. The Cloud Storage URI of a KMS encrypted file containing the password to the user provided truststore. For the self-signed certificate, this password is generated by Dataproc.

The softwareConfig block supports:

  • imageVersion - (Optional) Optional. The version of software inside the cluster. It must be one of the supported (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). If unspecified, it defaults to the latest Debian version.

  • properties - (Optional) Optional. The properties to set on daemon config files. Property keys are specified in prefix:property format, for example core:hadoopTmpDir. The following are supported prefixes and their mappings: * capacity-scheduler: capacitySchedulerXml * core: coreSiteXml * distcp: distcpDefaultXml * hdfs: hdfsSiteXml * hive: hiveSiteXml * mapred: mapredSiteXml * pig: pigProperties * spark: sparkDefaultsConf * yarn: yarnSiteXml For more information, see (https://cloud.google.com/dataproc/docs/concepts/cluster-properties).

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}

  • createTime - Output only. The time template was created.

  • updateTime - Output only. The time template was last updated.

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

WorkflowTemplate can be imported using any of these accepted formats:

$ terraform import google_dataproc_workflow_template.default projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}
$ terraform import google_dataproc_workflow_template.default {{project}}/{{location}}/{{name}}
$ terraform import google_dataproc_workflow_template.default {{location}}/{{name}}