Table: aws_cost_by_service_usage_type_daily - Query AWS Cost Explorer Service usage type daily using SQL
The AWS Cost Explorer Service usage type daily is a feature of AWS Cost Management that provides detailed information about your AWS costs, allowing you to visualize, understand, and manage your AWS costs and usage over time. This service provides data about your cost and usage in both tabular and graphical formats, with the ability to customize views and organize data to reflect your needs. The daily usage type specifically provides a granular view of costs incurred daily for each AWS service used.
Table Usage Guide
The aws_cost_by_service_usage_type_daily
table in Steampipe provides you with information about daily usage type and costs for each AWS service within AWS Cost Explorer. This table allows you, as a DevOps engineer, financial analyst, or cloud architect, to query daily-specific details, including usage amount, usage unit, and the corresponding service cost. You can utilize this table to gather insights on daily usage and costs, such as identifying high-cost services, tracking usage patterns, and managing your AWS expenses. The schema outlines the various attributes of the AWS service cost, including the service name, usage type, usage amount, usage start and end dates, and the unblended cost.
Amazon Cost Explorer helps you visualize, understand, and manage your AWS costs and usage. The aws_cost_by_service_usage_type_daily
table provides you with a simplified view of cost for services in your account (or all linked accounts when run against the organization master), summarized by day, for the last year.
Important Notes
- The pricing for the Cost Explorer API is per API request - Each request you make will incur a cost of $0.01.
Examples
Basic info
Explore your daily AWS service usage and costs, sorted by service and the start of the period. This can help you understand and manage your AWS expenses more effectively.
select service, usage_type, period_start, blended_cost_amount :: numeric :: money, unblended_cost_amount :: numeric :: money, amortized_cost_amount :: numeric :: money, net_unblended_cost_amount :: numeric :: money, net_amortized_cost_amount :: numeric :: moneyfrom aws_cost_by_service_usage_type_dailyorder by service, period_start;
select service, usage_type, period_start, CAST(blended_cost_amount AS NUMERIC) AS blended_cost_amount, CAST(unblended_cost_amount AS NUMERIC) AS unblended_cost_amount, CAST(amortized_cost_amount AS NUMERIC) AS amortized_cost_amount, CAST(net_unblended_cost_amount AS NUMERIC) AS net_unblended_cost_amount, CAST(net_amortized_cost_amount AS NUMERIC) AS net_amortized_cost_amountfrom aws_cost_by_service_usage_type_dailyorder by service, period_start;
Min, Max, and average daily unblended_cost_amount by service and usage type
Analyze your daily AWS service usage to understand the minimum, maximum, and average costs associated with each type of usage. This allows for more effective budget management and identification of potential cost-saving opportunities.
select service, usage_type, min(unblended_cost_amount) :: numeric :: money as min, max(unblended_cost_amount) :: numeric :: money as max, avg(unblended_cost_amount) :: numeric :: money as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by service, usage_type;
select service, usage_type, min(unblended_cost_amount) as min, max(unblended_cost_amount) as max, avg(unblended_cost_amount) as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by service, usage_type;
Top 10 most expensive service usage type (by average daily unblended_cost_amount)
Discover the segments that incur the highest average daily costs in your AWS services. This can help you identify areas where budget adjustments or cost optimizations might be necessary.
select service, usage_type, sum(unblended_cost_amount) :: numeric :: money as sum, avg(unblended_cost_amount) :: numeric :: money as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by average desclimit 10;
select service, usage_type, sum(unblended_cost_amount) as sum, avg(unblended_cost_amount) as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by average desclimit 10;
Top 10 most expensive service usage type (by total daily unblended_cost_amount)
This query is used to analyze the most costly services in terms of daily usage. It helps in budget management by highlighting areas where costs are significantly high, thus aiding in cost optimization strategies.
select service, usage_type, sum(unblended_cost_amount) :: numeric :: money as sum, avg(unblended_cost_amount) :: numeric :: money as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by sum desclimit 10;
select service, usage_type, sum(unblended_cost_amount) as sum, avg(unblended_cost_amount) as averagefrom aws_cost_by_service_usage_type_dailygroup by service, usage_typeorder by sum desclimit 10;
Schema for aws_cost_by_service_usage_type_daily
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_id | text | The AWS Account ID in which the resource is located. | |
amortized_cost_amount | double precision | This cost metric reflects the effective cost of the upfront and monthly reservation fees spread across the billing period. By default, Cost Explorer shows the fees for Reserved Instances as a spike on the day that you're charged, but if you choose to show costs as amortized costs, the costs are amortized over the billing period. This means that the costs are broken out into the effective daily rate. AWS estimates your amortized costs by combining your unblended costs with the amortized portion of your upfront and recurring reservation fees. | |
amortized_cost_unit | text | Unit type for amortized costs. | |
blended_cost_amount | double precision | This cost metric reflects the average cost of usage across the consolidated billing family. If you use the consolidated billing feature in AWS Organizations, you can view costs using blended rates. | |
blended_cost_unit | text | Unit type for blended costs. | |
estimated | boolean | Whether the result is estimated. | |
net_amortized_cost_amount | double precision | This cost metric amortizes the upfront and monthly reservation fees while including discounts such as RI volume discounts. | |
net_amortized_cost_unit | text | Unit type for net amortized costs. | |
net_unblended_cost_amount | double precision | This cost metric reflects the unblended cost after discounts. | |
net_unblended_cost_unit | text | Unit type for net unblended costs. | |
normalized_usage_amount | double precision | The amount of usage that you incurred, in normalized units, for size-flexible RIs. The NormalizedUsageAmount is equal to UsageAmount multiplied by NormalizationFactor. | |
normalized_usage_unit | text | Unit type for normalized usage. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
period_end | timestamp with time zone | End timestamp for this cost metric. | |
period_start | timestamp with time zone | Start timestamp for this cost metric. | |
region | text | The AWS Region in which the resource is located. | |
service | text | =, != | The name of the AWS service. |
unblended_cost_amount | double precision | Unblended costs represent your usage costs on the day they are charged to you. In finance terms, they represent your costs on a cash basis of accounting. | |
unblended_cost_unit | text | Unit type for unblended costs. | |
usage_quantity_amount | double precision | The amount of usage that you incurred. NOTE: If you return the UsageQuantity metric, the service aggregates all usage numbers without taking into account the units. For example, if you aggregate usageQuantity across all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hours vs. GB). | |
usage_quantity_unit | text | Unit type for usage quantity. | |
usage_type | text | =, != | The usage type of this metric. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_cost_by_service_usage_type_daily