Re: [packer] using ami_product_codes usage

2019-11-12 Thread John Roh
Hello, Rickard, 
 
I made the work around working that I can copy AMI including the produce 
codes based amazon-centos7 to a different account. 
I have shared the AMI from the source account to target account first. 
Then, from the target account, I used boto3 to create_instance to start an 
ec2 instance with encryption using the same non-default kms key (default 
kms key only allowing me to copy among regions in the same account). Then 
create_image based on the ec2 instance slightly applying the same logic 
packer does which is createing AMI and terminate the ec2 instance. 
In this way, I'm no longer need to deal with the product codes. 
AMI build automation needs to be implemented because we have over 38 aws 
accounts and it doesn't stop growing. Phew. 

Thank you,

John.



On Friday, November 1, 2019 at 1:11:11 PM UTC-7, Rickard von Essen wrote:
>
> If I remember correctly this is how it works:
>
> You can't change product code. It is given when you upload a new AMI to 
> the AWS Marketplace. That requires a Market place partnership with AWS. The 
> product code follows the AMI (even if it's copied or create from a snapshot 
> base on an instance launched from it). This ensure that all users of the 
> software sold on the Marketplace pays for the usage.
>
> On Thu, Oct 31, 2019, 22:17 John Roh > 
> wrote:
>
>> Hi, 
>>
>> I have backed Centos AMI based on the AWS Marketplace which contains the 
>> product codes. 
>> I want to overwrite the product code that I used ami_product_codes :[ 'my 
>> custom string' ] during the packer . build. 
>> Is there any a better way to overwrite the existing product code? As 
>> passing a string value in am_product_codes, I ran into the error message 
>> saying "Error modify AMI attributes: InvalidParameterValue: Invalid 
>> value 'my custom string' for productCode".
>> Is that meaning I can't update the existing ProductCode? 
>>
>> John.
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to packe...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/dc8c0dd4-83db-4861-8baf-dbce733cd50f%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/6087c96f-cbdd-43b3-8202-70f16b8a48c7%40googlegroups.com.


Re: [packer] using ami_product_codes usage

2019-11-11 Thread John Roh
You are correct, Reckardo. 
I have found the supported documentation as below. I'm in the middle of the 
project creating AmI and distribute AMIs to different accounts. 

Marketplace AMI cannot be moved between accounts due to license restrictions
Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html
You can't copy an AMI with an associated billingProduct code that was 
shared with you from another account. 
This includes Windows AMIs and AMIs from the AWS Marketplace. To copy a 
shared AMI with a billingProduct code, 
launch an EC2 instance in your account using the shared AMI and then create 
an AMI from the instance. 
For more information, see Creating an Amazon EBS-Backed Linux AMI.

My current work around is to build an AMI using marketplace Centos7 from 
packer but the product code remained. However, I shared AMI to the target 
account and start an ec2 instance, then I create AMI from it, then the 
product code is not there. I'm thinking about automating the work around in 
boto3 but is there anything I can the same result using packer? Will 
amazon-ebsvolume instead of aws-ebs work? 

John.




On Friday, November 1, 2019 at 1:11:11 PM UTC-7, Rickard von Essen wrote:
>
> If I remember correctly this is how it works:
>
> You can't change product code. It is given when you upload a new AMI to 
> the AWS Marketplace. That requires a Market place partnership with AWS. The 
> product code follows the AMI (even if it's copied or create from a snapshot 
> base on an instance launched from it). This ensure that all users of the 
> software sold on the Marketplace pays for the usage.
>
> On Thu, Oct 31, 2019, 22:17 John Roh > 
> wrote:
>
>> Hi, 
>>
>> I have backed Centos AMI based on the AWS Marketplace which contains the 
>> product codes. 
>> I want to overwrite the product code that I used ami_product_codes :[ 'my 
>> custom string' ] during the packer . build. 
>> Is there any a better way to overwrite the existing product code? As 
>> passing a string value in am_product_codes, I ran into the error message 
>> saying "Error modify AMI attributes: InvalidParameterValue: Invalid 
>> value 'my custom string' for productCode".
>> Is that meaning I can't update the existing ProductCode? 
>>
>> John.
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to packe...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/dc8c0dd4-83db-4861-8baf-dbce733cd50f%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/d2795461-8779-4480-ac90-ff79a1f5c0ac%40googlegroups.com.


Re: [packer] using ami_product_codes usage

2019-11-01 Thread Rickard von Essen
If I remember correctly this is how it works:

You can't change product code. It is given when you upload a new AMI to the
AWS Marketplace. That requires a Market place partnership with AWS. The
product code follows the AMI (even if it's copied or create from a snapshot
base on an instance launched from it). This ensure that all users of the
software sold on the Marketplace pays for the usage.

On Thu, Oct 31, 2019, 22:17 John Roh  wrote:

> Hi,
>
> I have backed Centos AMI based on the AWS Marketplace which contains the
> product codes.
> I want to overwrite the product code that I used ami_product_codes :[ 'my
> custom string' ] during the packer . build.
> Is there any a better way to overwrite the existing product code? As
> passing a string value in am_product_codes, I ran into the error message
> saying "Error modify AMI attributes: InvalidParameterValue: Invalid value
> 'my custom string' for productCode".
> Is that meaning I can't update the existing ProductCode?
>
> John.
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/dc8c0dd4-83db-4861-8baf-dbce733cd50f%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-BAyXSMOToP7mYSRLHzMW%3Dr3_eXhdbHCyTUimrU%2BnYYA%40mail.gmail.com.