← 返回命令列表

Linux command

aws-ce 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Get cost and usage data

aws ce get-cost-and-usage --time-period Start=[YYYY-MM-DD],End=[YYYY-MM-DD] --granularity MONTHLY --metrics "BlendedCost" --group-by Type=DIMENSION,Key=SERVICE

Get a cost forecast

aws ce get-cost-forecast --time-period Start=[YYYY-MM-DD],End=[YYYY-MM-DD] --metric BLENDED_COST --granularity MONTHLY

List all cost anomalies

aws ce get-anomalies --date-interval StartDate=[YYYY-MM-DD],EndDate=[YYYY-MM-DD]

Get reservation utilization

aws ce get-reservation-utilization --time-period Start=[YYYY-MM-DD],End=[YYYY-MM-DD]

Get savings plans coverage

aws ce get-savings-plans-coverage --time-period Start=[YYYY-MM-DD],End=[YYYY-MM-DD] --group-by Type=DIMENSION,Key=SERVICE

Get rightsizing recommendations

aws ce get-rightsizing-recommendation --service AmazonEC2

说明

aws ce is the AWS CLI interface for AWS Cost Explorer, enabling programmatic access to cost and usage data. It allows querying aggregated data like total monthly costs or granular metrics such as daily operations for specific services. Cost Explorer provides insights into spending patterns, forecasting, anomaly detection, and recommendations for reserved instances and savings plans. All requests go through the us-east-1 regional endpoint.

FAQ

What is the aws-ce command used for?

aws ce is the AWS CLI interface for AWS Cost Explorer, enabling programmatic access to cost and usage data. It allows querying aggregated data like total monthly costs or granular metrics such as daily operations for specific services. Cost Explorer provides insights into spending patterns, forecasting, anomaly detection, and recommendations for reserved instances and savings plans. All requests go through the us-east-1 regional endpoint.

How do I run a basic aws-ce example?

Run `aws ce get-cost-and-usage --time-period Start=[YYYY-MM-DD],End=[YYYY-MM-DD] --granularity MONTHLY --metrics "BlendedCost" --group-by Type=DIMENSION,Key=SERVICE` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more aws-ce examples?

This page includes 6 examples for aws-ce, plus related commands for nearby Linux tasks.