Skip to content

Commit 887c494

Browse files
modular-magicianpaddycarver
authored andcommitted
Add 'image_uri' to dataproc cluster definition. (#2548)
1 parent 3c4406d commit 887c494

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

google/resource_dataproc_cluster.go

+11
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ func instanceConfigSchema() *schema.Schema {
321321
Computed: true,
322322
},
323323

324+
"image_uri": {
325+
Type: schema.TypeString,
326+
Optional: true,
327+
Computed: true,
328+
ForceNew: true,
329+
},
330+
324331
"machine_type": {
325332
Type: schema.TypeString,
326333
Optional: true,
@@ -618,6 +625,9 @@ func expandInstanceGroupConfig(cfg map[string]interface{}) *dataproc.InstanceGro
618625
if v, ok := cfg["machine_type"]; ok {
619626
icg.MachineTypeUri = GetResourceNameFromSelfLink(v.(string))
620627
}
628+
if v, ok := cfg["image_uri"]; ok {
629+
icg.ImageUri = v.(string)
630+
}
621631

622632
if dc, ok := cfg["disk_config"]; ok {
623633
d := dc.([]interface{})
@@ -873,6 +883,7 @@ func flattenInstanceGroupConfig(d *schema.ResourceData, icg *dataproc.InstanceGr
873883
if icg != nil {
874884
data["num_instances"] = icg.NumInstances
875885
data["machine_type"] = GetResourceNameFromSelfLink(icg.MachineTypeUri)
886+
data["image_uri"] = icg.ImageUri
876887
data["instance_names"] = icg.InstanceNames
877888
if icg.DiskConfig != nil {
878889
disk["boot_disk_size_gb"] = icg.DiskConfig.BootDiskSizeGb

website/docs/r/dataproc_cluster.html.markdown

+6
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ The `cluster_config.master_config` block supports:
251251
to create for the master. If not specified, GCP will default to a predetermined
252252
computed value (currently `n1-standard-4`).
253253

254+
* `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)
255+
for more information.
256+
254257
* `disk_config` (Optional) Disk Config
255258

256259
* `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:
318321
* `num_local_ssds` - (Optional) The amount of local SSD disks that will be
319322
attached to each worker cluster node. Defaults to 0.
320323

324+
* `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)
325+
for more information.
326+
321327
* `accelerators` (Optional) The Compute Engine accelerator configuration for these instances. Can be specified multiple times.
322328

323329
* `accelerator_type` - (Required) The short name of the accelerator type to expose to this instance. For example, `nvidia-tesla-k80`.

0 commit comments

Comments
 (0)