mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-09 07:05:33 -06:00
allow setting the block device virtual_name
This commit is contained in:
parent
81f008ba53
commit
1e3065ae11
@ -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))
|
||||
|
@ -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
Block a user