AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing CostExplorer The Cost Explorer API allows you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for Amazon DynamoDB database tables in your production environment.

Service Endpoint

The Cost Explorer API provides the following endpoint:

For information about costs associated with the Cost Explorer API, see AWS Cost Management Pricing.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.CostExplorer.AmazonCostExplorerClient

Namespace: Amazon.CostExplorer
Assembly: AWSSDK.CostExplorer.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonCostExplorerClient : AmazonServiceClient
         IAmazonCostExplorer, IAmazonService, IDisposable

The AmazonCostExplorerClient type exposes the following members

Constructors

NameDescription
Public Method AmazonCostExplorerClient()

Constructs AmazonCostExplorerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonCostExplorerClient(RegionEndpoint)

Constructs AmazonCostExplorerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonCostExplorerClient(AmazonCostExplorerConfig)

Constructs AmazonCostExplorerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonCostExplorerClient(AWSCredentials)

Constructs AmazonCostExplorerClient with AWS Credentials

Public Method AmazonCostExplorerClient(AWSCredentials, RegionEndpoint)

Constructs AmazonCostExplorerClient with AWS Credentials

Public Method AmazonCostExplorerClient(AWSCredentials, AmazonCostExplorerConfig)

Constructs AmazonCostExplorerClient with AWS Credentials and an AmazonCostExplorerClient Configuration object.

Public Method AmazonCostExplorerClient(string, string)

Constructs AmazonCostExplorerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostExplorerClient(string, string, RegionEndpoint)

Constructs AmazonCostExplorerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostExplorerClient(string, string, AmazonCostExplorerConfig)

Constructs AmazonCostExplorerClient with AWS Access Key ID, AWS Secret Key and an AmazonCostExplorerClient Configuration object.

Public Method AmazonCostExplorerClient(string, string, string)

Constructs AmazonCostExplorerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostExplorerClient(string, string, string, RegionEndpoint)

Constructs AmazonCostExplorerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostExplorerClient(string, string, string, AmazonCostExplorerConfig)

Constructs AmazonCostExplorerClient with AWS Access Key ID, AWS Secret Key and an AmazonCostExplorerClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetCostAndUsage(GetCostAndUsageRequest)

Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. You can also filter and group your data by various dimensions, such as SERVICE or AZ, in a specific time range. For a complete list of valid dimensions, see the

GetDimensionValues
            
operation. Master accounts in an organization in AWS Organizations have access to all member accounts.

Public Method GetCostAndUsageAsync(GetCostAndUsageRequest, CancellationToken)

Initiates the asynchronous execution of the GetCostAndUsage operation.

Public Method GetDimensionValues(GetDimensionValuesRequest)

Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.

Public Method GetDimensionValuesAsync(GetDimensionValuesRequest, CancellationToken)

Initiates the asynchronous execution of the GetDimensionValues operation.

Public Method GetReservationCoverage(GetReservationCoverageRequest)

Retrieves the reservation coverage for your account. This allows you to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's master account can see the coverage of the associated member accounts. For any time period, you can filter data about reservation usage by the following dimensions:

  • AZ

  • CACHE_ENGINE

  • DATABASE_ENGINE

  • DEPLOYMENT_OPTION

  • INSTANCE_TYPE

  • LINKED_ACCOUNT

  • OPERATING_SYSTEM

  • PLATFORM

  • REGION

  • SERVICE

  • TAG

  • TENANCY

To determine valid values for a dimension, use the GetDimensionValues operation.

Public Method GetReservationCoverageAsync(GetReservationCoverageRequest, CancellationToken)

Initiates the asynchronous execution of the GetReservationCoverage operation.

Public Method GetReservationPurchaseRecommendation(GetReservationPurchaseRecommendationRequest)

Gets recommendations for which reservations to purchase. These recommendations could help you reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.

AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of RI to purchase to maximize your estimated savings.

For example, AWS automatically aggregates your EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a size-flexible RI. AWS also shows the equal number of normalized units so that you can purchase any instance size that you want. For this example, your RI recommendation would be for c4.large, because that is the smallest size instance in the c4 instance family.

Public Method GetReservationPurchaseRecommendationAsync(GetReservationPurchaseRecommendationRequest, CancellationToken)

Initiates the asynchronous execution of the GetReservationPurchaseRecommendation operation.

Public Method GetReservationUtilization(GetReservationUtilizationRequest)

Retrieves the reservation utilization for your account. Master accounts in an organization have access to member accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues to determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID.

Public Method GetReservationUtilizationAsync(GetReservationUtilizationRequest, CancellationToken)

Initiates the asynchronous execution of the GetReservationUtilization operation.

Public Method GetTags(GetTagsRequest)

Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.

Public Method GetTagsAsync(GetTagsRequest, CancellationToken)

Initiates the asynchronous execution of the GetTags operation.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms