Merge pull request #612 from MerlinDMC/feature/aws_block_device_virtual_name

allow setting the block device virtual_name
This commit is contained in:
Armon Dadgar 2014-12-03 12:08:07 -08:00
commit 7182e5618e
2 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,12 @@ func resourceAwsInstance() *schema.Resource {
ForceNew: true, ForceNew: true,
}, },
"virtual_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"snapshot_id": &schema.Schema{ "snapshot_id": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
@ -233,6 +239,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
for i, v := range vs { for i, v := range vs {
bd := v.(map[string]interface{}) bd := v.(map[string]interface{})
runOpts.BlockDevices[i].DeviceName = bd["device_name"].(string) runOpts.BlockDevices[i].DeviceName = bd["device_name"].(string)
runOpts.BlockDevices[i].VirtualName = bd["virtual_name"].(string)
runOpts.BlockDevices[i].SnapshotId = bd["snapshot_id"].(string) runOpts.BlockDevices[i].SnapshotId = bd["snapshot_id"].(string)
runOpts.BlockDevices[i].VolumeType = bd["volume_type"].(string) runOpts.BlockDevices[i].VolumeType = bd["volume_type"].(string)
runOpts.BlockDevices[i].VolumeSize = int64(bd["volume_size"].(int)) runOpts.BlockDevices[i].VolumeSize = int64(bd["volume_size"].(int))

View File

@ -52,6 +52,7 @@ The following arguments are supported:
Each `block_device` supports the following: Each `block_device` supports the following:
* `device_name` - The name of the device to mount. * `device_name` - The name of the device to mount.
* `virtual_name` - (Optional) The virtual device name.
* `snapshot_id` - (Optional) The Snapshot ID to mount. * `snapshot_id` - (Optional) The Snapshot ID to mount.
* `volume_type` - (Optional) The type of volume. Can be standard, gp2, or io1. Defaults to standard. * `volume_type` - (Optional) The type of volume. Can be standard, gp2, or io1. Defaults to standard.
* `volume_size` - (Optional) The size of the volume in gigabytes. * `volume_size` - (Optional) The size of the volume in gigabytes.