Skip to content

Commit

Permalink
Merge pull request #1284 from ndarilek/add-size-to-instance-disk
Browse files Browse the repository at this point in the history
Add size option to disk blocks under google_compute_instance
  • Loading branch information
mitchellh committed Mar 26, 2015
2 parents 19c7f8c + 9d75fa7 commit deb5052
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions builtin/providers/google/resource_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func resourceComputeInstance() *schema.Resource {
Optional: true,
ForceNew: true,
},

"size": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
},
},
},
},
Expand Down Expand Up @@ -331,6 +337,11 @@ func resourceComputeInstanceCreate(d *schema.ResourceData, meta interface{}) err
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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ The `disk` block supports:

* `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:

* `network` - (Required) The name of the network to attach this interface to.
Expand Down

0 comments on commit deb5052

Please sign in to comment.