How Tagging Resources Can Reduce Your AWS Bill
Tags: aws
Published: 2020-03-18 16:22:40

---
title: How Tagging Resources Can Reduce Your AWS Bill
published: true
description: Learn how to get started using Amazon Web Service resource tags to monitor costs and some best practices to keep in mind.
tags: AWS
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ege5p68h2o2sjcwy76ir.jpg
---
Amazon AWS has revolutionized everything from simple file storage to complex data processing tasks. From students to Fortune 100 companies, anyone can tap virtually limitless storage and processing power in just minutes.

But with great power comes great responsibility: The pay-as-you-go pricing structure makes it just as easy to rack up enormous bills. It's easy for companies to 'set and forget' their AWS infrastructure until it grows out of control.

Fortunately, there are simple tools and strategies that you can put in place to manage your costs. The key is recognizing the need to monitor costs early on and putting the right processes in place to ensure everyone is kept up-to-date.

Let's take a look at why AWS tags are the best starting point for cost management and how you can get started with them.

Amazon AWS has made it possible to provision resources in minutes — but it's just as easy to rack up large bills without the right cost monitoring in place.

## What Are AWS Tags?

Amazon AWS enables users to assign metadata to their resources in the form of _tags_ — or simple labels that consist of a key and optional value. You can use tags to manage, search for, and filter resources, which makes it much easier to manage them.

There are two different types of cost allocation tags:

* **User-defined Tags**: These tags can include anything that you’d like to track, ranging from projects to cost centers. Just don’t include any sensitive information in them! The easiest way to add them is by using the AWS Tag Editor.
* **AWS-generated Tags**: These are “createdBy” tags that are automatically created by AWS. You can activate these tags in the AWS Management Console in the Billing and Cost Management console under Cost Allocation Tags.

[AWS Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/) and [Cost and Usage Report](https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html) files (CUR) can break down AWS costs using these tags. You can easily see what business units, projects, customers, or cost centers are generating the highest expenses and address them before they become a problem.

For example, the following report shows tags in each column and costs in each row, demonstrating how you can drill down into resource usage:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wipn30bwyir62r6ithrb.png)
_Cost Allocation Report Example - Source: Amazon AWS Docs_

Cost allocation reports are generated as a comma-separated value (CSV) file that can be easily analyzed by third-party reporting tools or turned into visualizations.

It’s important to note that cost allocation tags can take up to 24 hours to appear in the Billing and Cost Management console, but you can speed up the process with a manual refresh.

## Getting Started with Tags

The best way to get started with tags is to come up with a standardized set of resource tags to use throughout your organization. For instance, do you want to track costs by project, department or other metrics? What is the name of these tags?

If you have existing tags, you can identify and programmatically standardize them using tools like the Resource Groups Tagging API, AWS Config Rules, custom scripts, or by manually using the AWS Tag Editor and billing reports. This is known as _reactive governance_.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/iihj4gxnp9y78hqodbu9.png)
_Example of Rule Parameters - Source: Amazon AWS Docs_

The example above shows a series of required tags specified in an AWS Config Rule. If the "Value" is missing, that means that the tag is optional, while specific values mean that the tag must include one of the values in order to be valid.

You can check for invalid tags on resources by setting up custom rules. In the example below, the rule checks EC2 instances to ensure that they contain required tags and flag any instances that don’t adhere to the standard.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/raucabylyee3v0mu05dq.png)
_Example of Required Tags on EC2 - Source: Amazon AWS Docs_

If you already use standardized tags or are starting from scratch, you can move straight to tools like AWS CloudFormation, AWS Service Catalog, or IAM resource-level permissions to enforce standardized tags during resource creation. This is known as _proactive governance_.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jz1wdupugboh8p50ffsz.png)
_Tag Library Workflow - Source: Amazon AWS Docs_

The AWS Service Catalog TagOption Library is one of the easiest ways to create tag templates. By associating TagOptions for different products, the tool aggregates the associated product TagOptions and applies them to each newly provisioned product.

## The Bottom Line

It's easy for AWS costs to spin out of control over time, but fortunately, tagging can help you monitor and proactively address these rising costs. 

Tracking AWS costs can help you save thousands or tens of thousands of dollars over time by cutting waste and streamlining usage. It’s important to implement these efforts with the support of both engineers and management and ensure smooth communication.