Commit d740bad6 authored by Clint's avatar Clint

Merge pull request #2330 from mitchellh/b-amazon-instance-virt

builder/amazon-instance: Don't specify empty Virtualization Type
parents fe0fde19 4d003aa5
...@@ -3,6 +3,7 @@ package instance ...@@ -3,6 +3,7 @@ package instance
import ( import (
"fmt" "fmt"
"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/multistep" "github.com/mitchellh/multistep"
awscommon "github.com/mitchellh/packer/builder/amazon/common" awscommon "github.com/mitchellh/packer/builder/amazon/common"
...@@ -20,15 +21,17 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { ...@@ -20,15 +21,17 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction {
ui.Say("Registering the AMI...") ui.Say("Registering the AMI...")
registerOpts := &ec2.RegisterImageInput{ registerOpts := &ec2.RegisterImageInput{
ImageLocation: &manifestPath, ImageLocation: &manifestPath,
Name: &config.AMIName, Name: aws.String(config.AMIName),
BlockDeviceMappings: config.BlockDevices.BuildAMIDevices(), BlockDeviceMappings: config.BlockDevices.BuildAMIDevices(),
VirtualizationType: &config.AMIVirtType, }
if config.AMIVirtType != "" {
registerOpts.VirtualizationType = aws.String(config.AMIVirtType)
} }
// Set SriovNetSupport to "simple". See http://goo.gl/icuXh5 // Set SriovNetSupport to "simple". See http://goo.gl/icuXh5
if config.AMIEnhancedNetworking { if config.AMIEnhancedNetworking {
simple := "simple" registerOpts.SRIOVNetSupport = aws.String("simple")
registerOpts.SRIOVNetSupport = &simple
} }
registerResp, err := ec2conn.RegisterImage(registerOpts) registerResp, err := ec2conn.RegisterImage(registerOpts)
......
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