Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get aws ebs pricing programmatically?

Is it possible to download aws ebs pricing programmatically?

I was able to get the entire AWS service index file downloaded, but I don't see Amazon EBS listed.

I downloaded the AmazonEC2 pricing information. It has PricePerUnit, meaning for the EC2 instance, but nothing that specifically shows PricePerUnit for just the EBS volume...

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

like image 757
ficestat Avatar asked Jul 17 '18 16:07

ficestat


People also ask

How are EBS charges calculated?

Resolution. Amazon EBS volumes are billed by the gigabyte-month (GB-month). The GB-month is a measure of how many gigabytes of EBS storage are provisioned to your account and how long the EBS storage is provisioned to your account.

Can EBS scale automatically?

Yes, you read it right. Just like EC2 autoscaling, you can scale your EBS volumes as well.

How do you calculate EBS volume?

To view information about an EBS volume using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Volumes. (Optional) Use the filter options in the search field to display only the volumes that interest you.


1 Answers

Sure there is.

Look for "productFamily" : "Storage", in offer file:

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"
      }
    },

From there grab sku code and search for it and you will see something like this:

 "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" : { }
        }
      },
like image 127
Asdfg Avatar answered Sep 19 '22 15:09

Asdfg