Add disk size to google_compute_instance disk blocks.
This commit is contained in:
parent
d3135c1b2b
commit
9d75fa72ab
|
@ -74,6 +74,12 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"size": &schema.Schema{
|
||||||
|
Type: schema.TypeInt,
|
||||||
|
Optional: true,
|
||||||
|
ForceNew: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -331,6 +337,11 @@ func resourceComputeInstanceCreate(d *schema.ResourceData, meta interface{}) err
|
||||||
disk.InitializeParams.DiskType = diskType.SelfLink
|
disk.InitializeParams.DiskType = diskType.SelfLink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v, ok := d.GetOk(prefix + ".size"); ok {
|
||||||
|
diskSizeGb := v.(int)
|
||||||
|
disk.InitializeParams.DiskSizeGb = int64(diskSizeGb)
|
||||||
|
}
|
||||||
|
|
||||||
disks = append(disks, &disk)
|
disks = append(disks, &disk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,9 @@ The `disk` block supports:
|
||||||
|
|
||||||
* `type` - (Optional) The GCE disk type.
|
* `type` - (Optional) The GCE disk type.
|
||||||
|
|
||||||
|
* `size` - (Optional) The size of the image in gigabytes. If not specified,
|
||||||
|
it will inherit the size of its base image.
|
||||||
|
|
||||||
The `network_interface` block supports:
|
The `network_interface` block supports:
|
||||||
|
|
||||||
* `network` - (Required) The name of the network to attach this interface to.
|
* `network` - (Required) The name of the network to attach this interface to.
|
||||||
|
|
Loading…
Reference in New Issue