hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.06k stars 3.32k forks source link

post-processor/amazon-import: add support for LicenseType #4631

Closed dayglojesus closed 7 years ago

dayglojesus commented 7 years ago

The amazon-import post-processor provides no configuration option for LicenseType per the CLI help:

       --license-type (string)
          The license type to be used for the Amazon Machine Image (AMI) after
          importing.
              Note:  You  may only use BYOL if you have existing licenses with
              rights to use these licenses in a third party  cloud  like  AWS.
              For  more information, see Prerequisites in the VM Import/Export
              User Guide.

          Valid values: AWS | BYOL

As a result, the license type selected during the import appears to be BYOL for all Linux platform imports and AWS for any Windows images.

Not sure why these are the defaults, but there is no way to control the behaviour when the import is driven by Packer. Bummer.

mwhooker commented 7 years ago

Should be an easy fix if you want to take a stab. Just need to add it to the call here https://github.com/mitchellh/packer/blob/c22b97dd439502102e3ffd34775cc38f96a806b5/post-processor/amazon-import/post-processor.go#L220

dayglojesus commented 7 years ago

@mwhooker I will do that. Cheers.

dayglojesus commented 7 years ago

@mwhooker PR submitted. Code tested, working.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.