

# Paid AMIs in the Amazon Web Services Marketplace for Amazon EC2 instances
Paid AMIs in the Amazon Web Services Marketplace

A *paid AMI* is an AMI that is listed for sale in the Amazon Web Services Marketplace. The Amazon Web Services Marketplace is an online store where you can buy software that runs on Amazon, including AMIs that you can use to launch your EC2 instance. The Amazon Web Services Marketplace AMIs are organized into categories, such as Developer Tools, to enable you to find products to suit your requirements. For more information about Amazon Web Services Marketplace, see the [Amazon Web Services Marketplace](http://www.amazonaws.cn/marketplace) website.

You can purchase AMIs in the Amazon Web Services Marketplace from a third party, including AMIs that come with service contracts from organizations such as Red Hat. You can also create an AMI and sell it in the Amazon Web Services Marketplace to other Amazon EC2 users. Building a safe, secure, usable AMI for public consumption is a fairly straightforward process, if you follow a few simple guidelines. For information about how to create and use shared AMIs, see [Understand shared AMI usage in Amazon EC2](sharing-amis.md).

Launching an instance from a paid AMI is the same as launching an instance from any other AMI. No additional parameters are required. The instance is charged according to the rates set by the owner of the AMI, as well as the standard usage fees for the related web services, for example, the hourly rate for running an m5.small instance type in Amazon EC2. Additional taxes might also apply. The owner of the paid AMI can confirm whether a specific instance was launched using that paid AMI. 

**Important**  
Amazon DevPay is no longer accepting new sellers or products. Amazon Web Services Marketplace is now the single, unified e-commerce platform for selling software and services through Amazon. For information about how to deploy and sell software from Amazon Web Services Marketplace, see [Selling in Amazon Marketplace](https://www.amazonaws.cn/marketplace/partners/management-tour). Amazon Web Services Marketplace supports AMIs backed by Amazon EBS.

**Topics**
+ [

## Sell your AMI in the Amazon Web Services Marketplace
](#selling-your-ami)
+ [

# Find a paid AMI
](using-paid-amis-finding-paid-ami.md)
+ [

# Purchase a paid AMI in the Amazon Web Services Marketplace
](using-paid-amis-purchasing-paid-ami.md)
+ [

# Retrieve the Amazon Web Services Marketplace product code from your instance
](get-product-code.md)
+ [

# Use paid support for supported Amazon Web Services Marketplace offerings
](using-paid-amis-support.md)
+ [

## Bills for paid and supported AMIs
](#using-paid-amis-bills)
+ [

# Manage your Amazon Web Services Marketplace subscriptions
](marketplace-manage-subscriptions.md)

## Sell your AMI in the Amazon Web Services Marketplace


You can sell your AMI using Amazon Web Services Marketplace. Amazon Web Services Marketplace offers an organized shopping experience. Additionally, Amazon Web Services Marketplace also supports Amazon features such as Amazon EBS-backed AMIs, Reserved Instances, and Spot Instances.

For information about how to sell your AMI on the Amazon Web Services Marketplace, see [Selling in Amazon Marketplace](https://www.amazonaws.cn/marketplace/partners/management-tour). 

# Find a paid AMI


A paid AMI is an Amazon Machine Image (AMI) that is available for purchase. A paid AMI also has a product code. You can find AMIs that are available for purchase in the Amazon Web Services Marketplace.

------
#### [ Console ]

**To find a paid AMI**

1. Open the Amazon EC2 console at [https://console.amazonaws.cn/ec2/](https://console.amazonaws.cn/ec2/).

1. In the navigation pane, choose **AMIs**. 

1. Choose **Public images** for the first filter.

1. Do one of the following:
   + If you know the product code, choose **Product code**, then **=**, and then enter the product code.
   + If you do not know the product code, in the Search bar, specify the following filter: **Owner alias=aws-marketplace**. Specify additional filters as needed.

1. Save the ID of the AMI.

------
#### [ Amazon CLI ]

**To find a paid AMI**  
Use the following [describe-images](https://docs.amazonaws.cn/cli/latest/reference/ec2/describe-images.html) command.

```
aws ec2 describe-images --owners aws-marketplace
```

The output includes a large number of images. You can specify filters to help you determine which AMI you need. After you find an AMI, specify its ID in the following command to get its product code.

```
aws ec2 describe-images \
    --image-ids ami-0abcdef1234567890 \
    --query Images[*].ProductCodes[].ProductCodeId
```

The following is example output.

```
[
    "cdef1234abc567def8EXAMPLE"
]
```

If you know the product code, you can filter the results by product code. This example returns the most recent AMI with the specified product code.

```
aws ec2 describe-images \
    --filters "Name=product-code,Values=cdef1234abc567def8EXAMPLE" \
    --query "sort_by(Images, &CreationDate)[-1].[ImageId]"
```

------
#### [ PowerShell ]

**To find a paid AMI**  
Use the [Get-EC2Image](https://docs.amazonaws.cn/powershell/latest/reference/items/Get-EC2Image.html) cmdlet.

```
Get-EC2Image -Owner aws-marketplace
```

The output includes a large number of images. You can specify filters to help you determine which AMI you need. After you find an AMI, specify its ID in the following command to get its product code.

```
(Get-EC2Image -ImageId ami-0abcdef1234567890).ProductCodes
```

The following is example output.

```
ProductCodeId             ProductCodeType
-------------             ---------------
cdef1234abc567def8EXAMPLE marketplace
```

If you know the product code, you can filter the results by product code. This example returns the most recent AMI with the specified product code.

```
(Get-EC2Image -Owner aws-marketplace -Filter @{"Name"="product-code";"Value"="cdef1234abc567def8EXAMPLE"} | sort CreationDate -Descending | Select-Object -First 1).ImageId
```

------

# Purchase a paid AMI in the Amazon Web Services Marketplace
Purchase a paid AMI

You must sign up for (purchase) a paid AMI before you can launch an Amazon EC2 instance using the AMI.

Typically a seller of a paid AMI presents you with information about the AMI, including its price and a link where you can buy it. When you click the link, you're first asked to log into Amazon, and then you can purchase the AMI.

## Purchase a paid AMI using the console


You can purchase a paid AMI by using the Amazon EC2 launch wizard. For more information, see [Launch an Amazon EC2 instance from an Amazon Web Services Marketplace AMI](launch-marketplace-console.md).

## Subscribe to a product using Amazon Web Services Marketplace


To use the Amazon Web Services Marketplace, you must have an Amazon Web Services account. To launch instances from Amazon Web Services Marketplace products, you must be signed up to use the Amazon EC2 service, and you must be subscribed to the product from which to launch the instance. You can use one of the following methods to subscribe to products in the Amazon Web Services Marketplace:
+ **Amazon Web Services Marketplace website**: You can launch preconfigured software quickly with the 1-Click deployment feature. For more information, see [AMI-based products in Amazon Web Services Marketplace](https://docs.amazonaws.cn/marketplace/latest/buyerguide/buyer-server-products.html).
+ **Amazon EC2 launch wizard**: You can search for an AMI and launch an instance directly from the wizard. For more information, see [Launch an Amazon EC2 instance from an Amazon Web Services Marketplace AMI](launch-marketplace-console.md).

# Retrieve the Amazon Web Services Marketplace product code from your instance
Retrieve the product code

You can retrieve the Amazon Web Services Marketplace product code for your instance using its instance metadata. If the instance has a product code, Amazon EC2 returns it. For more information about retrieving metadata, see [Access instance metadata for an EC2 instance](instancedata-data-retrieval.md).

------
#### [ IMDSv2 ]

**Linux**  
Run the following command from your Linux instance.

```
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
    && curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/product-codes
```

**Windows**  
Run the following cmdlets from your Windows instance.

```
[string]$token = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "21600"} `
    -Method PUT -Uri http://169.254.169.254/latest/api/token
```

```
Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token" = $token} `
    -Method GET -Uri http://169.254.169.254/latest/meta-data/product-codes
```

------
#### [ IMDSv1 ]

**Linux**  
Run the following command from your Linux instance.

```
curl http://169.254.169.254/latest/meta-data/product-codes
```

**Windows**  
Run the following command from your Windows instance.

```
Invoke-RestMethod -Uri http://169.254.169.254/latest/meta-data/product-codes
```

------

# Use paid support for supported Amazon Web Services Marketplace offerings
Use paid support

Amazon EC2 also enables developers to offer support for software (or derived AMIs). Developers can create support products that you can sign up to use. During sign-up for the support product, the developer gives you a product code, which you must then associate with your own AMI. This enables the developer to confirm that your instance is eligible for support. It also ensures that when you run instances of the product, you are charged according to the terms for the product specified by the developer. 

**Limitations**
+ After you set the product code attribute, it can't be changed or removed.
+ You can't use a support product with Reserved Instances. You always pay the price that's specified by the seller of the support product.

------
#### [ Amazon CLI ]

**To associate a product code with your AMI**  
Use the [modify-image-attribute](https://docs.amazonaws.cn/cli/latest/reference/ec2/modify-image-attribute.html) command.

```
aws ec2 modify-image-attribute \
    --image-id ami-0abcdef1234567890 \
    --product-codes "cdef1234abc567def8EXAMPLE"
```

------
#### [ PowerShell ]

**To associate a product code with your AMI**  
Use the [Edit-EC2ImageAttribute](https://docs.amazonaws.cn/powershell/latest/reference/items/Edit-EC2ImageAttribute.html) cmdlet.

```
Edit-EC2ImageAttribute `
    -ImageId ami-0abcdef1234567890 `
    -ProductCode "cdef1234abc567def8EXAMPLE"
```

------

## Bills for paid and supported AMIs


At the end of each month, you receive an email with the amount your credit card has been charged for using any paid or supported AMIs during the month. This bill is separate from your regular Amazon EC2 bill. For more information, see [Paying for products](https://docs.amazonaws.cn/marketplace/latest/buyerguide/buyer-paying-for-products.html) in the *Amazon Web Services Marketplace Buyer Guide*.

# Manage your Amazon Web Services Marketplace subscriptions
Manage your subscriptions

On the Amazon Web Services Marketplace website, you can check your subscription details, view the vendor's usage instructions, manage your subscriptions, and more.

## Check subscription details


**To check your subscription details**

1.  Log in to the [Amazon Web Services Marketplace](http://www.amazonaws.cn/marketplace).

1. Choose **Your Marketplace Account**.

1. Choose **Manage your software subscriptions**. 

1. All your current subscriptions are listed. Choose ** Usage Instructions** to view specific instructions for using the product, for example, a username for connecting to your running instance.

## Cancel subscription


**Note**  
Canceling a subscription does not terminate the instances launched with that AMI. We'll continue to bill you for your running instances until they're terminated. You must terminate all instances launched with the AMI in order to stop billing for the subscription.
After you've canceled your subscription, you are no longer able to launch any instances from that AMI. To use that AMI again, you need to resubscribe to it, either on the Amazon Web Services Marketplace website, or through the launch wizard in the Amazon EC2 console.

**To cancel an Amazon Web Services Marketplace subscription**

1. To stop billing for the subscription, ensure that you have terminated any instances running from the subscription.
**Warning**  
**Terminating an instance is permanent and irreversible.**  
After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see [How instance termination works](how-ec2-instance-termination-works.md).  
Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage.

   1. Open the Amazon EC2 console at [https://console.amazonaws.cn/ec2/](https://console.amazonaws.cn/ec2/).

   1. In the navigation pane, choose **Instances**.

   1. Select the instance, and then choose **Instance state**, **Terminate (delete) instance**.

   1. Choose **Terminate (delete)** when prompted for confirmation.

1. Log in to the [Amazon Web Services Marketplace](http://www.amazonaws.cn/marketplace), and choose **Your Marketplace Account**, then **Manage your software subscriptions**.

1. Choose **Cancel subscription**. You are prompted to confirm your cancellation. 