Demystifying AWS Pricing APIs & its Cryptic Codes

Story of Bob:

Bob is a senior IT in charge of a mid-sized manufacturing company, having its operations in 10 countries, and factories in 2 countries.

The company decided two years back to migrate 80% of its IT infrastructure to AWS. As Bob led this activity, he was the go-to-guy for the finance dept., for verifying the bills.

For few months, Bob managed the verification of bills and budget planning, by going through AWS website and scrubbing pricing data, through his own eyes and mind.

But, Bob was a certified smart guy. So, he decided to automate it.

How? Let’s hear from Bob.

——–

Me: Hey Bob, How you doing?

Bob: (smiles, coz he got who I sounded like) cool man, thanks.

Me: Bob, you used the AWS pricing APIs. What compelled you to do so?

Bob: The time taken to go through the AWS site, for pricing details.

We use 100s of EC2s of different flavours, of different sizes, TBs of different types of storages, databases, etc. And that’s just a small part of huge offerings by AWS.

Manually going through the prices, noting it at a particular date, keep looking for changes was too much. So, decided to do something about it.

By integrating the AWS APIs, now we have a dashboard tailored to our needs, and is always up-to-date. We have also created our own customized calculator for our users. It integrates the AWS prices and that from local vendors.

This has helped in streamlining our consumption and price is now more predictable.

Me: This makes sense for somebody like you, who deals with these many AWS components day-in-day-out, and is accountable for the expense.

Bob: Yes that true.

Me: I went through the API documentation of AWS Pricing. Let me summarize what I have understood, and ask you my doubts.

Bob: Sure

Me: First, the basics:

  1. The API access is through https.
  2. AWS provides the pricing information as json or csv.
  3. The APIs are publicly accessible, without AWS account.
  4. The base address for accessing json/csv is https://pricing.us-east-1.amazonaws.com/
  5. us-east-1 in above url is where all information is available and is not limited only to this zone.

To access the data, I followed these steps

Step1: Got the list of offerings from AWS by downloading

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

It has details of all AWS products and information of where to get its prices from.

For eg.

"AmazonEC2":
{
 
"offerCode" : "AmazonEC2",
 
"versionIndexUrl" : "/offers/v1.0/aws/AmazonEC2/index.json",
 
"currentVersionUrl": "/offers/v1.0/aws/AmazonEC2/current/index.json",
 
"currentRegionIndexUrl": "/offers/v1.0/aws/AmazonEC2/current/region_index.json"
 
},

(Note: A product, like AmazonEC2, is referred as ‘Offer’)

Step2: From the above set, accessed the ‘currentRegionIndexUrl’ url –

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

It gave details of prices in each region.

For eg.

"ap-south-1" :
 
{
 
"regionCode" : "ap-south-1",
 
"currentVersionUrl":"/offers/v1.0/aws/AmazonEC2/20180628005902/ap-south-1/index.json"
 
},

Step3: Accessed region specific file through above information. The resulting url was https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/20180628005902/ap-south-1/index.json

Now, the things are getting murkier. It’s a sea of confusing data.

There are some cryptic codes involved, and I couldn’t find any AWS document explaining these codes. Also, some sections show price as 0.0 dollars. How’s that possible?

Bob: The summary till now is correct. You have reached the source of data, but you are struggling to extract information out of it. To do that, you have to understand the offerings, and find patterns.

For example, you are accessing EC2 pricing. Now, EC2 pricing has variations like on-demand, dedicated hosts, reserved hosts. Then again, variations like full/no/partial upfront payment, etc.

Such variations are captured through those alien-looking codes.

Let’s take an example:

We want to check the price of Linux m5.large with SQL Enterprise preinstalled.

Through parsing, you get the code of this variant – ZV5VAXGR4YZS96VY

Search with this code and you will get multiple blocks in the file.

Each block represents a unique variant of the same product – the varying factors are mentioned above, like payment terms, dedicated hosts, etc

Each block will have a unique identifier, ‘Offertermcode’. For eg., ‘JRTCKXETXF’ represents on-demand pricing, payable per hr.

Another example, ‘HU7G6KETJZ’ represents reserved pricing with partial upfront fees. So the billing will include some amount to be paid upfront and some per month. ‘2TG2D8R56U’ is for upfront & ‘6YS6EN2CT7’ is for per/hr.

That’s it.

To summarize, there are three level of depths.

  1. Unique code of EC2 – say ZV5VAXGR4YZS96VY
  2. Unique offertermcode of above variant –

On-demand, fully-upfront-paid, no-upfront-paid, etc –~13 unique offertermcode

  1. Upfront and/or Per-hr payment terms

Me: Thanks Bob. It’s clear and demystified now.

I really want to be like you.

—-

AWS Price API documentation can be accessed here.

We, at Calsoft, have done AWS & Azure Price API integration, as well as other API integrations of varied scale and flavours, for and with, numerous vendors. Get in touch to know more.

 

 
Share:

Related Posts

Technical Documentation

Technical Documentation Review and Tips

Technical reviews are vital for effective and quality documentation. To make this happen, have documentation and its reviews listed as one of the deliverables – just like development or testing. This will place priority on the process, and ensure everyone involved understands the importance of proper and thorough reviews.

Share:
Technology Trends 2024

Technology Trends 2024- The CXO perspective

In the rapidly evolving landscape of 2024, technology trends are reshaping industries and redefining business strategies. From the C-suite perspective, executives are navigating a dynamic environment where artificial intelligence, augmented reality, and blockchain are not just buzzwords but integral components of transformative business models. The Chief Experience Officers (CXOs) are at the forefront, leveraging cutting-edge technologies to enhance customer experiences, streamline operations, and drive innovation. This blog delves into the strategic insights and perspectives of CXOs as they navigate the ever-changing tech terrain, exploring how these leaders are shaping the future of their organizations in the era of 2024’s technological evolution.

Share:
Technology Trends 2024

The Winds of Technology Blowing into 2024

As 2023 draws to a close, the digital landscape is poised for a seismic shift in 2024. Generative Artificial Intelligence (Gen AI) continues its integrative streak, disrupting industries from B2B to healthcare. Networking trends emphasize simplicity, while the synergy of cloud and edge computing with Gen AI promises real-time workflows. Quantum computing, cybersecurity, intelligent automation, and sustainable technology are key players, reshaping the technological fabric. Join us as we navigate the transformative currents of 2024, unraveling the impact on enterprises in our forthcoming article. Stay tuned for the tech evolution ahead!

Share:
Generative AI Shaping Future Industries

[Infoblog] Generative AI Shaping Future Industries

Generative AI is at the forefront of innovation, harnessing the power of machine learning algorithms to create new and original content, from images and music to entire virtual environments. This infographic depicts how Gen AI is evolving industries and shaping its future.

Share:

Enhancing vCenter Capabilities with VMware vCenter Plugins: A Deep Dive

 vCenter Server is one of the most powerful tools in VMware’s product portfolio, enabling efficient management of virtualized environments. One of the most used features in vCenter is the vCenter plugin, which extends the capabilities by providing custom features such as 3rd Party system discovery, and provisioning, providing a unified view, allowing administrators to manage vSphere, and 3rd Party systems seamlessly.

Share:
5G: Network Slicing, Its Management, and Orchestration

5G: Network Slicing, Its Management, and Orchestration

5G Network Slicing is a key characteristic in 5G which is realized through the integration of virtualization and software-defined networking technologies. The management and orchestration of 5G network slicing is a complex task that involves a combination of software and hardware solutions. Read this blog to explore the concept of Network Slicing and its management, orchestration aspects mainly focusing on management models.

Share: