

# AMI-based products in AWS Marketplace
<a name="buyer-server-products"></a>

An Amazon Machine Image (AMI) is an image of a server, including an operating system and often additional software, which runs on AWS.

The software listed in AWS Marketplace is only available to run on Amazon Elastic Compute Cloud (Amazon EC2). It's not available for download. 

 On AWS Marketplace, you can search for AMIs (with search suggestions), view product reviews submitted by other customers, subscribe and launch AMIs, and manage your subscriptions. All AWS Marketplace products have been verified for quality and pre-configured for 1-Click launch capability on Amazon Web Services (AWS) infrastructure. 

 Both AMI and software as a service (SaaS) product listings are from trusted sellers. AMI products run within a customer's AWS account. You retain more control over software configuration and over the servers that run the software, but you also have additional responsibilities regarding server configuration and maintenance. 

The AWS Marketplace catalog contains a curated selection of open source and commercial software from well-known sellers. Many products on AWS Marketplace can be purchased by the hour. 

 The AMI catalog is a community resource where people and development teams can list and exchange software or projects under development, without having to go through extensive vetting. Listings in the community AMI catalog may or may not be from well-known sellers and generally have not undergone additional investigations. 

 An AWS Marketplace product contains one AMI for each AWS Region in which the product is available. These AMIs are identical except for their location. Additionally, when sellers update their product with the latest patches and updates, they may add another set of AMIs to the product. 

 Some AWS Marketplace products may launch multiple instances of an AMI because they're deployed as a cluster using AWS CloudFormation templates. This cluster of instances, along with additional AWS infrastructure services configured by the CloudFormation template, act as a single product deployment. 

## AWS CloudFormation template
<a name="what-is-aws-cloudformation"></a>

 AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. A CloudFormation template describes the various AWS resources that you want, such as Amazon Elastic Compute Cloud (Amazon EC2) instances or Amazon Relational Database Service (Amazon RDS) database instances. CloudFormation takes care of provisioning and configuring those resources for you. For more information, see [Getting started with CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.html). 

### Using AWS CloudFormation templates
<a name="using-CF-templates"></a>

Software sellers may offer CloudFormation templates to define a preferred deployment topology consisting of multiple AMI instances and other AWS resources. If a CloudFormation template is available for a product, it will be listed as a deployment option on the product listing page. 

You can use an AMI to deploy a single Amazon EC2 instance. You can use a CloudFormation template to deploy multiple instances of an AMI that act as a cluster—along with AWS resources such as Amazon RDS, Amazon Simple Storage Service service—as a single solution. 

### Metering-enabled AMI products
<a name="buyer-ami-metering-enabled-products"></a>

Some products listed on AWS Marketplace are billed on usage measured by the software application. Examples of metered usage dimensions include Data usage, Host/Agent usage, or Bandwidth usage. These products require extra configuration to function correctly. An IAMrole with the permission to meter usage must be associated with your AWS Marketplace Amazon Elastic Compute Cloud (Amazon EC2) instance at the time of launch. For more information about IAMroles for Amazon EC2, see [IAM Roles for Amazon EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html). 

### AMI product version policies
<a name="ami-product-version-policies"></a>

AWS Marketplace automates the version management experience for AWS customers and sellers using S-AMI, AMI with CloudFormation template, and container products. With automated version archival, any product version that has been restricted by a seller for longer than two years is automatically archived. Archived versions are no longer available to launch from AWS Marketplace for new customers, however existing users can continue to use the archived version through launch templates and Amazon EC2 Auto Scaling groups by specifying the AMI ID. Any archived version that has not been used to launch a new instances in the past 13 months is deleted. Once an archived version is deleted, it is no longer available to launch for new or existing users.

# AMI subscriptions in AWS Marketplace
<a name="buyer-ami-subscriptions"></a>

In AWS Marketplace, some Amazon Machine Image (AMI)-based software products offer an annual subscription pricing model. With this pricing model, you make a one-time upfront payment and pay no hourly usage fee for the next 12 months. You can apply one annual subscription to an AWS Marketplace software product to one Amazon Elastic Compute Cloud (Amazon EC2) instance. 

**Note**  
For AMI hourly with annual pricing, the annual subscription covers only the instance types that you specify when purchasing. For example, `t3.medium`. Launching any other instance type will incur the hourly rate for that instance type based on the active subscription.

You can also continue to launch and run AWS Marketplace software products by using hourly pricing. Charges for using Amazon EC2 and other services from AWS are separate and in addition to what you pay to purchase AWS Marketplace software products.

If you change the Amazon EC2 instance type for hourly usage, your Amazon EC2 infrastructure will be billed according to your signed savings plan. However, the AMI license from AWS Marketplace will automatically change to hourly pricing.

If an AMI hourly product doesn't support annual pricing, the buyer can't purchase an annual subscription. If an AMI hourly product does support annual pricing, the buyer can go to the product's page in AWS Marketplace and purchase annual contracts. Each annual contract allows the buyer to run one instance without being billed the hourly rate. Contracts vary according to instance type.

## Annual agreement amendments
<a name="annual-agreement-amendments"></a>

With hourly annual (annual) plan amendments, you can amend your plan directly from the AWS Marketplace Management Portal. You can use amendments when you need to switch the AMI to run on an Amazon Elastic Compute Cloud (Amazon EC2) instance type with more vCPUs, or move to a more modern generation of CPU architecture. With amendments, you can make the following changes to your existing annual plan:
+ Switch between Amazon EC2 instance type families
+ Switch between Amazon EC2 instance type sizes
+ Add a new instance type
+ Increase the quantity of an existing instance type in the agreement

Any new Amazon EC2 instance types you add or switch to in the agreement will be co-termed to the current end-date of the plan, so that all instance types in the agreement are renewed at the same time.

You can make a change as long as the prorated cost of the change is greater than zero. The prorated cost of the newly added Amazon EC2 instances is based on the annual cost of the instance type adjusted for the remaining term of the agreement. When switching instance types, the prorated cost of the removed Amazon EC2 instance type is deducted from the prorated cost of the newly added Amazon EC2 instance type.

**Note**  
Amendments are supported for all agreements made from public offers and agreements from private offers without installment plans.

### Annual agreement amendment examples
<a name="amendment-scenarios"></a>

Consider the follow examples related to annual agreement amendments. In the following examples, the customer signed a contract on January 1, 2024, for two units of m5.large instance types (\$14,000/year). The seller is paid \$18,000, minus the listing fees.

**Example 1: Switching to an instance type of equal value**  
Mid-year, the customer wants to switch one unit of the m5.large instance type to one unit of the r5.large instance type. The prorated cost of the switch is calculated by deducting the prorated cost of the instance removed (six months of m5.large - \$12,000) from the prorated cost of the instance added (six months of r5.large - \$12,000). The net cost is \$10, so the amendment can occur.



**Example 2: Switching to higher priced instance type**  
Mid-year, the customer wants to switch one unit of the m5.large instance type to one unit of the m5.2xlarge instance type. The prorated cost of the switch is calculated by deducting the prorated cost of the instance removed (six months of m5.large - \$12,000) from the prorated cost of instance added (six months of m5.2xlarge - \$13,000). The net cost is \$11,000, so the amendment can occur.



**Example 3: Switching to a single unit of a lower-priced instance type**  
Mid-year, the customer wants to switch one unit of the m5.large instance type to one unit of the c5.large instance type. The prorated cost of the switch is calculated by deducting the prorated cost of the instance removed (6 months of m5.large - \$12,000) from the prorated cost of instance added (6 months of c5.large - \$11,500). The net cost is -\$1500 (less than \$10), so the amendment can't occur.



**Example 4: Switching to multiple units of a lower-priced instance type**  
Mid-year, the customer wants to switch one unit of the m5.large instance type to two units of the c5.large instance type. The prorated cost of the switch is calculated by deducting the prorated cost of the instance removed (six months of m5.large - \$12,000) from the prorated cost of instances added (six months of two c5.large - \$13,000). The net cost is \$11,000, so the amendment can occur.



**Example 5: Adding a new instance type**  
Mid-year, the customer wants to add an additional unit of the m5.large instance type to the agreement. The prorated cost of this change is calculated as the prorated cost of the instance added (six months of m5.large - \$12,000). The net cost is \$12,000, so the amendment can occur.



**Example 6: Removing an instance type**  
Mid-year, the customer wants to remove one unit of the m5.large instance type. The prorated cost of this change is calculated as the prorated cost of instance removed (six months of m5.large - \$12,000). The net cost is -\$12,000 (less than \$10), so the amendment can't occur.

# AMI products with contract pricing in AWS Marketplace
<a name="buyer-ami-contracts"></a>

Some sellers offer public Amazon Machine Image (AMI)-based software products with a contract pricing model. In that model, you agree to make a one-time upfront payment for discrete quantities of licenses to access the software product for a duration of your choice. You're billed, in advance, through your AWS account. For example, you might purchase 10 user access licenses and 5 administrative licenses for a year. You can choose to automatically renew the licenses.

In addition, some companies offer private AMI-based software products with a contract pricing model. A private offer typically has a fixed duration which you can't change.

You can purchase an AMI -based software product contract using the product’s detail page on AWS Marketplace. If this option is available, **AMI with contract pricing** appears for **Delivery Method** on the product’s detail page. When you make the purchase, you will be directed to the product’s website for account setup and conﬁguration. The usage charges will then appear on your regular AWS account billing report.

# Subscribing to an AMI product with contract pricing
<a name="sub-public-AMI-contract"></a>

Sellers offer public or private contracts for Amazon Machine Image (AMI)-based software products. You agree to make a one-time upfront payment for discrete quantities of licenses to access the software product.

If the contract is a public offer, you can choose the duration of the contract and whether to automatically renew the licenses.

Private offers typically have a fixed duration that you can't change.

**To subscribe to a public offer AMI-based product with a contract pricing model**

1. Sign in to AWS Marketplace and find a container-based software product with a contract pricing model.

1. On the **Procurement** page, view the **Pricing Information**.

   You can see the **Units** and the rate for each duration (in months).

1. Choose **Continue to Subscribe** to start the subscription. 

   To save this product without subscribing, choose **Save to List**.

1. Create an agreement by reviewing the pricing information and configuring the terms for the software product. 

   1. Choose the duration of the contract: **1 month**, **12 months**, **24 months**, or **36 months** 

   1. Under **Renewal Settings**, choose whether to automatically renew the contract.

   1. Under **Contract options**, choose a quantity for each unit.

   The total contract price is displayed under **Pricing details.**

1. After you have made your selections, choose **Create Contract**.

The **Total contract price** is charged to your AWS account. A license is generated in AWS License Manager.

**Note**  
It can take up to 10 minutes for the subscription to process and a license to be generated in your AWS License Manager account for the software product.

**To subscribe to a private offer AMI-based product with a contract pricing model**

1. Sign in to AWS Marketplace with your Buyer account.

1. View the private offer. 

1. On the **Procurement** page, view the **Pricing Information**.

    You can see the **Units** and the rate for each duration (in months). 

1. Choose **Continue to Subscribe** to start the subscription. 

1. Create an agreement by reviewing the pricing information and configuring the terms for the software product. 

   The duration of the contract is already set by the Seller and can't be modified. 

1. Under **Contract options**, choose a quantity for each unit.

1. View the total contract price under **Pricing details**.

   You can also see the public offer by choosing **View Offer** under **Other Available Offers**.

1. After you have made your selections, choose **Create Contract**.

**Note**  
It can take up to 10 minutes for the subscription to process and a license to be generated in your AWS License Manager account for the software product.

# Accessing AMI-based software
<a name="access-ami-software"></a>

Once you purchase an Amazon Machine Image (AMI)-based software product with contract pricing, you will be directed to the product’s website for account setup and conﬁguration. The usage charges will then appear on your regular AWS account billing report.

**To access the AMI-based software product**

1. On the AWS Marketplace console, navigate to **View Subscription** and view the license for the software product. 

1. On the **Procurement** page:

   1. Choose **Manage License** to view, grant access, and track usage of your entitlements in AWS License Manager.

   1. Choose **Continue to Configuration**. 

1. On the **Launch** page, review your configuration and choose how you want to launch the software under **Choose Action**.

1. On the **Choose an Instance Type**, choose an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then choose **Next: Configure Instance Details**.

1. On the **Configure Instance Details** page, for **IAM role,** choose an existing AWS Identity and Access Management (IAM) role from your AWS account. 

   If you don't have an IAM role, choose the **Create new IAM role manually** link and follow the instructions.
**Note**  
When you purchase a product with contract pricing, a license is created by AWS Marketplace on the AWS account that your software can check using the License Manager API. You will need an IAM role to launch an instance of the AMI-based product.  
The following IAM permissions are required in the IAM policy.  

****  

   ```
   {
      "Version":"2012-10-17",		 	 	 
      "Statement":[
         {
            "Sid":"VisualEditorO",
            "Effect":"Allow",
            "Action":[
               "license-manager:CheckoutLicense",
               "license-manager:GetLicense",
               "license-manager:CheckInLicense",
               "license-manager:ExtendLicenseConsumption",
               "license-manager:ListReceivedLicenses"
            ],
            "Resource":"*"
         }
      ]
   }
   ```

1. After the instance details are configured, choose **Review and Launch**.

1. On the **Review Instance Launch** page, select an existing key pair or create a new key pair, and then choose **Launch Instances**.

   The **Initiating Instance Launches** progress window appears.

1. After the instance is initiated, go to the EC2 dashboard, and under **Instances**, see that the **Instance state** displays **Running**.

# Viewing a generated license
<a name="view-generated-license"></a>

After you subscribe to an AMI-based product, a license is generated in AWS License Manager. You can review the details of the license including the **Issuer** (AWS/Marketplace) and the **Entitlements** (the units that the license grants the right to use, access, or consume an application or resource).

**To view a generated license**

1. Sign in to AWS License Manager with your AWS account.

1. Under **Granted licenses**, view all of your granted licenses.

1. Search licenses by entering a product SKU, recipient, or status in the **Search** bar.

1. Choose the **License ID** and view the **License details**. 

# Modifying an existing contract
<a name="modify-existing-contract"></a>

If they have an existing upfront commitment for an AMI product, AWS Marketplace buyers can modify some aspects of a contract. An AMI contract is supported through contract terms based offers as opposed to hourly or annual flexible consumption pricing (FCP) offers. This feature is available only to applications that are integrated with AWS License Manager. Buyers can purchase additional licenses within the entitlement of the same offer in the current contract. However, buyers can't reduce the entitlement counts purchased in the contract. Buyers can also cancel the automatic subscription renewal if the option is enabled by the Seller. 

**Note**  
An installment plan's contract offer can't be modified. There are no entitlement changes available to the buyer for an installment plan's purchased contract. An entitlement is a right to use, access, or consume an application or resource. Installment plan offers are not changeable.

**Manage your subscription**

1. On the AWS Marketplace console, navigate to **View Subscription** and view the license for the software product. 

1. On the **Procurement** page, select **Manage License**.

1. From the list, select **View Terms**.

1. In the **Contract options** section, increase your entitlements by using the arrows. You can't reduce the entitlement counts below the entitlements purchased.

1. The contract details and total price displays in the **Pricing details** section.



**To cancel your automatic subscription renewal**

1. On the AWS Marketplace console, navigate to **View Subscription** and view the license for the software product. 

1. On the **Procurement** page, select **Manage License**.

1. On the **Subscription** page, locate the **Renewal Settings** section.

1. Ensure you understand the terms and conditions with cancellation.

1. Select the check box to cancel the automatic renewal.

# Cost allocation tagging for AMI products in AWS Marketplace
<a name="cost-allocation-tagging-ami-marketplace"></a>

AWS Marketplace supports cost allocation tagging for Amazon Machine Image (AMI)-based software products. New and existing Amazon Elastic Compute Cloud (Amazon EC2) instance tags automatically populate against corresponding AWS Marketplace AMI usage. You can use activated cost allocation tags to identify and track AMI usage through AWS Cost Explorer, the AWS Cost and Usage Reports, AWS Budgets, or other cloud spend analysis tools.

The vendor that provided the AMI may also record other custom tags in the metering for AMI-based products, based on information specific to the product. For more details, see [Using cost allocation tagging](cost-allocation-tagging.md).

You can use tags to organize your resources, and cost allocation tags to track your AWS costs on a detailed level. After you activate cost allocation tags, AWS uses the cost allocation tags to organize your resource costs on your cost allocation report, to make it easier for you to categorize and track your AWS costs.

Cost allocation tagging only tracks costs from the time when the tags were activated in the Billing and Cost Management console. Only AWS account owners, AWS Organizations management account owners, and users with the appropriate permissions can access the Billing and Cost Management console for an account. Regardless of whether you use cost allocation tagging, there's no change to how much you're billed. Whether you use cost allocation tags has no impact on the functionality of your AMI-based software products.

## Tracking cost allocation tags for one AMI across multiple instances
<a name="multi-instances-cost-allocation-tagging-marketplace"></a>

Each launched Amazon EC2 instance for a AWS Marketplace AMI subscription has a corresponding AWS Marketplace software usage line item in the AWS Cost and Usage report. Your AWS Marketplace usage will always reflect the specific tags applied to the corresponding Amazon EC2 instance. This allows you to distinguish your AWS Marketplace usage costs based on the different tag values that were assigned, at an instance level.

You can also sum up your tag-based usage costs to equal the AMI software usage charge reflected in your bill with either the Cost Explorer or the AWS Cost and Usage report.

## Finding budgets with cost allocated tagged instances
<a name="cost-allocation-tag-script-marketplace"></a>

If you already have active budgets filtered on cost allocation tags over a number of Amazon EC2 instances in the Billing and Cost Management console, it might be difficult to find all of them. The following Python script returns a list of budgets which contain Amazon EC2 instances from the AWS Marketplace in your current AWS Region.

You can use this script to be aware of a potential impact to your budget, and where overruns might occur from this change. Note that the billed amount doesn't change, but the cost allocations will be reflected more accurately, which can impact budgets.

```
#! /usr/bin/python

import boto3

session = boto3.Session()
b3account=boto3.client('sts').get_caller_identity()['Account']
print("using account {} in region {}".format(b3account,session.region_name))


def getBudgetFilters(filtertype):
    ''' 
    Returns budgets nested within the filter values [filter value][budeget name].
    The filtertype is the CostFilter Key such as Region, Service, TagKeyValue.
    '''    
    budget_client = session.client('budgets')
    budgets_paginator = budget_client.get_paginator('describe_budgets')
    budget_result = budgets_paginator.paginate(
        AccountId=b3account
    ).build_full_result()    
    returnval = {}
    if 'Budgets' in budget_result:
        for budget in budget_result['Budgets']:
            for cftype in budget['CostFilters']:
                if filtertype == cftype:                          
                    for cfval in budget['CostFilters'][cftype]:
                        if cfval in returnval:
                            if not budget['BudgetName'] in returnval[cfval]:
                                returnval[cfval].append(budget['BudgetName'])
                        else:
                            returnval[cfval] = [ budget['BudgetName'] ]
    return returnval

def getMarketplaceInstances():
    '''
    Get all the Amazon EC2 instances which originated with AWS Marketplace.        
    '''
    ec2_client = session.client('ec2')
    paginator = ec2_client.get_paginator('describe_instances')
    returnval = paginator.paginate(
        Filters=[{
            'Name': 'product-code.type',
            'Values': ['marketplace']
        }]
    ).build_full_result()
    return returnval


def getInstances():
    mp_instances = getMarketplaceInstances()
    budget_tags = getBudgetFilters("TagKeyValue")
    cost_instance_budgets = []
    for instance in [inst for resrv in mp_instances['Reservations'] for inst in resrv['Instances'] if 'Tags' in inst.keys()]:    
        for tag in instance['Tags']:                
            # combine the tag and value to get the budget filter string
            str_full = "user:{}${}".format(tag['Key'], tag['Value'])
            if str_full in budget_tags:
                for budget in budget_tags[str_full]:
                    if not budget in cost_instance_budgets:
                        cost_instance_budgets.append(budget)    
    print("\r\nBudgets containing tagged Marketplace EC2 instances:")
    print( '\r\n'.join([budgetname for budgetname in cost_instance_budgets]) )


if __name__ == "__main__":
    getInstances()
```

**Example output**

```
Using account 123456789012 in region us-east-2

Budgets containing tagged Marketplace EC2 instances:
EC2 simple
MP-test-2
```

## Related topics
<a name="cost-allocation-tagging-related-topics"></a>

For more information, see the following topics:
+ [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing User Guide*. 
+ [Activating the AWS-Generated Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activate-built-in-tags.html) in the *AWS Billing User Guide*. 
+ [Tagging Your Amazon EC2 Resources](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the Amazon EC2 User Guide.

# Using AMI aliases in AWS Marketplace
<a name="buyer-ami-aliases"></a>

An Amazon Machine Image (AMI) is identified with an `AMI ID`. You can use the `AMI ID` to indicate which AMI you want to use when launching a product. The `AMI ID` has the form `ami-<identifier>`, for example, ami-123example456. Each version of each product in each AWS Region has a different AMI (and different `AMI ID`).

When you launch a product from AWS Marketplace, the `AMI ID` is automatically filled in for you. Having the `AMI ID` is useful if you want to automate launching products from the AWS Command Line Interface (AWS CLI) or by using Amazon Elastic Compute Cloud (Amazon EC2). You can find the `AMI ID` when you configure your software at launch time. For more information, see [Step 3: Configuring your software](tutorial-buying-ami.md#step-3-configure-your-software). 

The `Ami Alias` is also in the same location as the `AMI ID`, when configuring your software. The `Ami Alias` is a similar ID to the `AMI ID`, but it's easier to use in automation. An `AMI alias` has the form `aws/service/marketplace/prod-<identifier>/<version>` , for example,` aws/service/marketplace/prod-1234example5678/12.2`. You can use this `Ami Alias` Id in any Region, and AWS automatically maps it to the correct Regional `AMI ID`. 

If you want to use the most recent version of a product, use the term **latest** in place of the version in the `AMI alias` so that AWS chooses the most recent version of the product for you, for example, **aws/service/marketplace/prod-1234example5678/latest**.

**Warning**  
Using the **latest** option gives you the latest release of the software. However, use this feature with caution. For example, if a product has versions 1.x and 2.x available, you might be using 2.x. However, the most recently released version of the product might be a bug fix for 1.x.

## Examples of using AMI aliases
<a name="buyer-ami-alias-examples"></a>

AMI aliases are useful in automation. You can use them in the AWS CLI or in CloudFormation templates.

The following example shows using an AMI alias to launch an instance by using the AWS CLI.

```
aws ec2 run-instances
--image-id resolve:ssm:/aws/service/marketplace/prod-<identifier>/version-7.1
--instance-type m5.xlarge
--key-name MyKeyPair
```

The following example shows a CloudFormation template that accepts the AMI alias as an input parameter to create an instance.

```
AWSTemplateFormatVersion: 2010-09-09

Parameters:
    AmiAlias:
        Description: AMI alias
        Type: 'String'
        
Resources:
    MyEC2Instance:
        Type: AWS::EC2::Instance
        Properties:
            ImageId: !Sub "resolve:ssm:${AmiAlias}"
            InstanceType: "g4dn.xlarge"
            Tags:
                -Key: "Created from"
                 Value: !Ref AmiAlias
```