> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimazehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS PRM implementation reference

> Choose an AWS Partner Revenue Measurement (PRM) method for each workload, and use the exact tag keys, user agent strings, code samples and limits from the AWS PRM onboarding guide.

AWS Partner Revenue Measurement (PRM) attributes AWS service consumption to the AWS Marketplace product that drove it. This page covers how to implement it: which method to use for each workload, the exact identifier formats, code samples and the limits to design around.

Everything here is based on the [AWS PRM onboarding guide](https://docs.aws.amazon.com/PRM/latest/aws-prm-onboarding-guide/what-is-service.html). Replace the example account ID (`012345678901`) and product code (`5ugbbrmu7ud3u5hsipfzug61p`) with your own.

> [!NOTE]
>
> For what PRM is, why it affects eligibility for APN funding benefits, and the six steps to compliance, see [AWS Partner Revenue Measurement](https://optimazehq.com/partner-revenue-measurement).

## Choose a method

AWS offers three PRM methods. You can combine them on one product.

| Method | How it works | Best for |
| :- | :- | :- |
| **AWS Marketplace metering** | Attribution is automatic through Marketplace product metadata | AMI products (Amazon EC2) and ML products (Amazon SageMaker AI) |
| **Resource tagging** | Tag AWS resources with your partner identifier | SaaS, Professional Services, and any taggable resource |
| **User agent string** | Add a string to the AWS API and CLI calls your product makes | Products that call AWS APIs directly, and AMI or ML products that drive services beyond EC2 or SageMaker AI |

AWS defines three architecture patterns: everything in the partner account, everything in the customer account, or a hybrid of both. Match each workload to a method.

| Partner type | Where it runs | Use resource tagging when | Use the user agent string when |
| :- | :- | :- | :- |
| **AMI or ML seller** | Customer account | Marketplace metering covers EC2 or SageMaker AI automatically. Tag any other services you drive. | Your product calls other AWS services |
| **SaaS ISV** | Partner account | Infrastructure is static and long running | The product makes frequent AWS API or CLI calls |
| **ISV deploying into customer accounts** | Customer account | You deploy with IaC and the customer allows tags | The product makes ongoing calls, or the customer has strict tag policies |
| **ISV with read or access only** | Customer account | The customer agrees to tag resources | The product makes read API calls |
| **Hybrid ISV** | Both | Resources are taggable in either account | Regular calls are made in either account |
| **MSP, SI or consulting partner** | Customer account, limited access | You provision through IaC templates | Management calls, agents or installers carry the string |
| **Several partners on one resource** | Any | Each partner uses its own tag key, up to 10 partners per resource | Each partner adds its own string to its own calls |

> [!TIP]
>
> Tagging gives continuous attribution while the tag is present. The user agent string only attributes resources that receive at least one qualifying API call in the month. Use tagging for quiet, long-running infrastructure.

## Identifier formats

| Item | Format | Example |
| :- | :- | :- |
| Tag key (recommended) | `aws-apn-id-<Partner Central AWS account ID>` | `aws-apn-id-012345678901` |
| Tag key (short form) | `aws-apn-id` | Accepted. AWS recommends the account-specific key for new work, and it lets several partners tag the same resource. |
| Tag value | `pc:<product code>` | `pc:5ugbbrmu7ud3u5hsipfzug61p` |
| User agent string | `APN_1.1/pc_<product code>$` | `APN_1.1/pc_5ugbbrmu7ud3u5hsipfzug61p$` |
| Revenue Attribution ID | `ra-<13 characters>` | `ra-aabbccddee001` |

Find your product code in the **AWS Marketplace Management Portal** under **Products**, then the product's **Product Summary**. The 12-digit account ID in the tag key is your Partner Central AWS account ID, shown at the top right of the **Partner Central** homepage.

## Common formatting mistakes

Each of these attributes nothing, and none of them returns an error.

| Mistake | Wrong | Right |
| :- | :- | :- |
| Key not lowercase | `AWS-APN-ID`, `Aws-Apn-Id` | `aws-apn-id`, lowercase with hyphens |
| Missing `pc:` prefix | `5ugbbrmu7ud3u5hsipfzug61p` | `pc:5ugbbrmu7ud3u5hsipfzug61p` |
| Product ID instead of product code | `pc:prod-glbp4zzfn2ee4` | The alphanumeric product code, never the `prod-` ID |
| Tag delimiter in the user agent string | `APN_1.1/pc:<product code>$` | `APN_1.1/pc_<product code>$`. Tags use a colon, user agent strings an underscore. |
| Tagging services that generate no spend | IAM roles and policies | Resources that generate spend, such as EC2, RDS, S3 and Lambda |

## Resource tagging

Apply PRM tags through the tool that manages the resource.

> [!WARNING]
>
> Tags added in the console, CLI or SDK to resources managed by Terraform, CloudFormation or CDK cause drift. The next deploy can remove them, and attribution stops without an error.

```hcl Terraform theme={null}
provider "aws" {
  default_tags {
    tags = {
      aws-apn-id-012345678901 = "pc:5ugbbrmu7ud3u5hsipfzug61p"
    }
  }
}
```

```bash CloudFormation theme={null}
aws cloudformation create-stack --stack-name my-stack \
  --template-body file://template.yaml \
  --tags Key=aws-apn-id-012345678901,Value=pc:5ugbbrmu7ud3u5hsipfzug61p
```

```typescript AWS CDK theme={null}
Tags.of(stack).add('aws-apn-id-012345678901', 'pc:5ugbbrmu7ud3u5hsipfzug61p');
```

* Some Terraform resources, such as `aws_autoscaling_group`, do not support `default_tags`. Do not set the same key in `default_tags` and in a resource's own `tags`.
* EBS volumes created from block device mappings do not inherit CloudFormation stack tags. Tag them on the resource.
* Tag only resources your product directly uses or influences, and only in production.

## User agent string

The string must appear on every regular AWS API or CLI call your product makes. The trailing `$` is required.

```ini Shared config theme={null}
# ~/.aws/config
[default]
sdk_ua_app_id=APN_1.1/pc_5ugbbrmu7ud3u5hsipfzug61p$
```

```bash Environment variable theme={null}
export AWS_SDK_UA_APP_ID="APN_1.1/pc_5ugbbrmu7ud3u5hsipfzug61p$"
```

```python Python (boto3) theme={null}
from botocore.config import Config

ec2 = boto3.client(
    "ec2",
    config=Config(user_agent="APN_1.1/pc_5ugbbrmu7ud3u5hsipfzug61p$"),
)
```

```hcl Terraform module theme={null}
terraform {
  required_providers {
    aws = { source = "hashicorp/aws", version = ">= 6.27.0" }
  }
  provider_meta "aws" {
    user_agent = ["APN_1.1/pc_5ugbbrmu7ud3u5hsipfzug61p$"]
  }
}
```

* Set the string only on calls your product makes, never on calls the customer makes.
* If an application ID already exists, append yours after a space.
* The Terraform approach needs Terraform 1.0 or later and AWS provider 6.27.0 or later. `provider_meta` does not inherit into child modules, so add it to each one. Do not declare a `provider "aws"` block in a module you ship to customers.
* CloudFormation does not support custom user agent strings. Use tagging for CloudFormation-deployed resources.
* Only control plane calls count. Data plane calls do not. A read-only `Describe*` call qualifies.

## Validate

1. Make a test call and check that the `userAgent` field in **AWS CloudTrail** contains `APN_1.1/pc_<product code>$`.
2. Confirm the tags on your production resources.
3. Send deployment details to your AWS partner management team or APN Support for validation.
4. Check the [Attributed Revenue Dashboard](https://us-east-1.console.aws.amazon.com/partnercentral/analytics/attributed-revenue) in **Partner Central**. Revenue for a billing month appears about 45 days after that month ends.

## Limits to design around

| Rule | Limit | What it means |
| :- | :- | :- |
| Tags per resource | 50 | Check headroom and the customer's tag policies before you add yours |
| Partners per tagged resource | 10 | Partners beyond the tenth receive no attribution on that resource |
| User agent activity | 1 call per ARN per month | Resources with no qualifying call in a month attribute nothing for that month |
| Workloads counted | Production only | Use dev and test to validate, not to accrue attribution |
| Backfill | None | Attribution starts on the day you implement |
| Reporting delay | About 45 days after month end | October revenue appears around mid-December |
| RA ID allocation per month | 100 percent maximum | One entry per offer or opportunity per billing month |
| Edits to last month's allocation | Until the 7th of the month | After that, corrections go through AWS |
| Allocation API batch | 250 changes | Per `StartRevenueAttributionAllocationsTask` call |

## Sources

* [Onboarding guide for AWS Partner Revenue Measurement](https://docs.aws.amazon.com/PRM/latest/aws-prm-onboarding-guide/what-is-service.html), AWS documentation, accessed October 2026.
* [New Partner Revenue Measurement gives visibility into AWS service consumption](https://aws.amazon.com/about-aws/whats-new/2026/01/new-partner-revenue-measurement), AWS What's New, January 30, 2026.

> **[Get a free PRM readiness check](https://optimazehq.com/partner-revenue-measurement#readiness-check)**
>
> Find out which of your product-driven AWS spend carries a PRM signal, and what to fix first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.