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 CostAndUsageReport

You can use the Amazon Web Services Cost and Usage Report API to programmatically create, query, and delete Amazon Web Services Cost and Usage Report definitions.

Amazon Web Services Cost and Usage Report track the monthly Amazon Web Services costs and usage associated with your Amazon Web Services account. The report contains line items for each unique combination of Amazon Web Services product, usage type, and operation that your Amazon Web Services account uses. You can configure the Amazon Web Services Cost and Usage Report to show only the data that you want, using the Amazon Web Services Cost and Usage Report API.

Service Endpoint

The Amazon Web Services Cost and Usage Report API provides the following endpoint:

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.CostAndUsageReport.AmazonCostAndUsageReportClient

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

Syntax

C#
public class AmazonCostAndUsageReportClient : AmazonServiceClient
         IAmazonCostAndUsageReport, IAmazonService, IDisposable

The AmazonCostAndUsageReportClient type exposes the following members

Constructors

NameDescription
Public Method AmazonCostAndUsageReportClient()

Constructs AmazonCostAndUsageReportClient 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.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCostAndUsageReportClient(RegionEndpoint)

Constructs AmazonCostAndUsageReportClient 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.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCostAndUsageReportClient(AmazonCostAndUsageReportConfig)

Constructs AmazonCostAndUsageReportClient 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.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonCostAndUsageReportClient(AWSCredentials)

Constructs AmazonCostAndUsageReportClient with AWS Credentials

Public Method AmazonCostAndUsageReportClient(AWSCredentials, RegionEndpoint)

Constructs AmazonCostAndUsageReportClient with AWS Credentials

Public Method AmazonCostAndUsageReportClient(AWSCredentials, AmazonCostAndUsageReportConfig)

Constructs AmazonCostAndUsageReportClient with AWS Credentials and an AmazonCostAndUsageReportClient Configuration object.

Public Method AmazonCostAndUsageReportClient(string, string)

Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostAndUsageReportClient(string, string, RegionEndpoint)

Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostAndUsageReportClient(string, string, AmazonCostAndUsageReportConfig)

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

Public Method AmazonCostAndUsageReportClient(string, string, string)

Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostAndUsageReportClient(string, string, string, RegionEndpoint)

Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonCostAndUsageReportClient(string, string, string, AmazonCostAndUsageReportConfig)

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

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.CostAndUsageReport.Model.ICostAndUsageReportPaginatorFactory

Paginators for the service

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 DeleteReportDefinition(DeleteReportDefinitionRequest)

Deletes the specified report. Any tags associated with the report are also deleted.

Public Method DeleteReportDefinitionAsync(DeleteReportDefinitionRequest, CancellationToken)

Deletes the specified report. Any tags associated with the report are also deleted.

Public Method DescribeReportDefinitions(DescribeReportDefinitionsRequest)

Lists the Amazon Web Services Cost and Usage Report available to this account.

Public Method DescribeReportDefinitionsAsync(DescribeReportDefinitionsRequest, CancellationToken)

Lists the Amazon Web Services Cost and Usage Report available to this account.

Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method ListTagsForResource(ListTagsForResourceRequest)

Lists the tags associated with the specified report definition.

Public Method ListTagsForResourceAsync(ListTagsForResourceRequest, CancellationToken)

Lists the tags associated with the specified report definition.

Public Method ModifyReportDefinition(ModifyReportDefinitionRequest)

Allows you to programmatically update your report preferences.

Public Method ModifyReportDefinitionAsync(ModifyReportDefinitionRequest, CancellationToken)

Allows you to programmatically update your report preferences.

Public Method PutReportDefinition(PutReportDefinitionRequest)

Creates a new report using the description that you provide.

Public Method PutReportDefinitionAsync(PutReportDefinitionRequest, CancellationToken)

Creates a new report using the description that you provide.

Public Method TagResource(TagResourceRequest)

Associates a set of tags with a report definition.

Public Method TagResourceAsync(TagResourceRequest, CancellationToken)

Associates a set of tags with a report definition.

Public Method UntagResource(UntagResourceRequest)

Disassociates a set of tags from a report definition.

Public Method UntagResourceAsync(UntagResourceRequest, CancellationToken)

Disassociates a set of tags from a report definition.

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:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5