如何以编程方式获得AWS EBS定价?

时间:2018-07-17 16:30:53

标签: amazon-web-services amazon-ebs

是否可以通过编程方式下载AWS ebs定价?

我能够下载整个AWS服务索引文件,但是没有列出Amazon EBS。

我下载了AmazonEC2定价信息。它具有PricePerUnit,对EC2实例而言意味着含义,但是没有任何内容仅针对EBS量专门显示PricePerUnit ...

https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/using-ppslong.html

1 个答案:

答案 0 :(得分:5)

肯定有。

在报价文件中查找"productFamily" : "Storage",

https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/us-east-1/index.json

"HY3BZPP2B6K8MSJF" : {
      "sku" : "HY3BZPP2B6K8MSJF",
      "productFamily" : "Storage",
      "attributes" : {
        "servicecode" : "AmazonEC2",
        "location" : "US East (N. Virginia)",
        "locationType" : "AWS Region",
        "storageMedia" : "SSD-backed",
        "volumeType" : "General Purpose",
        "maxVolumeSize" : "16 TiB",
        "maxIopsvolume" : "10000",
        "maxIopsBurstPerformance" : "3000 for volumes <= 1 TiB",
        "maxThroughputvolume" : "160 MB/sec",
        "usagetype" : "EBS:VolumeUsage.gp2",
        "operation" : "",
        "servicename" : "Amazon Elastic Compute Cloud"
      }
    },

从那里获取sku代码并进行搜索,您将看到类似以下内容的内容:

 "HY3BZPP2B6K8MSJF" : {
        "HY3BZPP2B6K8MSJF.JRTCKXETXF" : {
          "offerTermCode" : "JRTCKXETXF",
          "sku" : "HY3BZPP2B6K8MSJF",
          "effectiveDate" : "2018-06-01T00:00:00Z",
          "priceDimensions" : {
            "HY3BZPP2B6K8MSJF.JRTCKXETXF.6YS6EN2CT7" : {
              "rateCode" : "HY3BZPP2B6K8MSJF.JRTCKXETXF.6YS6EN2CT7",
              "description" : "$0.10 per GB-month of General Purpose SSD (gp2) provisioned storage - US East (Northern Virginia)",
              "beginRange" : "0",
              "endRange" : "Inf",
              "unit" : "GB-Mo",
              "pricePerUnit" : {
                "USD" : "0.1000000000"
              },
              "appliesTo" : [ ]
            }
          },
          "termAttributes" : { }
        }
      },