AWS Logo
Menu
Cost Allocation for Amazon Q Developer Subscriptions

Cost Allocation for Amazon Q Developer Subscriptions

Allocate Amazon Q Developer subscription costs accurately across teams with an automated solution that enables effective chargeback models within organizations.

Sunil Govindankutty
Amazon Employee
Published May 8, 2025
Amazon Q Developer, an interactive, generative AI-powered assistant, can help you understand, build, upgrade, and operate applications on AWS. Amazon Q Developer supports developers across the software development life cycle by enhancing productivity and streamlining workflows. However, unlike typical resource-based services, its subscription pricing model creates unique cost allocation challenges.
In this blog post, I will cover developing a cost allocation model for the Amazon Q Developer subscription costs.

Amazon Q Developer Pricing and Billing

Amazon Q Developer has two different pricing tiers.
Figure 1. Amazon Q Developer pricing tiers
Figure 1. Amazon Q Developer pricing tiers
Resource-Based Costs
AWS services typically calculate costs based on the consumption of specific resources such as the storage volume, compute hours consumed, or number of API calls made. These resource-based costs can be easily tracked and allocated because they are directly tied to the resources within individual accounts.
Each AWS account can be associated with an allocation code such as a specific tag or cost category, and the charges for a business unit can be tracked, reported, and charged back accurately. AWS best practices for a well-architected environment recommends separating resources and workloads into multiple AWS accounts. AWS accounts act as isolated resource containers: they offer workload categorization as well as blast radius reduction if things go wrong. Account segregation also allows users to allocate costs internally to the appropriate cost centers, business functions, or application groups.
The Amazon Q Developer pricing model, designed for user-based subscriptions, differs from typical resource-based AWS services. A user-based subscriptions approach offers organizational flexibility but requires a specific strategy for detailed cost allocation
User-Based Subscription Costs
User-based subscription costs for Amazon Q Developer are charged at the payer account when using the recommended Organization instance of AWS Identity and Access Management (IAM) Identity Center (IDC) .
The pricing model allows developers to access the features of Amazon Q Developer across multiple projects with a single license, eliminating the need to track usage per individual resource or AWS account. Organizations can provision the required number of user licenses based on their team size. The model also provides a cohesive billing experience across different subscriptions like Amazon Q Business, Amazon Quicksight Q, etc. However, after provisioning licenses, organizations need a mechanism to track and allocate the user-based subscription costs to the appropriate cost allocation codes.
The solution outlined below will provide an effective way to address the challenge of allocating Amazon Q Developer subscription costs.

Cost Allocation Solution Overview

This solution leverages AWS Cost and Usage Reports (CUR), Amazon Athena, and AWS IAM Identity Center to gather and process subscription data, while using AWS Batch to run the cost allocation analysis as a containerized job.

Prerequisites:

  1. At the payer level, verify if AWS CUR 2.0 exists in AWS Data Exports with the Include resource IDs option selected. Create one if not present.
    Figure 2. Create CUR 2.0 with resource IDs.
    Figure 2. Create CUR 2.0 with resource IDs.
2. Set up CUR 2.0 querying using Amazon Athena following the instructions here. This will allow you to analyze the data using standard SQL.
3. Create an AWS Batch Fargate job queue if one does not exist to run the subscription cost analysis as a containerized job. This setup enables scheduling and efficient execution of the analysis process.

Installation:

1. Clone this q-developer-subscription-cost-breakdown repo and follow the installation instructions to deploy the CloudFormation template and Docker container. The CloudFormation template requires configuration parameters including the Athena database details, IAM Identity Center store id, and the specific user attribute designated for subscription cost allocation. An AWS Batch Job to process subscription costs will be created after the successful installation.
2. Using the code below, run the batch job by using the previously created AWS Batch Fargate job queue. You can also include the year and month for cost allocation as additional parameters for analyzing historical cost data or reprocessing past allocations. If you don't provide the year and month, the solution will automatically use the current year and month to get the cost data.
The AWS Batch job can be configured to run automatically on a monthly schedule, leveraging AWS Batch's scheduling features to align with your organization's reporting cycles.

Solution Walkthrough:

The CUR includes three key columns that identify Amazon Q Developer subscription details. The line_item_usage_type column displays the monthly subscription description. The line_item_operation column shows 'number-q-dev-subscriptions', indicating this is a Q Developer subscription charge. The line_item_resource_id column contains the IAM Identity Center User Amazon Resource Name (ARN), uniquely identifying each user. The line_item_unblended_cost contains the subscription cost at the selected time granularity for the CUR; prorated if needed.
Figure 3. CUR Data snapshot for Amazon Q Developer subscription cost
Figure 3. CUR Data snapshot for Amazon Q Developer subscription cost
The solution leverages these data points for retrieving the subscription charges.
The high-level architecture diagram of the solution is below.
Figure 4. Amazon Q Developer User Subscription cost allocation architecture
Figure 4. Amazon Q Developer User Subscription cost allocation architecture
First, the subscription charge per user is aggregated from the CUR table using the query:
The query is executed against the Amazon Athena table by the job:
The AWS IAM Identity Center User ID is retrieved from the line_item_resource_id column. The User ID can then be used to look up the user details from AWS IAM Identity Center.
The lookup will retrieve detailed user information like name, email, phone number, etc. This data can then be used to look up the additional details about the users. If a custom Cost Allocation attribute, such as Cost Center, Project Code, Business Unit code, etc. is available in AWS IAM IDC as an extended user attribute, then a signed API call is used to extract the information. (Note: If these extended attributes are stored in other systems, replace the step below with the appropriate lookup mechanism in the query_idc.py file from the repo).
The solution has now aggregated the Subscription cost per user with the corresponding cost allocation attribute from AWS IAM IDC chosen during installation. The next step handles the allocation of Tax/Credit line items. The final output can then be used in your organization's existing cost allocation mechanisms.
The Tax/Credit line items corresponding to the Subscription cost does not have associated user information. These line items are added up separately and then proportionally distributed to the cost allocation attribute.
This step ensures that the Tax/Credit charges are appropriately accounted for and allocated to the relevant entities even though they cannot be directly associated with individual user identities.
The subscription cost and other charges per user are then stored in a DynamoDB table by the job for downstream reporting and actions.

Cleanup:

Delete the CloudFormation template that was deployed. Remove the prerequisites (AWS Batch job queue, Athena tables, and CUR Data Exports) if they were created specifically for this cost allocation solution.

Conclusion

In this post, I outlined a cost allocation method to accurately attribute user subscription costs and associated charges for Amazon Q Developer to different organizational entities. With accurate cost attribution and allocation, organizations can implement effective chargeback models within their AWS environment.
The solution utilizes AWS CUR 2.0 (available at no cost), along with Amazon Athena, AWS Batch Fargate, and Amazon DynamoDB, which incur usage-based charges. Given the monthly execution frequency and minimal data processing requirements, the solution's running costs are typically low. Use the AWS Pricing Calculator to estimate costs based on your usage patterns. Refer to managing subscriptions in the Amazon Q Developer user guide to activate subscriptions for your developers.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments