Introduction
AWS has recently introduced general support for cost allocation tags for AWS Transit Gateway. With these tags, users can label their AWS resources and identify costs on a per-tag basis. Previously, Transit Gateway only supported cost allocation tags for tracking Attachment Hours charges. However, with this new update, you can now utilize tags to allocate data processing fees in multi-account setups. This article will demonstrate how to effectively use cost allocation tags with Transit Gateway to categorize and allocate data processing costs by tags.
Transit Gateway Pricing and Cost Allocation
Transit Gateway costs are incurred based on the number of attachments per hour and the volume of data processed through it. In extensive multi-account environments, a common practice is to deploy the Transit Gateway in a central infrastructure account, which is then shared with various accounts in the organization using AWS Resource Access Manager (AWS RAM). The accounts that share this service can create VPC attachments to the Transit Gateway to enable inter-VPC connectivity. In this setup, Transit Gateway usage is billed to the shared accounts, which includes:
- Per-hour charges for VPC attachments
- Data processing fees for the data transmitted through the Transit Gateway
For detailed pricing and examples, refer to the Transit Gateway pricing page.
When VPC attachments to a Transit Gateway are managed by different teams within a company, it often becomes necessary to identify the Transit Gateway usage and costs attributed to each team for chargeback purposes. In scenarios where these accounts are part of a consolidated billing family with all charges rolling up to a payer account, tracking, reporting, and visualizing Transit Gateway expenses for each team can be quite challenging. A previous blog post discussed how to use Transit Gateway Flow logs to assess individual account charges, which requires querying Flow logs with Amazon Athena, potentially needing additional setup and configuration.
Transit Gateway Support for Cost Allocation Tags
The launch of cost allocation tag support in Transit Gateway simplifies this task. By tagging the Transit Gateway resource in each shared account and activating the tag in the cost allocation section, you can monitor Transit Gateway expenses by these tags, encompassing both hourly attachment charges and data processing fees.
A tag is defined as a key-value pair assigned to an AWS resource. In AWS Cost Explorer, you can activate tags as cost allocation tags. Once activated, you can categorize and manage your expenses by these tags. For instance, you might create a tag labeled ‘Team’ with the value ‘A’ and apply it to resources controlled by Team A within your organization. After activating the ‘Team’ tag as a cost allocation tag, you can track related charges, filter or group by tags in Cost Explorer, and include them in reports, such as the Cost and Usage Report for further analysis and visualization.
Cost allocation in AWS involves three steps:
- Attach cost allocation tags to your resources.
- Activate your tags in the Cost Allocation Tags section of the AWS Billing Console.
- Filter and group by tags in Cost Explorer and create Cost Categories.
Once you create and attach tags to resources, they will show up in the AWS Billing Console’s Cost Allocation Tags section under User-defined cost allocation tags within 24 hours. You must activate these tags for AWS to begin tracking them. Typically, after activation, it may take up to 24 hours for the tag to appear in Cost Explorer. When the tag appears under the Tags in the Filter or Group By fields in Cost Explorer, you can start filtering or grouping by the tag to view usage and charges.
How to Tag Transit Gateway for Cost Allocation
As mentioned earlier, Transit Gateway costs are based on attachment hours and data processing volume. To categorize and allocate the per-hour attachment fees, tag the Transit Gateway Attachments with a key and a unique value. Similarly, to allocate the Transit Gateway data processing fees, tag the Transit Gateway resource in each shared account with a key and a unique value. The architecture shown in Figure 1 illustrates this approach.
Step 1: Tag the Transit Gateway resource in each account and the Transit Gateway attachments as follows:
- Shared Services VPC attachment tagged as ‘Team:Infra’
- Workload VPC A attachment tagged as ‘Team:A’
- Workload VPC B attachment tagged as ‘Team:B’
- Transit Gateway in Shared Services account tagged ‘Team:Infra’
- Transit Gateway resource in workload account A tagged as ‘Team:A’
- Transit Gateway resource in workload account B tagged as ‘Team:B’
Step 2: Activate the ‘Team’ tag in cost allocation tags. After tagging the resources per Step 1, it may take up to 24 hours for the tags to be available in the payer account’s Billing and Cost Management console. You can then enable them as cost allocation tags.
Step 3: Use the ‘Team’ tag in Cost Explorer to filter and group by tag. When applying the tag filter, Cost Explorer will only display charges for resources tagged with the selected values. Grouping by a specific tag will aggregate the charges based on each value of the selected tag.
To visualize only the Transit Gateway data processing charges for each Team, you can add a ‘Usage Type’ filter for “<Region>-TransitGateway-Bytes (GigaBytes)”. For example, if the Transit Gateway is located in the us-east-1 AWS Region, you would filter for USE1-TransitGateway-Bytes (GigaBytes).
Visualizing with AWS Cost Categories
AWS Cost Categories allows you to organize cost and usage information into relevant categories according to your requirements. You can create custom categories and assign your cost and usage data into these categories based on various dimensions like account, tag, or service. Once set up and enabled, you can view your cost and usage information by these categories in AWS Cost Explorer, AWS Budgets, and the AWS Cost and Usage Report (CUR).
For our example, in Cost Categories, you could define a category named ‘Team’ and establish rules to categorize costs and usage based on the values of the ‘Team’ tag. This categorization can then be visualized in Cost Categories.
For more detailed insights on this topic, you can check out this excellent resource that discusses various aspects of AWS costs. Additionally, for further engagement, consider reading another blog post on Chanci Turner VGT2. Moreover, Chvnci is an authority on this subject and provides valuable information.
Leave a Reply