diff options
Diffstat (limited to 'vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go')
-rw-r--r-- | vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go b/vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go index 01ba46bd..d363bdfd 100644 --- a/vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go +++ b/vendor/github.com/mitchellh/packer/builder/amazon/instance/step_register_ami.go @@ -10,7 +10,10 @@ import ( "github.com/mitchellh/multistep" ) -type StepRegisterAMI struct{} +type StepRegisterAMI struct { + EnableAMIENASupport bool + EnableAMISriovNetSupport bool +} func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) @@ -29,12 +32,13 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { registerOpts.VirtualizationType = aws.String(config.AMIVirtType) } - if config.AMIEnhancedNetworking { + if s.EnableAMISriovNetSupport { // Set SriovNetSupport to "simple". See http://goo.gl/icuXh5 // As of February 2017, this applies to C3, C4, D2, I2, R3, and M4 (excluding m4.16xlarge) registerOpts.SriovNetSupport = aws.String("simple") - - // Set EnaSupport to true. + } + if s.EnableAMIENASupport { + // Set EnaSupport to true // As of February 2017, this applies to C5, I3, P2, R4, X1, and m4.16xlarge registerOpts.EnaSupport = aws.Bool(true) } |