AWS Storage Blog

Manage Amazon EFS backup costs: AWS Backup support for cost allocation tags

Organized, meaningful cost and usage data for backups helps customers better understand and manage their costs. Recently, we’ve been hearing from Amazon EFS customers that they are looking for more granular cost tracking for backups that they create across all of their file systems. In response to this, AWS Backup recently enabled cost allocation tags for Amazon EFS backups for use in AWS Cost Explorer and AWS Cost and Usage Reports (AWS CUR). Using cost allocation tags, you can better track and understand your overall costs. For example, you can allocate Amazon EFS backup costs to different teams, projects, applications, or customers.

In this post, I walk through how to set up cost allocation tags for use with Amazon EFS backups. Specifically, I cover these four topics:

  • Adding tags to Amazon EFS recovery points.
  • Activating cost allocation tags in AWS Billing and Cost Management dashboard.
  • Viewing your Amazon EFS costs by tag in AWS Cost Explorer.
  • Viewing your Amazon EFS costs by tag in AWS CUR.

Adding tags to Amazon EFS recovery points

Amazon EFS recovery points automatically inherit their tags from the underlying Amazon EFS file system. If you already have the correct tagging strategy enabled for your file systems, no further action is needed and you can move on to step 2. For customers that want to add additional tags to all newly created Amazon EFS backups, I cover three different options:

  • Option A: How to add tags automatically to all future recovery points.
  • Option B: How to manually add tags to existing recovery points via the AWS Management Console.
  • Option C: How to manually add tags using AWS Backup API operations via AWS CLI.

Option A: Add tags automatically to all recovery points

If you have not yet created a backup plan, see the blog post “Protecting your Data with AWS Backup,” which walks you through how to set one up. Once you have created a backup plan, edit your backup rule. Under Tags added to recovery points, add the specific tags that you want added to all future recovery points. I have added “backup:essential for this specific example.

Add tags automatically to all recovery points - EFS cost allocation blog post

Option B: Add tags manually to recovery points

You can also add tags manually to existing recovery points if you want to ensure that all recovery points have the same tagging strategy attached to them. To do so, go to the backup vault that has your recovery points. Select the recovery point you want to modify, and select Edit.

Add tags manually to recovery points - EFS Cost Allocation blog

Within the selected recovery point, select Add under Recovery Point Tags to add new tags to existing backups.

Within the selected recovery point, select Add under Recovery Point Tags to add new tags to existing backups.

Add the specific tags that you want to add. In this example, I continue with “backup:essential.”

Add the specific tags that you want to add. In this example, I continue with 'backup - essential'

Option C: Add tags manually using AWS Backup APIs

You can also use the TagResource API to add tags across multiple recovery points. The following code shows an example in PowerShell to list all recovery points for a particular resource:

$ARNs = aws backup list-recovery-points-by-backup-vault 
--backup-vault-name aws/efs/automatic-backup-vault 
--by-resource-arn <insert full resource arn here> 
--query 'RecoveryPoints[*].RecoveryPointArn' 
--output json | ConvertFrom-Json

The following script assigns specified tags for each of the recovery points listed above. In this example, I am adding “backup:essential” tags for each of the recovery points of my file system:

foreach ($arn in $ARNs) {aws backup tag-resource 
--resource-arn $arn --tags backup=essential}

Activate cost allocation tags in the AWS Billing and Cost Management dashboard

Before being able to view your Amazon EFS backup costs in AWS Cost Explorer and AWS CUR, you have to activate Cost allocation tags within the AWS Billing and Cost Management dashboard. First, select your Tag key, then click Activate. 

Activate cost allocation tags in the AWS Billing and Cost Management dashboard (1)

When Activate cost allocation tags comes up, click Activate again.

Activate cost allocation tags in the AWS Billing and Cost Management dashboard (2)

View costs by tag in AWS Cost Explorer

In AWS Cost Management, Cost Explorer enables you to view your Amazon EFS backup costs at a tag-based level. In this example, I view for the last 7 days for the tags we have added. I select Service as Backup, and select the specific tag by which we want to filter costs. As shown in the following screenshot, I can now see my AWS Backup costs at a tag-based granularity.

  View costs by tag in AWS Cost Explorer

View costs by tag in AWS Cost and Usage Reports

You can create a recurring report that AWS CUR delivers daily to your Amazon S3 bucket. To do so, navigate to AWS Cost and Usage Reports and select Create report. In Step 1, Report content, name your report and configure the Data refresh settings.

You can create a recurring report that AWS CUR delivers daily to your Amazon S3 bucket (report content) (1)

In Step 2, Delivery options, provide your S3 bucket details and Report path prefix, as well as your desired Time granularity, Report versioning, Compression type settings.

You can create a recurring report that AWS CUR delivers daily to your Amazon S3 bucket (delivery options) (2)

After report creation, you will receive reports in your S3 buckets within the next 24 hours. The following screenshot shows an example of a CSV file that shows costs for “backup:essential” key-value pair.

The following screenshot shows an example of a CSV file that shows costs for 'backup-essential' key-value pair.

Cleaning up

If you have finished following along, be sure to delete any example resources you no longer need in order to avoid incurring unintended Amazon EFS, AWS Backup, or Amazon S3 costs moving forward.

Conclusion

In this blog post, I demonstrated:

  • Assigning tags to existing resources within AWS Backup.
  • Activating cost allocation tags.
  • Viewing costs by tags in Cost Explorer.
  • Viewing costs by tags through Cost and Usage Reports.

I hope this walkthrough gives you a better understanding on how to use cost allocation tags. You can now better track and understand Amazon EFS backup costs across different backups and file systems. This new capability should help you easily allocate costs across your various teams, projects, applications, or customers, while also enabling you to better understand their backup usage patterns. With simplified tracking and managing of your Amazon EFS backup costs, optimizing backup spend on your file systems is significantly easier.

For more information, visit documentation for using cost allocation tags, AWS Cost Explorer, and AWS CUR. If you have any feedback or questions, please leave them in the comments section.

Aditya Maruvada

Aditya Maruvada

Aditya Maruvada is a Product Manager for AWS Backup with Amazon Web Services.