Expand description
The Cost Explorer API enables 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:
-
https://ce.us-east-1.amazonaws.com
For information about costs associated with the Cost Explorer API, see AWS Cost Management Pricing.
If you’re using the service, you’re probably looking for CostExplorerClient and CostExplorer.
Structs§
- Anomaly
An unusual cost pattern. This consists of the detailed metadata and the current status of the anomaly object.
- Anomaly
Date Interval The time period for an anomaly.
- Anomaly
Monitor This object continuously inspects your account's cost data for anomalies, based on
MonitorType
andMonitorSpecification
. The content consists of detailed metadata and the current status of the monitor object.- Anomaly
Score Quantifies the anomaly. The higher score means that it is more anomalous.
- Anomaly
Subscription The association between a monitor, threshold, and list of subscribers used to deliver notifications about anomalies detected by a monitor that exceeds a threshold. The content consists of the detailed metadata and the current status of the
AnomalySubscription
object.- Cost
Category The structure of Cost Categories. This includes detailed metadata and the set of rules for the
CostCategory
object.- Cost
Category Inherited Value Dimension When creating or updating a cost category, you can define the
CostCategoryRule
rule type asINHERITED_VALUE
. This rule type adds the flexibility of defining a rule that dynamically inherits the cost category value from the dimension value defined byCostCategoryInheritedValueDimension
. For example, if you wanted to dynamically group costs based on the value of a specific tag key, you would first choose an inherited value rule type, then choose the tag dimension and specify the tag key to use.- Cost
Category Processing Status The list of processing statuses for Cost Management products for a specific cost category.
- Cost
Category Reference A reference to a Cost Category containing only enough information to identify the Cost Category.
You can use this information to retrieve the full Cost Category information using
DescribeCostCategory
.- Cost
Category Rule Rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value.
- Cost
Category Values The Cost Categories values used for filtering the costs.
If
Values
andKey
are not specified, theABSENT
MatchOption
is applied to all Cost Categories. That is, filtering on resources that are not mapped to any Cost Categories.If
Values
is provided andKey
is not specified, theABSENT
MatchOption
is applied to the Cost CategoriesKey
only. That is, filtering on resources without the given Cost Categories key.- Cost
Explorer Client - A client for the AWS Cost Explorer API.
- Coverage
The amount of instance usage that a reservation covered.
- Coverage
ByTime Reservation coverage for a specified period, in hours.
- Coverage
Cost How much it costs to run an instance.
- Coverage
Hours How long a running instance either used a reservation or was On-Demand.
- Coverage
Normalized Units The amount of instance usage, in normalized units. Normalized units enable you to see your EC2 usage for multiple sizes of instances in a uniform way. For example, suppose you run an xlarge instance and a 2xlarge instance. If you run both instances for the same amount of time, the 2xlarge instance uses twice as much of your reservation as the xlarge instance, even though both instances show only one instance-hour. Using normalized units instead of instance-hours, the xlarge instance used 8 normalized units, and the 2xlarge instance used 16 normalized units.
For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances.
- Create
Anomaly Monitor Request - Create
Anomaly Monitor Response - Create
Anomaly Subscription Request - Create
Anomaly Subscription Response - Create
Cost Category Definition Request - Create
Cost Category Definition Response - Current
Instance Context about the current instance.
- Date
Interval The time period of the request.
- Delete
Anomaly Monitor Request - Delete
Anomaly Monitor Response - Delete
Anomaly Subscription Request - Delete
Anomaly Subscription Response - Delete
Cost Category Definition Request - Delete
Cost Category Definition Response - Describe
Cost Category Definition Request - Describe
Cost Category Definition Response - Dimension
Values The metadata that you can use to filter and group your results. You can use
GetDimensionValues
to find specific values.- Dimension
Values With Attributes The metadata of a specific type that you can use to filter and group your results. You can use
GetDimensionValues
to find specific values.- Disk
Resource Utilization The field that contains a list of disk (local storage) metrics associated with the current instance.
- EBSResource
Utilization The EBS field that contains a list of EBS metrics associated with the current instance.
- EC2Instance
Details Details about the Amazon EC2 instances that AWS recommends that you purchase.
- EC2Resource
Details Details on the Amazon EC2 Resource.
- EC2Resource
Utilization Utilization metrics of the instance.
- EC2Specification
The Amazon EC2 hardware specifications that you want AWS to provide recommendations for.
- ESInstance
Details Details about the Amazon ES instances that AWS recommends that you purchase.
- Elasti
Cache Instance Details Details about the Amazon ElastiCache instances that AWS recommends that you purchase.
- Expression
Use
Expression
to filter by cost or by usage. There are two patterns:-
Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. TheExpression
example looks like:{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", “us-west-1” ] } }
The list of dimension values are OR'd together to retrieve cost or usage data. You can create
Expression
andDimensionValues
objects using eitherwith
methods orset
methods in multiple lines. -
Compound dimension values with logical operations - You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. This allows you to filter on more advanced options. For example, you can filter on((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGETYPE != DataTransfer)
. TheExpression
for that looks like this:{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGETYPE", "Values": ["DataTransfer"] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error.{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGETYPE", "Values": [ "DataTransfer" ] } }
For the
GetRightsizingRecommendation
action, a combination of OR and NOT is not supported. OR is not supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited toLINKEDACCOUNT
,REGION
, orRIGHTSIZINGTYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR are not supported. Dimensions are limited toLINKEDACCOUNT
.-
- Forecast
Result The forecast created for your query.
- GetAnomalies
Request - GetAnomalies
Response - GetAnomaly
Monitors Request - GetAnomaly
Monitors Response - GetAnomaly
Subscriptions Request - GetAnomaly
Subscriptions Response - GetCost
AndUsage Request - GetCost
AndUsage Response - GetCost
AndUsage With Resources Request - GetCost
AndUsage With Resources Response - GetCost
Categories Request - GetCost
Categories Response - GetCost
Forecast Request - GetCost
Forecast Response - GetDimension
Values Request - GetDimension
Values Response - GetReservation
Coverage Request You can use the following request parameters to query for how much of your instance usage a reservation covered.
- GetReservation
Coverage Response - GetReservation
Purchase Recommendation Request - GetReservation
Purchase Recommendation Response - GetReservation
Utilization Request - GetReservation
Utilization Response - GetRightsizing
Recommendation Request - GetRightsizing
Recommendation Response - GetSavings
Plans Coverage Request - GetSavings
Plans Coverage Response - GetSavings
Plans Purchase Recommendation Request - GetSavings
Plans Purchase Recommendation Response - GetSavings
Plans Utilization Details Request - GetSavings
Plans Utilization Details Response - GetSavings
Plans Utilization Request - GetSavings
Plans Utilization Response - GetTags
Request - GetTags
Response - GetUsage
Forecast Request - GetUsage
Forecast Response - Group
One level of grouped data in the results.
- Group
Definition Represents a group when you specify a group by criteria or in the response to a query with a specific grouping.
- Impact
The anomaly's dollar value.
- Instance
Details Details about the instances that AWS recommends that you purchase.
- List
Cost Category Definitions Request - List
Cost Category Definitions Response - Metric
Value The aggregated value for a metric.
- Modify
Recommendation Detail Details on the modification recommendation.
- Network
Resource Utilization The network field that contains a list of network metrics associated with the current instance.
- Provide
Anomaly Feedback Request - Provide
Anomaly Feedback Response - RDSInstance
Details Details about the Amazon RDS instances that AWS recommends that you purchase.
- Redshift
Instance Details Details about the Amazon Redshift instances that AWS recommends that you purchase.
- Reservation
Aggregates The aggregated numbers for your reservation usage.
- Reservation
Coverage Group A group of reservations that share a set of attributes.
- Reservation
Purchase Recommendation A specific reservation that AWS recommends for purchase.
- Reservation
Purchase Recommendation Detail Details about your recommended reservation purchase.
- Reservation
Purchase Recommendation Metadata Information about this specific recommendation, such as the timestamp for when AWS made a specific recommendation.
- Reservation
Purchase Recommendation Summary A summary about this recommendation, such as the currency code, the amount that AWS estimates that you could save, and the total amount of reservation to purchase.
- Reservation
Utilization Group A group of reservations that share a set of attributes.
- Resource
Details Details on the resource.
- Resource
Utilization Resource utilization of current resource.
- Result
ByTime The result that is associated with a time period.
- Rightsizing
Recommendation Recommendations to rightsize resources.
- Rightsizing
Recommendation Configuration Enables you to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.
- Rightsizing
Recommendation Metadata Metadata for this recommendation set.
- Rightsizing
Recommendation Summary Summary of rightsizing recommendations
- Root
Cause The combination of AWS service, linked account, Region, and usage type where a cost anomaly is observed.
- Savings
Plans Amortized Commitment The amortized amount of Savings Plans purchased in a specific account during a specific time interval.
- Savings
Plans Coverage The amount of Savings Plans eligible usage that is covered by Savings Plans. All calculations consider the On-Demand equivalent of your Savings Plans usage.
- Savings
Plans Coverage Data Specific coverage percentage, On-Demand costs, and spend covered by Savings Plans, and total Savings Plans costs for an account.
- Savings
Plans Details Attribute details on a specific Savings Plan.
- Savings
Plans Purchase Recommendation Contains your request parameters, Savings Plan Recommendations Summary, and Details.
- Savings
Plans Purchase Recommendation Detail Details for your recommended Savings Plans.
- Savings
Plans Purchase Recommendation Metadata Metadata about your Savings Plans Purchase Recommendations.
- Savings
Plans Purchase Recommendation Summary Summary metrics for your Savings Plans Purchase Recommendations.
- Savings
Plans Savings The amount of savings you're accumulating, against the public On-Demand rate of the usage accrued in an account.
- Savings
Plans Utilization The measurement of how well you are using your existing Savings Plans.
- Savings
Plans Utilization Aggregates The aggregated utilization metrics for your Savings Plans usage.
- Savings
Plans Utilization ByTime The amount of Savings Plans utilization, in hours.
- Savings
Plans Utilization Detail A single daily or monthly Savings Plans utilization rate, and details for your account. A management account in an organization have access to member accounts. You can use
GetDimensionValues
to determine the possible dimension values.- Service
Specification Hardware specifications for the service that you want recommendations for.
- Sort
Definition The details of how to sort the data.
- Subscriber
The recipient of
AnomalySubscription
notifications.- TagValues
The values that are available for a tag.
If
Values
andKey
are not specified, theABSENT
MatchOption
is applied to all tags. That is, filtering on resources with no tags.If
Values
is provided andKey
is not specified, theABSENT
MatchOption
is applied to the tagKey
only. That is, filtering on resources without the given tag key.- Target
Instance Details on recommended instance.
- Terminate
Recommendation Detail Details on termination recommendation.
- Total
Impact Filter Filters cost anomalies based on the total impact.
- Update
Anomaly Monitor Request - Update
Anomaly Monitor Response - Update
Anomaly Subscription Request - Update
Anomaly Subscription Response - Update
Cost Category Definition Request - Update
Cost Category Definition Response - Utilization
ByTime The amount of utilization, in hours.
Enums§
- Create
Anomaly Monitor Error - Errors returned by CreateAnomalyMonitor
- Create
Anomaly Subscription Error - Errors returned by CreateAnomalySubscription
- Create
Cost Category Definition Error - Errors returned by CreateCostCategoryDefinition
- Delete
Anomaly Monitor Error - Errors returned by DeleteAnomalyMonitor
- Delete
Anomaly Subscription Error - Errors returned by DeleteAnomalySubscription
- Delete
Cost Category Definition Error - Errors returned by DeleteCostCategoryDefinition
- Describe
Cost Category Definition Error - Errors returned by DescribeCostCategoryDefinition
- GetAnomalies
Error - Errors returned by GetAnomalies
- GetAnomaly
Monitors Error - Errors returned by GetAnomalyMonitors
- GetAnomaly
Subscriptions Error - Errors returned by GetAnomalySubscriptions
- GetCost
AndUsage Error - Errors returned by GetCostAndUsage
- GetCost
AndUsage With Resources Error - Errors returned by GetCostAndUsageWithResources
- GetCost
Categories Error - Errors returned by GetCostCategories
- GetCost
Forecast Error - Errors returned by GetCostForecast
- GetDimension
Values Error - Errors returned by GetDimensionValues
- GetReservation
Coverage Error - Errors returned by GetReservationCoverage
- GetReservation
Purchase Recommendation Error - Errors returned by GetReservationPurchaseRecommendation
- GetReservation
Utilization Error - Errors returned by GetReservationUtilization
- GetRightsizing
Recommendation Error - Errors returned by GetRightsizingRecommendation
- GetSavings
Plans Coverage Error - Errors returned by GetSavingsPlansCoverage
- GetSavings
Plans Purchase Recommendation Error - Errors returned by GetSavingsPlansPurchaseRecommendation
- GetSavings
Plans Utilization Details Error - Errors returned by GetSavingsPlansUtilizationDetails
- GetSavings
Plans Utilization Error - Errors returned by GetSavingsPlansUtilization
- GetTags
Error - Errors returned by GetTags
- GetUsage
Forecast Error - Errors returned by GetUsageForecast
- List
Cost Category Definitions Error - Errors returned by ListCostCategoryDefinitions
- Provide
Anomaly Feedback Error - Errors returned by ProvideAnomalyFeedback
- Update
Anomaly Monitor Error - Errors returned by UpdateAnomalyMonitor
- Update
Anomaly Subscription Error - Errors returned by UpdateAnomalySubscription
- Update
Cost Category Definition Error - Errors returned by UpdateCostCategoryDefinition
Traits§
- Cost
Explorer - Trait representing the capabilities of the AWS Cost Explorer API. AWS Cost Explorer clients implement this trait.