← 返回命令列表

Linux command

aws-pricing 命令

文本

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

常用示例

List AWS services

aws pricing describe-services --region us-east-1

Get attribute values

aws pricing get-attribute-values --service-code [AmazonEC2] --attribute-name [instanceType] --region us-east-1

Get product pricing

aws pricing get-products --service-code [AmazonEC2] --filters "Type=TERM_MATCH,Field=instanceType,Value=[t3.micro]" "Type=TERM_MATCH,Field=location,Value=[US East (N. Virginia)]" --region us-east-1

List available price lists

aws pricing list-price-lists --service-code [AmazonEC2] --effective-date [2024-01-01] --currency-code USD --region us-east-1

Get download URL

aws pricing get-price-list-file-url --price-list-arn [arn:aws:pricing:::price-list/...] --file-format [json] --region us-east-1

说明

aws pricing is the AWS CLI interface to the AWS Price List Query API, providing programmatic access to AWS service pricing. It allows querying prices using standardized product attributes like location, instance type, storage class, and operating system. The API is primarily used for building cost-estimation tools, budget forecasting, and cost-optimization analysis. Prices are returned at the SKU level with both On-Demand and Reserved Instance pricing options.

参数

--service-code _code_
AWS service identifier (e.g. `AmazonEC2`, `AmazonS3`, `AmazonRDS`).
--filters _filter_ ...
Filter products by attributes using `Type=TERM_MATCH,Field=_name_,Value=_value_`.
--region _region_
API endpoint region; must be `us-east-1`, `eu-central-1`, or `ap-south-1`.
--effective-date _date_
Date for which to retrieve prices (prices change over time).
--currency-code _code_
Currency for the price list (e.g. `USD`, `CNY`).
--format-version _version_
Response format version (`aws_v1`).

FAQ

What is the aws-pricing command used for?

aws pricing is the AWS CLI interface to the AWS Price List Query API, providing programmatic access to AWS service pricing. It allows querying prices using standardized product attributes like location, instance type, storage class, and operating system. The API is primarily used for building cost-estimation tools, budget forecasting, and cost-optimization analysis. Prices are returned at the SKU level with both On-Demand and Reserved Instance pricing options.

How do I run a basic aws-pricing example?

Run `aws pricing describe-services --region us-east-1` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --service-code _code_ do in aws-pricing?

AWS service identifier (e.g. `AmazonEC2`, `AmazonS3`, `AmazonRDS`).