AWS Cost Categories

Complete FinOps Guide
calendar April 13, 2022
Chapter 4.4 AWS Cost Categories

What are AWS Cost Categories?

The AWS Cloud Financial Management Framework runs on four pillars: ee, Save, Plan and Run. AWS Cost Categories are a
fundamental aspect of that framework. With AWS Cost Categories, you can break down costs and associate them with
specific business units or service areas.

In this article, we will review AWS Cost Category in-depth, including the key terminology and conceptual knowledge
required to use Cost Categories effectively. We will also explain how meta-data such as tags are used in Cost
Categories. Then, we will walk through setting up cost categories so you can get hands-on with this powerful AWS
cost management tool.

Cloud Financial Management Pillars
Cloud Financial Management Pillars (Source)

What are AWS Cost Categories?

AWS Cost Categories is an AWS feature that allows users to
allocate cost and usage data to specific business units.

By enabling you to construct your cost allocation data, Cost Categories complements other AWS Cost Management
suite features, such as Cost Explorer,
Cost Budgets, and Cost Anomaly detection. To understand how AWS Cost Categories work, let’s take a deeper dive.

Cost Categories add a layer of abstraction

Different organizations have different structures for allocating costs, such as teams, applications, and projects.
AWS Cost Categories enable us to
group tags, accounts, services, and charge types using our organization’s preferred method.

For example, suppose you have three applications that together offer one service.
You can use AWS Cost Categories for these applications to charge your service rather than setting up a
separate tag for each application. You could also group different environments, including production,
testing, or staging for a single application.
This additional layer of abstraction allows us to optimize the granularity of our cost allocation.

Grouping and Multilevel Hierarchy

You can define custom groups based on the dimensions such as account, tags, cost category,
and multilevel hierarchical relationships among your cost categories to replicate your organizational
structure. For example:

  1. You can create a cost category named Team that includes groupings of multiple teams.
    Dimensions would be Account, and Tag and values would be Team A and Team B.
  2. To make a next-level relationship, you can create a cost category named Department.
    Select Dimension as Cost Category and Team as the Cost Category name.
  3. Select Team A and Team B as dimension values for Engineering and FinOps as dimension
    values for the FinOps department.

AWS Cost Cate7gories: Fundamental Concepts

There are several different features associated with creating and managing AWS Cost Categories.
Creating a cost category in the AWS Management Console includes Cost Category Name and Rule Types.
Additionally, managing AWS Cost Categories requires
knowledge of dimensions, operations, quotas. Below, we’ll take a closer look at each of these essential concepts.

Cost Category Name

Cost Category Name is, as the name implies, simply a name for a given cost category. Example Cost Category Names:

  • Cost Center
  • Team
  • Application

Rule Types

Rule Types specify which cost category values should be used to categorize costs. You can define
rules based on dimensions called a regular rule. You can also define rules dynamically
based on dimension value. Since it inherits rules based on dimension value, this type
of rule is known as an inherited rule.

Cost Category Value

Cost Category Values are associated with Cost Category Names.

Dimensions

Dimensions create rules within your cost category. You can think of dimensions
as filters for specifying rules. Currently, there are five types of billing dimensions
that are supported. These are:

  • Account – corresponds to your AWS Account name or AWS Account ID.
  • Service – all kinds of AWS services such as computing instances(EC2),
    Databases( RDS), Storage services (S3).
  • Charge Type – As the name suggests, Charge Type is charges such as Tax, Credits,
    and Saving Plan Negation. It is also known as the Term Comparisons.
  • Tag KeyCost Allocation Tag Keys used to label AWS resources.
  • Cost Category – used to specify rules based on other Cost Categories.

AWS Cost Category Dimensions example:

Cost Category Name: Team

Dimensions: Account and Tag

Values: Region 1 and Region 2

Representation of  AWS Cost Category Name and Values as filtered by Dimensions.
Representation of AWS Cost Category Name and Values as filtered by Dimensions.

Operations

Operations are analogous to boolean expressions such as AND, OR, NOT, or regular expressions.
The main difference is in the syntax. Supported operations in Cost Categories are:

Operations Type of Match Description
Is Exact Match Filters out the exact match
Is not Exact Match Filters out the same match that is not specified
Is absent Exact Match It excludes the tag key that matches this value.
Contains Approximate Match Filters for a text string containing this value.
Starts with Approximate Match Filters for a text string that has the specified start value
Ends with Approximate Match Filters for a text string that has the specified start value

AWS Cost Category Quota

We need to keep specific quotas and limitations in mind while creating AWS Cost Category.
The following table describes quotas, naming conventions, and restrictions for the AWS Cost Categories :

Field Quota Limit
Total number of AWS Cost Categories per management account 50
Total number of cost category rules for a cost category (API) 500
Naming convention Names must be unique, and they are case sensitive
The number of split charge rules for a cost category 10

Machine learning for cloud resource optimization

LEARN MORE
S3 icon
Use machine-learning algorithms to configure cloud resources based on workload patterns
S3 icon
Let algorithms select the optimal cloud configuration from thousands of catalog options
S3 icon
Integrate to ITSM and CI/CD pipelines to provide transparency and automation

Split Charges

In many cases, multiple teams use the same AWS resources. When that occurs, it creates additional work
and complexity for FinOps departments. The Split Charges feature of AWS Cost Categories helps solve
this problem. By splitting charges, organizations can allocate charges between multiple cost category values.

Refer to AWS’s splitting charges within
cost categories documentation for a deeper dive into getting the most out of splitting charges.

How to implement AWS Cost Categories

Now that you know all the elements and fundamental concepts behind
AWS Cost Categories let’s get hands-on experience in the AWS Management Console!

There are two ways to define your
Cost Categories in AWS Billing and Cost Management Console – the
JSON Editor or the GUI-based Rule Builder.

Meet us at KubeCon + CloudNativeCon North America. Salt Lake City, Utah | November 13-15, 2024

Schedule a Meeting

Create Cost Category: JSON Editor

You can write complex rules with nested conditions and use additional logical operators such as
NOT and OR using the JSON Editor.
The following is the syntax used as a JSON script to define the Cost Category.


  
  {
    "DefaultValue": "string",
    "Name": "string",
    "Rules": [ 
        { 
            "InheritedValue": { 
                "DimensionKey": "string",
                "DimensionName": "string"
            },
            "Rule": { 
                "And": [ 
                    "Expression"
                ],
                "CostCategories": { 
                    "Key": "string",
                    "MatchOptions": [ "string" ],
                   "Values": [ "string" ]
                },
                "Dimensions": { 
                   "Key": "string",
                    "MatchOptions": [ "string" ],
                   "Values": [ "string" ]
                },
                "Not": "Expression",
                "Or": [ 
                   "Expression"
                ],
                "Tags": { 
                   "Key": "string",
                    "MatchOptions": [ "string" ],
                   "Values": [ "string" ]
                }
            },
            "Type": "string",
            "Value": "string"
        }
    ],
    "RuleVersion": "string",
    "SplitChargeRules": [ 
        { 
            "Method": "string",
            "Parameters": [ 
                { 
                    "Type": "string",
                    "Values": [ "string" ]
                }
            ],
            "Source": "string",
            "Targets": [ "string" ]
        }
    ]
  }                                       
  

JSON Syntax to Create Cost Category (Source)

Create Cost Category: GUI Builder

To use the GUI Builder, sign in to your AWS Management Console, then follow these steps:

Meet us at FinOps X Europe. Barcelona, Spain | November 12 -13, 2024.

Schedule a Meeting
  1. Navigate to the Billing and Cost Management console. On the left side,
    you will be able to see Cost Category open as shown below:

    Billing and Cost Management console
  2. Click on the Cost Categories and select Create Cost Category.
    Give the Cost Category a name consistent with your business requirements.

    Create Cost Category
  3. Click Next. You can now define your Category rules based on Rule Types,
    Dimensions, and Account.

    Category rules
  4. You can also apply Split Charges if you want to share costs
    across multiple cost category values.

    Split Charges
    (Source)

Your next steps with AWS Cost Categories

We have discussed how to Create AWS Cost
Category via two different options. Using the AWS documentation below, you can learn more on how to :

Then, you can move on to a critical aspect of cost management: usage monitoring. After categorizing your data with AWS Cost Categories, you can view your
cost allocation breakdowns and your non-categorized costs.

For example, in the image below, we can see costs for separate teams, shared costs, and total costs.

Graphical Overview of the breakdown of cost allocation across Cost Category Values
Graphical Overview of the breakdown of cost allocation across Cost Category Values. (Source)

For more on cost analysis and visualization, check out the official AWS blog on visualizing
costs with Athena and Quicksight
.

A free 30-day trial for cloud & Kubernetes resource control. Experience in your environment or use sample data. See optimization potential in 48 hours. No card required.

Free Trial

Conclusion

AWS Cost Categories are a vital aspect of cloud financial management in the AWS cloud.
However, it isn’t the only aspect. To master the AWS FinOps and cost management, you also
need knowledge of AWS Budgets, AWS Cost Explorer, and other AWS Billing tools. You can
get started learning more about those
AWS billing tools for free here
.

Discover the benefits of optimized cloud & container resources. Try Densify for free for 30 days!

Free Trial