Add 'image_uri' to dataproc cluster definition. (#2548)

This commit is contained in:
The Magician 2018-12-04 22:46:23 -08:00 committed by Nathan McKinley
parent 45cbdb0a49
commit fb1fd69cc6
2 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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`.