diff --git a/google/resource_dataproc_cluster.go b/google/resource_dataproc_cluster.go index 2738b31e..196c7320 100644 --- a/google/resource_dataproc_cluster.go +++ b/google/resource_dataproc_cluster.go @@ -321,6 +321,13 @@ func instanceConfigSchema() *schema.Schema { Computed: true, }, + "image_uri": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "machine_type": { Type: schema.TypeString, Optional: true, @@ -618,6 +625,9 @@ func expandInstanceGroupConfig(cfg map[string]interface{}) *dataproc.InstanceGro if v, ok := cfg["machine_type"]; ok { icg.MachineTypeUri = GetResourceNameFromSelfLink(v.(string)) } + if v, ok := cfg["image_uri"]; ok { + icg.ImageUri = v.(string) + } if dc, ok := cfg["disk_config"]; ok { d := dc.([]interface{}) @@ -873,6 +883,7 @@ func flattenInstanceGroupConfig(d *schema.ResourceData, icg *dataproc.InstanceGr if icg != nil { data["num_instances"] = icg.NumInstances data["machine_type"] = GetResourceNameFromSelfLink(icg.MachineTypeUri) + data["image_uri"] = icg.ImageUri data["instance_names"] = icg.InstanceNames if icg.DiskConfig != nil { disk["boot_disk_size_gb"] = icg.DiskConfig.BootDiskSizeGb diff --git a/website/docs/r/dataproc_cluster.html.markdown b/website/docs/r/dataproc_cluster.html.markdown index 674a65ca..ba1d6ae6 100644 --- a/website/docs/r/dataproc_cluster.html.markdown +++ b/website/docs/r/dataproc_cluster.html.markdown @@ -251,6 +251,9 @@ The `cluster_config.master_config` block supports: to create for the master. If not specified, GCP will default to a predetermined computed value (currently `n1-standard-4`). +* `image_uri` (Optional) The URI for the image to use for this worker. See [the guide](https://cloud.google.com/dataproc/docs/guides/dataproc-images) + for more information. + * `disk_config` (Optional) Disk Config * `boot_disk_type` - (Optional) The disk type of the primary disk attached to each node. @@ -318,6 +321,9 @@ The `cluster_config.worker_config` block supports: * `num_local_ssds` - (Optional) The amount of local SSD disks that will be attached to each worker cluster node. Defaults to 0. +* `image_uri` (Optional) The URI for the image to use for this worker. See [the guide](https://cloud.google.com/dataproc/docs/guides/dataproc-images) + for more information. + * `accelerators` (Optional) The Compute Engine accelerator configuration for these instances. Can be specified multiple times. * `accelerator_type` - (Required) The short name of the accelerator type to expose to this instance. For example, `nvidia-tesla-k80`.