|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
This section describes several tasks you might perform when managing your paid AMIs.
This section presents the instructions using the Amazon EC2 command line tools. Amazon EC2 also has programmatic APIs (Query and SOAP) and a GUI-based console (at https://console.aws.amazon.com/). For more information about using the console, go to the Amazon Elastic Compute Cloud Console and Command Line User Guide. For more information about using the APIs, go to the Amazon Elastic Compute Cloud Developer Guide and the Amazon Elastic Compute Cloud API Reference.
Each AMI can have a single product code associated with it. You must be the owner of an AMI to associate a product code with it. You can associate a single product code with more than one AMI. For more information, see If You Have Multiple AMIs to Sell.
You can associate a product code only with Amazon S3-backed AMIs (those using an instance store root device), and not Amazon EBS-backed AMIs (those using an Amazon EBS root device).
To associate a product code with an AMI
ec2-modify-image-attribute ami-5bae4b32 --product-code 774F4FF8productCodes ami-5bae4b32 productCode 774F4FF8
To verify the product code is associated with the AMI
ec2-describe-image-attribute ami-5bae4b32 --product-codeproductCodes ami-5bae4b32 productCode 774F4FF8
You can't change or remove the
productCodes attribute after you've set it. If you
want to use the same image without the product code or associate a different product code with the
image, you must reregister the image to obtain a new AMI ID. You can then use that AMI without a
product code or associate the new product code with the AMI ID. For more information, see The Product Code and AMI Rebundling.
If you're creating a paid AMI, after you associate the product code with the AMI, you need to share the AMI with select customers or the public.
To share an AMI
The following example shares the AMI with the public.
ec2-modify-image-attribute ami-5bae4b32 --launch-permission -a alllaunchPermission ami-5bae4b32 ADD group all
Even though you've shared the AMI, no one can use it until they sign up for your product by going to the purchase URL. Once customers sign up, any instances of the paid AMI they launch will be billed at the rate you specified during product registration.
If you have created a product for others to use with their AMIs (the supported AMI scenario), you might want to confirm that a particular AMI is associated with your product code and a particular instance is currently running that AMI.
You must be the owner of the product code to successfully call
ec2-confirm-product-instance with that product code.
Because your customers don't own the product code, they should describe their instances to confirm their instances are running with your product code.
To confirm an instance is running an AMI associated with your product code
ec2-confirm-product-instance 774F4FF8 -i i-10a64379774F4FF8 i-10a64379 true 111122223333
If the AMI is associated with the product code,
true is returned along with the AMI
owner's account ID. Otherwise,
false is returned.
A running Amazon EC2 instance can determine if a DevPay product code is attached to itself. The instance retrieves the product code like it retrieves its other metadata. For information about the retrieval of metadata, go to the "Instance Metadata" section of the Amazon Elastic Compute Cloud Developer Guide.
The instance retrieves the product code by querying a web server with this REST-like API call:
Following is an example response.