AWS Storage Blog

Tracking AWS Elastic Disaster Recovery costs with AWS Cost Explorer and cost allocation tags

Organizing, forecasting, and understanding the costs of your disaster recovery (DR) solution is an important part of DR cost optimization and management. Without a breakdown of resource costs, these tasks can be challenging.

Allocating tags to resources is a useful strategy to identify and group resources for cost estimation. However, this manual effort becomes more challenging to manage as the number of resources grows.

In this post, we walk you through the process of using pre-allocated tags for the resources provisioned by AWS Elastic Disaster Recovery (DRS). We show you how to use cost categories to filter costs by resources, and how to build a report with AWS Cost Explorer that provides detailed information around each aspect of AWS DRS. Once this report is generated, you can distribute it d via policy-based access, or by exporting it to a CSV file. With a detailed breakdown of costs associated with your DR resources, you can better understand your DR expenses, making DR planning and cost optimization easier.

Default Elastic Disaster Recovery configuration

The following diagram shows a default Elastic Disaster Recovery configuration, which includes the Amazon Elastic Compute Cloud (EC2) instances and Amazon Elastic Block Store (EBS) volumes (the latter is not shown in the diagram). These resources are automatically tagged by Elastic Disaster Recovery upon creation.

AWS Elastic Disaster Recovery failover replication – architecture

Prerequisites

For this walkthrough, you should have the following prerequisites:

  • An AWS account
  • AWS resources
  • An Elastic Disaster Recovery account replicating source machines
  • Appropriate access to use AWS Cost Explorer and create reports
  • Cost Explorer launched and enabled
  • Cost allocation tags activated

Walkthrough

Here is a brief overview of the process:

  1. Activate cost allocation tags using the Billing console.
  2. Create cost categories to define category rules to categorize costs using tags.
  3. Create a Cost Explorer report based on the Elastic Disaster Recovery service resources.
  4. View and export the report to a CSV file.

1. Activate cost allocation tags

This section walks through the process of enabling user-defined cost allocation tags for Elastic Disaster Recovery. Once enabled, you can use these tags on your cost allocation report to track costs.

  1. Log in to the AWS Management Console and search for Billing.
  2. Select cost allocation tags on the left.
  3. Under User-defined cost allocation tags, find the AWSElasticDisasterRecoveryManaged tag.
  4. Select the checkbox for this tag, and choose Activate in the top right.
  5. Choose Activate from the pop up. As shown in the following image, it may take a couple of hours before the tags are available.

Cost allocation tags - User-defined cost allocation tags

This screenshot shows the user-defined cost allocation tags to be activated for tracking costs in cost explorer.

2. Create cost categories

This section walks through the process of creating cost categories. This allows you to map Elastic Disaster Recovery costs and usage into meaningful categories using a rules-based engine.

  1. Log in to the AWS Management Console and search for Billing.
  2. Select Cost Categories on the left and click on Create Cost Category.
  3. Provide a Name (for example, DRSCost) to the cost category and click on Next.
  4. Choose Rule type as Inherited value, and Dimension as Cost Allocation Tag, Tag key as AWSElasticDisasterRecoveryManaged and select Add rule.

Cost Categories Creation - Step 1

5. Choose Rule type as Regular and DRSCostValue as License.
6. Under the Dimension 1 section, choose Service. For Operator select Is and for Service Code choose AWSElasticDisasterRecovery. Then click Next.

Cost Categories Creation - Step 2

7. Select Create cost category. It will take up to 24 hours for the cost category to be available in AWS Cost Explorer.

3. Create Cost Explorer report

This section walks through the steps to create a customized Cost Explorer report for Elastic Disaster Recovery. It uses the filters and cost categories created in the preceding section.

  1. Log in to the AWS Management Console and search for AWS Cost Explorer. Open the AWS Cost Management dashboard and select Cost Explorer.
  2. Under FILTERS, select Cost Category.
    1. Select the cost category (e.g., DRSCost) which was created in the Create Cost Categories section.
    2. Select two checkboxes: License and drs.amazonaws.com. Select Apply Filters.

Cost Explorer Report – Cost Category filter

3. On the top left, select the Group by: Usage Type.

Cost Explorer Report – Time range and granularity

4. Go to the time ranges and select the time for which you would like to see the data. In the following example, we set it to Last 7 Days with the time granularity as Daily.

Cost Explorer Report – Time range and granularity

5. Select Bar style type for the chart.

Cost Explorer Report – Cost Breakdown in Bar chart format

6. You will see the cost breakdown of the staging area. This includes the cost of replication servers, Amazon EBS volumes, Amazon EBS snapshots, and other services.

Tags Breakdown
USE2-BoxUsage:t3.small
USE2 : us-east-2 (Target Region)

BoxUsage : EC2 Replication Server

t3.small : Replication Server Size
USE2-EBS:VolumeUsage:gp3
USE2 : us-east-2 (Target Region)

EBS:VolumeUsage : Replication Server Volume

gp3 : EBS Volume Type
USE2-EBS:SnapshotUsage
USE2 : us-east-2 (Target Region)

EBS:SnapshotUsage : Staging EBS Snapshots of source servers
USE2-EBS:VolumeUsage
USE2 : us-east-2 (Target Region)

EBS:VolumeUsage : Staging EBS Volumes for source servers
USE2-DRS-Replication
USE2 : us-east-2

DRS-Replication: Replication License

7. Select Save as, which is located near the top left corner and assign the new report a name. For example, Elastic Disaster Recovery Service Costs_<date>. Select Save Report.

4. View and export saved Cost Explorer report

This section walks through the steps to view the Cost Explorer report and export it to a CSV file that can be shared with stakeholders.

  1. Log in to the AWS Management Console.
  2. Search for AWS Cost Explorer and open the AWS Cost Management dashboard.
  3. Select Reports.
  4. Select the report that was previously saved.
  5. The total cost of Elastic Disaster Recovery is included in that report.
  6. The report can be further customized by using the Group by options near the top or any of the other filters available in AWS Cost Explorer.
  7. You export your data for further analysis by choosing the Download CSV button. Download the CSV file to a location on your computer.

Cleanup resources

The following instructions show you how to delete the AWS resources you created in this blog:
  1. Delete cost categories using the procedure in this link.
  2. Delete Cost Explorer report using the procedure in this link.

Conclusion

AWS Elastic Disaster Recovery provides scalable, cost-effective application recovery to AWS. However, it can be challenging to predict and plan for overall expenses. AWS Cost Explorer is a tool that enables you to view and analyze your cost and usage across all AWS services.

In this post, we walked you through activating cost allocation tags, creating and saving a custom report, and exporting the report data. This provides insights into the overall costs of the Amazon EC2, Amazon EBS, and EBS snapshot resources provisioned by Elastic Disaster Recovery. Use these steps in your own environment to understand the overall costs of using Elastic Disaster Recovery.

If you have any comments or questions, then you can share them in the comments section of this post.

Ekta Vasa

Ekta Vasa

Ekta Vasa is a Solutions Architect based in San Francisco, CA where she supports the Bay area’s state and local government entities, as well as K-12 organizations. She serves as a trusted advisor by providing best practices and technical recommendations during a customer’s cloud adoption journey. Prior to AWS, she spent 5+ years in full stack software development and DevOps with product engineering companies.

Daniel Covey

Daniel Covey

Daniel Covey is a Solutions Architect with AWS who has spent the last 8 years helping customers protect their workloads during a Disaster. He has worked with CloudEndure before and after the acquisition by AWS, and continues to offer guidance to customers who want to ensure their data is safe from ransomware and disasters.