Merge pull request #612 from MerlinDMC/feature/aws_block_device_virtual_name
allow setting the block device virtual_name
This commit is contained in:
commit
7182e5618e
|
@ -144,6 +144,12 @@ func resourceAwsInstance() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"virtual_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"snapshot_id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -233,6 +239,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
for i, v := range vs {
|
||||
bd := v.(map[string]interface{})
|
||||
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].VolumeType = bd["volume_type"].(string)
|
||||
runOpts.BlockDevices[i].VolumeSize = int64(bd["volume_size"].(int))
|
||||
|
|
|
@ -52,6 +52,7 @@ The following arguments are supported:
|
|||
Each `block_device` supports the following:
|
||||
|
||||
* `device_name` - The name of the device to mount.
|
||||
* `virtual_name` - (Optional) The virtual device name.
|
||||
* `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_size` - (Optional) The size of the volume in gigabytes.
|
||||
|
|
Loading…
Reference in New Issue