Commit 224bb781 authored by Anthony Spring's avatar Anthony Spring Committed by Chris Bednarski

Make EBS block device mapping optional for ephemeral virtual names.

parent f2750562
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2"
"github.com/mitchellh/packer/template/interpolate" "github.com/mitchellh/packer/template/interpolate"
"strings"
) )
// BlockDevice // BlockDevice
...@@ -47,9 +48,12 @@ func buildBlockDevices(b []BlockDevice) []*ec2.BlockDeviceMapping { ...@@ -47,9 +48,12 @@ func buildBlockDevices(b []BlockDevice) []*ec2.BlockDeviceMapping {
} }
mapping := &ec2.BlockDeviceMapping{ mapping := &ec2.BlockDeviceMapping{
EBS: ebsBlockDevice, DeviceName: aws.String(blockDevice.DeviceName),
DeviceName: aws.String(blockDevice.DeviceName), VirtualName: aws.String(blockDevice.VirtualName),
VirtualName: aws.String(blockDevice.VirtualName), }
if !strings.HasPrefix(blockDevice.VirtualName, "ephemeral") {
mapping.EBS = ebsBlockDevice
} }
if blockDevice.NoDevice { if blockDevice.NoDevice {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment