← 返回
开发者工具 Key

aws-price-csv

Generate AWS cost CSVs from a user-provided service list. Use when someone supplies an item list + AWS region and needs per-item pricing plus totals via AWS...
根据用户提供的服务列表生成AWS成本CSV文件。当用户提供项目列表和AWS区域,需要获取每项单价和总费用时使用。
crazylion crazylion 来源
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 702
下载
💾 9
安装
1
版本
#latest

概述

AWS Price CSV Skill

Overview

Transforms a user-provided AWS service list (instances, volumes, S3 buckets, etc.) into a pricing CSV. The script can query the AWS Price List API (via aws-cli) or reuse cached bulk JSON files. It supports On-Demand and Reserved terms and automatically adds up per-item and total costs.

Quick Start

  1. Prepare a YAML/JSON file with name, service_code, filters, term, and usage fields (see sample in references/api_reference.md).
  2. Pick the data source:
    • API mode – requires aws pricing get-products permission and an internet connection.
    • Bulk mode – no IAM access required; the script downloads/caches public bulk JSON files.
  3. Run the script with the region and desired options:

```bash

python3 scripts/generate_pricing_csv.py \

--input inputs/sample.yml \

--region ap-northeast-1 \

--source bulk \

--cache-dir ~/.cache/aws-price-csv \

--output quotes/apac_quote.csv

```

  1. Inspect the CSV (each line item + TOTAL) and deliver alongside the original request if needed.

Workflow

1. Prepare the input list

  • Use the YAML/JSON templates in references/api_reference.md.
  • filters must map to AWS pricing attributes (instanceType, regionCode, volumeApiName, usagetype, termType, etc.).
  • term.type: OnDemand or Reserved (RI).
  • term.attributes (optional) filter Reserved prices (LeaseContractLength, PurchaseOption, OfferingClass, ...).
  • usage.quantity represents the amount to multiply (hours, GB-Mo, requests, ...).

2. Choose the data source

ModeWhen to useNotes
--------------------------
API (--source api)You already have IAM creds and want real-time dataUses aws pricing get-products in us-east-1
Bulk (--source bulk)Offline, no IAM, or you want cachingThe script checks --cache-dir (default ~/.cache/aws-price-csv); cached files newer than 30 days are reused, otherwise they are re-downloaded

> You can still override with --bulk-files ServiceCode=/path/to/file.json; those files win over the cache.

3. Generate the CSV

  • Script path: scripts/generate_pricing_csv.py
  • Key arguments:
  • --input: YAML/JSON list
  • --region: AWS region code (location name is auto-added to filters)
  • --output: CSV path (default aws_pricing.csv)
  • --source: api (default) or bulk
  • --cache-dir: bulk cache directory (default ~/.cache/aws-price-csv)
  • --force-refresh: ignore cached bulk files and re-download
  • --bulk-files: ServiceCode=/path/to/file.json overrides the cache
  • Output columns: item_name, service_code, term_type, region, location, quantity, usage_unit, price_unit, price_per_unit_usd, cost_usd, description, plus a TOTAL row.

4. Validate & deliver

  • Review the CSV to ensure every line item has pricing and a description.
  • Confirm the TOTAL matches expectations.
  • Include the source list or any supporting docs if required.

Troubleshooting

IssueFix
------------
aws pricing returns empty resultsDouble-check filters (location, regionCode, termType, etc.) or fall back to bulk mode
aws CLI missingInstall aws-cli v2, configure credentials, or rely on bulk mode
Need to refresh cached dataUse --force-refresh or delete the cached JSON so it gets re-downloaded
PyYAML missingpip install pyyaml or convert input to JSON
Reserved price not foundAdd LeaseContractLength, PurchaseOption, OfferingClass inside term.attributes

Resources

  • scripts/generate_pricing_csv.py – main script with API/bulk support, caching logic, and On-Demand/Reserved handling.
  • references/api_reference.md – Price List API examples, bulk download pointers, region/location table, and sample input templates (including gp3 and RI cases).

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 12:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Stock Watcher

robin797860
管理和监控个人股票自选列表,支持利用同花顺数据添加、删除、列出股票及汇总近期表现。适用于用户希望追踪特定股票、获取表现汇总或管理自选列表时。
★ 112 📥 45,618
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 205 📥 66,125
data-analysis

Tavily 搜索

jacky1n7
通过 Tavily API 进行网页搜索(Brave 替代方案)。当用户要求搜索网页、查找来源或链接,且 Brave 网页搜索不可用时使用。
★ 272 📥 99,826