From 1e3065ae112fdaa3d1abe92185045d22f319d30d Mon Sep 17 00:00:00 2001 From: Daniel Malon Date: Sat, 22 Nov 2014 09:50:22 +0000 Subject: [PATCH] allow setting the block device virtual_name --- builtin/providers/aws/resource_aws_instance.go | 7 +++++++ website/source/docs/providers/aws/r/instance.html.markdown | 1 + 2 files changed, 8 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index 87f31d695..05ebbbb3c 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -138,6 +138,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, @@ -227,6 +233,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)) diff --git a/website/source/docs/providers/aws/r/instance.html.markdown b/website/source/docs/providers/aws/r/instance.html.markdown index 8ad171d8e..66d9c9cac 100644 --- a/website/source/docs/providers/aws/r/instance.html.markdown +++ b/website/source/docs/providers/aws/r/instance.html.markdown @@ -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.