【问题标题】:Why does get-product return no products in some regions?为什么 get-product 在某些地区不返回任何产品?
【发布时间】:2020-12-25 01:43:13
【问题描述】:

我正在使用get-products CLI 来获取不同区域的 ElastiCache 实例的定价。

我只是查询了返回的价格数量,我在某些地区得到了很好的结果:

bash-5.0$ location='us east (ohio)'
aws pricing get-products --profile=redislabs --service-code=AmazonElastiCache --filter Type=TERM_MATCH,Field=Location,Value="$location" --output json --query 'length(PriceList)'

输出:

122

但其他地区返回 0(例如“欧洲(斯德哥尔摩)”)

bash-5.0$ location='europe (stockholm)'
aws pricing get-products --profile=redislabs --service-code=AmazonElastiCache --filter Type=TERM_MATCH,Field=Location,Value="$location" --output json --query 'length(PriceList)'

输出:

0

这是为什么?当我可以转到AWS ElastiCache pricing page 并看到欧洲(斯德哥尔摩)的产品有很多价格时,为什么定价 CLI 会返回 0 个结果?

(我已尝试更改位置的大小写,但这没有区别 - 无论位置在什么情况下都有效。)

【问题讨论】:

    标签: amazon-web-services


    【解决方案1】:

    您正在寻找 location == europe,但语法是 EU。

    location='eu (stockholm)'
    
    aws pricing get-products --profile=redislabs --service-code=AmazonElastiCache --filter Type=TERM_MATCH,Field=Location,Value="$location" --output json --query 'length(PriceList)'
    

    返回:

    55

    【讨论】:

    • 感谢您的回复!非常感激。我曾认为“位置”映射到 SSM /aws/service/global-infrastructure/regions/$REGION-CODE/longname 参数,但我想不是 - 我必须弄清楚如何以其他方式获得这个 location
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 2011-07-16
    相关资源
    最近更新 更多