Introduction to AWS Billing and Cost Management Tools: Part 3 of 3

With AWS billing reports, alerts and budgets, clients can start limiting their cloud footprint. AWS can further help by suggesting where and how costs can be saved.

This is the third and final part of our ongoing series on billing and cost management in AWS. In our last two posts (read part 2 here) we saw how billing reports provide insights into current and historical spending patterns and what tools are available to warn us when the spending crosses a limit. However, how do you start limiting that spending?
For companies with a large AWS footprint, this issue can be daunting. How do you know which services are not needed anymore? How do you decide if an instance needs to be terminated or resized?
Fortunately, there are some tools which can help answer these critical questions.

AWS Trusted Advisor

AWS Trusted Advisor is a multi-purpose tool designed to help AWS clients run workloads efficiently, securely, optimally, and fault tolerantly. It looks at AWS resources currently being used and compares their configurations against best practices. Any room for improvement is then highlighted.
Trusted Advisor can be accessed from the AWS console. It’s an app under the “Management Tools” section. Once in the dashboard, customers can choose any of the following four optimizations:

  • Cost Optimization
  • Performance
  • Security
  • Fault Tolerance

AWS Trusted Advisor Dashboard
To identify potential savings, customers should always run the Cost Optimization wizard at least once every month. Once run, its report can be downloaded as an Excel spreadsheet.
The cost optimization check audits a number of areas. Some of these areas include:

  • Low utilization EC2 instances: These are your idle servers. Perhaps the applications they once hosted have been migrated, upgraded  or retired. Look closely at the disk, CPU, and network usage of these instances over a reasonable period of time (three to six months). If you know they are no longer needed, terminate those instances. If the instances are still being used, resize them to a lower spec.
  • Idle RDS instances: These are database instances which are probably empty, infrequently accessed, or simply over-spec’ed. Check the number of connections against each instance and their sizes. Check what databases they host. If there are no user databases in them, terminate the instances. If the instances are running for non-production purposes in multiple AZ, recreate them in single-AZ configuration. This can bring down the cost by 50%.
  • Unassociated Elastic IP Addresses: Unassigned Elastic IP addresses or EIPs associated with offline EC2 instances incur costs. Audit these Elastic IP addresses and release them.
  • Underutilized EBS Volumes: You may have a large number of unattached EBS volumes. Check why they are there in the first place, and delete them if necessary.

In the image below, we can see an example of a Trusted Advisor audit. As the audit found, the AWS account here can be potentially save more than $32,000 every month:
Potential savings reported by AWS Trusted Advisor
Expanding each area of the audit will show a more detailed cost analysis. The overall or individual audit reports can be downloaded as CSV files.

AWS Price List API

When designing cloud-based applications and infrastructures, architects need to consider the pricing model of the services involved. Multiple factors can affect the total cost of ownership. A database hosted in a multi-AZ RDS instance could potentially cost more than running it in a two-node EC2 cluster. Then again, the price of EC2 instances depends on their instance types, and even those prices are different for on-demand and reserved instances. Traditionally, this involves a lot of manual price look-ups from different service pages. All these prices have to be manually checked, collated, and compared.

Fortunately, AWS now offers programmatic access to its price list. This is called the AWS Price List API. This is great news for system designers, because it’s now possible to dynamically query the AWS price list instead of manually scouring through web pages. Queries can be built into custom code written in any language.
There are two URLs necessary to get dynamic pricing information:

  • The Offer Index: This is a JSON file available at (https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/index.json). This file contains a list of services and their offer code. The following code snippet shows an excerpt from this file:
    {
     "formatVersion" : "v1.0",
     "disclaimer" : "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/",
     "publicationDate" : "2016-05-12T18:01:28Z",
     "offers" : {
       "AmazonS3" : {
        "offerCode" : "AmazonS3",
        "versionIndexUrl" : "/offers/v1.0/aws/AmazonS3/index.json",
        "currentVersionUrl" : "/offers/v1.0/aws/AmazonS3/current/index.json"
       },
       "AmazonGlacier" : {
        "offerCode" : "AmazonGlacier",
        "versionIndexUrl" : "/offers/v1.0/aws/AmazonGlacier/index.json",
        "currentVersionUrl" : "/offers/v1.0/aws/AmazonGlacier/current/index.json"
       },
       "AmazonSES" : {
        "offerCode" : "AmazonSES",
        "versionIndexUrl" : "/offers/v1.0/aws/AmazonSES/index.json",
        "currentVersionUrl" : "/offers/v1.0/aws/AmazonSES/current/index.json"
       },
      "AmazonRDS" : {
        "offerCode" : "AmazonRDS",
        "versionIndexUrl" : "/offers/v1.0/aws/AmazonRDS/index.json",
        "currentVersionUrl" : "/offers/v1.0/aws/AmazonRDS/current/index.json"
       },
    ...
    ...
  • Price List URL: This URL has the form:

    https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/{offer_code}/current/index.{format}.

    Here, the offer code for a specific service comes from the offer index file we saw before. The format at the end of the URL can be either JSON or CSV. For example, if we want to download the pricing information for RDS in a JSON format, the URL will be:
    https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/current/index.json

The pricing JSON file has two sections for each region:

  • The product information, identified by a unique code or SKU.
  • The pricing information related to that unique code.

In the following code snippet, we are looking at the product information for RDS service in the ap-southeast-2 (Sydney) region. This is the product information for:

  • Oracle Enterprise Edition RDS instances
  • on the db.m3.2xlarge instance type
  • in multi-AZ configuration
  • where the customer will be using its on-premise license (BYOL).
{
 "formatVersion" : "v1.0",
 "disclaimer" : "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/",
 "offerCode" : "AmazonRDS",
 "version" : "20160508033136",
 "publicationDate" : "2016-05-08T03:31:36Z",
 "products" : {
...
...
"SGDSDT26VZR6GTC6" : {
  "sku" : "SGDSDT26VZR6GTC6",
  "productFamily" : "Database Instance",
  "attributes" : {
   "servicecode" : "AmazonRDS",
   "location" : "Asia Pacific (Sydney)",
   "locationType" : "AWS Region",
   "instanceType" : "db.m3.2xlarge",
   "currentGeneration" : "Yes",
   "instanceFamily" : "General purpose",
   "vcpu" : "8",
   "physicalProcessor" : "Intel Xeon E5-2670 v2 (Ivy Bridge/Sandy Bridge)",
   "clockSpeed" : "2.5 GHz",
   "memory" : "30 GiB",
   "storage" : "2 x 80 SSD",
   "networkPerformance" : "High",
   "processorArchitecture" : "64-bit",
   "engineCode" : "5",
   "databaseEngine" : "Oracle",
   "databaseEdition" : "Enterprise",
   "licenseModel" : "Bring your own license",
   "deploymentOption" : "Multi-AZ",
   "usagetype" : "APS2-Multi-AZUsage:db.m3.2xlarge",
   "operation" : "CreateDBInstance:0005",
   "processorFeatures" : "Intel AVX; Intel Turbo"
   }
 },

And here is the pricing information related to this particular SKU. The first one is an on-demand pricing per hour (US$ 1.93) and the second one is the pricing for reserved instances with a one year term and no upfront fee (US$ 1.36 per hour):

 "SGDSDT26VZR6GTC6" : {
   "SGDSDT26VZR6GTC6.JRTCKXETXF" : {
    "offerTermCode" : "JRTCKXETXF",
    "sku" : "SGDSDT26VZR6GTC6",
    "effectiveDate" : "2016-06-01T00:00:00Z",
    "priceDimensions" : {
     "SGDSDT26VZR6GTC6.JRTCKXETXF.6YS6EN2CT7" : {
      "rateCode" : "SGDSDT26VZR6GTC6.JRTCKXETXF.6YS6EN2CT7",
      "description" : "$1.93 per RDS Second Gen Double Extra Large, Multi-AZ Instance hour (or partial hour) running Oracle EE - BYOL",
      "beginRange" : "0",
      "endRange" : "Inf",
      "unit" : "Hrs",
      "pricePerUnit" : {
       "USD" : "1.9300000000"
      },
      "appliesTo" : [ ]
     }
    },
    "termAttributes" : { }
   }
  },
  "SGDSDT26VZR6GTC6" : {
   "SGDSDT26VZR6GTC6.4NA7Y494T4" : {
    "offerTermCode" : "4NA7Y494T4",
    "sku" : "SGDSDT26VZR6GTC6",
    "effectiveDate" : "2015-09-30T23:59:59Z",
    "priceDimensions" : {
     "SGDSDT26VZR6GTC6.4NA7Y494T4.6YS6EN2CT7" : {
      "rateCode" : "SGDSDT26VZR6GTC6.4NA7Y494T4.6YS6EN2CT7",
      "description" : "Oracle EE (BYOL), db.m3.2xlarge instance-hours used this month",
      "beginRange" : "0",
      "endRange" : "Inf",
      "unit" : "Hrs",
       "pricePerUnit" : {
        "USD" : "1.3600000000"
       },
      "appliesTo" : [ ]
     }
    },
   "SGDSDT26VZR6GTC6" : {
   "SGDSDT26VZR6GTC6.4NA7Y494T4" : {
    "offerTermCode" : "4NA7Y494T4",
    "sku" : "SGDSDT26VZR6GTC6",
    "effectiveDate" : "2015-09-30T23:59:59Z",
    "priceDimensions" : {
     "SGDSDT26VZR6GTC6.4NA7Y494T4.6YS6EN2CT7" : {
      "rateCode" : "SGDSDT26VZR6GTC6.4NA7Y494T4.6YS6EN2CT7",
      "description" : "Oracle EE (BYOL), db.m3.2xlarge instance-hours used this month",
      "beginRange" : "0",
      "endRange" : "Inf",
      "unit" : "Hrs",
      "pricePerUnit" : {
       "USD" : "1.3600000000"
      },
      "appliesTo" : [ ]
     }
    },
    "termAttributes" : {
     "LeaseContractLength" : "1yr",
     "PurchaseOption" : "No Upfront"
    }
   },
...
...

As you can see, downloading these two files and programmatically parsing them with supplied parameters can dynamically provide up-to-the minute pricing information.
A few points about the dynamically generated price list:

  • It does not contain free tier pricing.
  • It does not contain EC2 spot instance pricing.
  • The pricing information is not available in the China region.

Price Update Notification

AWS Price Update Notification is yet another way to keep on top of AWS price changes. All you need to do is set up a Simple Notification Service (SNS) alert for AWS price changes. After that, whenever AWS makes any changes to its price list, the SNS topic will send an alert to the subscriber. Price changes can happen for a number of reasons. For example, AWS may decide to reduce its existing prices after a re:Invent event, or it can introduce a new instance type – or even a brand new service. Keeping on top of these prices will help you budget for the future.

In the following images, we are creating the Price Update Notification SNS topic. Here, we have to choose our region as us-east (North Virginia). That’s because AWS billing data is stored in that region for all your resources. We are creating a new subscription and choosing the endpoint for an existing SNS topic. This SNS topic has already been created by AWS, and its ARN is:
arn:aws:sns:us-east-1:278350005181:price-list-api
We would like to be notified by e-mail when the SNS topic sends an alert, so we have provided an e-mail address as the subscription endpoint.
AWS Price Update Notification SNS topic subscription
From now on, every time there is a price change from AWS, an automated e-mail will be sent to this address.

AWS Simple Monthly Calculator

Finally, another great tool for estimating resource costs is the AWS Simple Monthly Calculator. This is an online tool that you can access here.

Simple Monthly Calculator allows you to specify a number of parameters for one or more AWS services and calculate an estimated monthly cost. The estimation is based on the services’ pricing at the time of calculation. Bear in mind it’s only an estimation meant to help you plan your investment.
In the images below, we are estimating the cost of the following infrastructure components in the ap-southeast-2 (Sydney) region:

  • 2 on-demand m3.xlarge type Linux-based EC2 instances.
  • 2 500 GB general purposed SSD EBS storage volumes for each EC2 instance.
  • 1 500 GB S3 standard storage with 2000 GET requests and 1000 PUT/LIST requests per month.
  • 1 multi-AZ db.m3.large type MySQL RDS instance with 300 GB general purpose storage and same storage space for backup.
  • 1 100 GB DynamoDB instance with provisioned throughput and strong read consistency.

Estimated cost for EC2 only
Estimated cost for EC2 and S3
Estimated cost for EC2, S3 and RDS
Estimated cost for EC2, S3, RDS and DynamoDB
As you can see, the cost estimations are added as you include resources in your calculation. In the last image, we can see the monthly expenditure for this infrastructure can be up to $2,311.73.

Having a tool like this can help you budget for a project or application.

Third Party Tools

This series was about billing and cost management tools already available from AWS. There are also numerous third-party tools for running analytics, breakdowns and estimations on your AWS spending. Some of these tools are open source, while others are commercial but offer free trials. If you think the existing AWS tools don’t offer enough analytic capabilities, you may try some of the following programs:

  • Neflix Ice: This is a free tool, open sourced some time ago by Netflix. You can start by downloading and running it in your EC2 environment.
  • Cloudcheckr From their website, this is a “unified security and cost management” solution with a 14 day free trial.
  • Cloudability. A very popular SaaS solution used by some big names like Uber, Atlassian, Cisco and more. They also offer a 14 day free trial.

This is by no means an exhaustive list. There are other tools out there – be sure to leave a comment if you have a preferred tool.

AWS Billing Series Wrap-Up

AWS constantly develops new tools, and cost analysis is one area that’s getting a lot of attention. Keeping an eye on the new release announcements from AWS would be very helpful.
None of the tools discussed so far would be of any use if you are not proactive. All the analysis can show is where the money is being spent and how to minimize that spend.

Ultimately it’s the customer’s responsibility to consider and implement any recommendations. There are many good articles about AWS cost optimization best practices. Perhaps the best place to start would be this AWS site. Another great place to look into is the trusted advisor best practices page. Finally, the cost optimization white paper also offers some good information.

Cloud Academy’s Governance on AWS course also provides some excellent background knowledge.
We encourage you to refer to these resources to get started. Best of luck!

 

Avatar

Written by

Sadequl Hussain

Sadequl Hussain is an IT pro based in Sydney, Australia. He comes from a strong database administration backround and has more than 15 years of experience in development, database management, training, and technical writing. Sadequl also holds a number of vendor certifications, including one from AWS. He loves working with cloud technologies, NoSQL / Big Data databases, automation toolsets, open source technologies and Windows / Linux system administration. When he is not doing any of these, Sadequl loves to spend time with his young family.


Related Posts

Joe Nemer
Joe Nemer
— September 15, 2020

New Content: Azure DP-100 Certification, Alibaba Cloud Certified Associate Prep, 13 Security Labs, and Much More

This past month our Content Team served up a heaping spoonful of new and updated content. Not only did our experts release the brand new Azure DP-100 Certification Learning Path, but they also created 18 new hands-on labs — and so much more! New content on Cloud Academy At any time, y...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Joe Nemer
Joe Nemer
— August 28, 2020

AWS Certification Practice Exam: What to Expect from Test Questions

If you’re building applications on the AWS cloud or looking to get started in cloud computing, certification is a way to build deep knowledge in key services unique to the AWS platform. AWS currently offers 12 certifications that cover major cloud roles including Solutions Architect, De...

Read more
  • AWS
  • AWS Certifications
Patrick Navarro
Patrick Navarro
— August 25, 2020

Overcoming Unprecedented Business Challenges with AWS

From auto-scaling applications with high availability to video conferencing that’s used by everyone, every day —  cloud technology has never been more popular or in-demand. But what does this mean for experienced cloud professionals and the challenges they face as they carve out a new p...

Read more
  • AWS
  • Cloud Adoption
  • digital transformation
Avatar
Andrew Larkin
— August 18, 2020

Constant Content: Cloud Academy’s Q3 2020 Roadmap

Hello —  Andy Larkin here, VP of Content at Cloud Academy. I am pleased to release our roadmap for the next three months of 2020 — August through October. Let me walk you through the content we have planned for you and how this content can help you gain skills, get certified, and...

Read more
  • alibaba
  • AWS
  • Azure
  • content roadmap
  • Content updates
  • DevOps
  • GCP
  • Google Cloud
  • New content
Alisha Reyes
Alisha Reyes
— August 5, 2020

New Content: Alibaba, Azure AZ-303 and AZ-304, Site Reliability Engineering (SRE) Foundation, Python 3 Programming, 16 Hands-on Labs, and Much More

This month our Content Team did an amazing job at publishing and updating a ton of new content. Not only did our experts release the brand new AZ-303 and AZ-304 Certification Learning Paths, but they also created 16 new hands-on labs — and so much more! New content on Cloud Academy At...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Alisha Reyes
Alisha Reyes
— July 16, 2020

Blog Digest: Which Certifications Should I Get?, The 12 Microsoft Azure Certifications, 6 Ways to Prevent a Data Breach, and More

This month, we were excited to announce that Cloud Academy was recognized in the G2 Summer 2020 reports! These reports highlight the top-rated solutions in the industry, as chosen by the source that matters most: customers. We're grateful to have been nominated as a High Performer in se...

Read more
  • AWS
  • Azure
  • blog digest
  • Certifications
  • Cloud Academy
  • OWASP
  • OWASP Top 10
  • Security
  • VPCs
Avatar
Cloud Academy Team
— July 9, 2020

Which Certifications Should I Get?

The old AWS slogan, “Cloud is the new normal” is indeed a reality today. Really, cloud has been the new normal for a while now and getting credentials has become an increasingly effective way to quickly showcase your abilities to recruiters and companies. With all that in mind, the s...

Read more
  • AWS
  • Azure
  • Certifications
  • Cloud Computing
  • Google Cloud Platform
Alisha Reyes
Alisha Reyes
— July 2, 2020

New Content: AWS, Azure, Typescript, Java, Docker, 13 New Labs, and Much More

This month, our Content Team released a whopping 13 new labs in real cloud environments! If you haven't tried out our labs, you might not understand why we think that number is so impressive. Our labs are not “simulated” experiences — they are real cloud environments using accounts on A...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Joe Nemer
Joe Nemer
— June 19, 2020

Kickstart Your Tech Training With a Free Week on Cloud Academy

Are you looking to make a jump in your technical career? Want to get trained or certified on AWS, Azure, Google Cloud Platform, DevOps, Kubernetes, Python, or another in-demand skill? Then you'll want to mark your calendar. Starting Monday, June 22 at 12:00 a.m. PDT (3:00 a.m. EDT), ...

Read more
  • AWS
  • Azure
  • cloud academy content
  • complimentary access
  • GCP
  • on the house
Alisha Reyes
Alisha Reyes
— June 11, 2020

New Content: AZ-500 and AZ-400 Updates, 3 Google Professional Exam Preps, Practical ML Learning Path, C# Programming, and More

This month, our Content Team released tons of new content and labs in real cloud environments. Not only that, but we introduced our very first highly interactive "Office Hours" webinar. This webinar, Acing the AWS Solutions Architect Associate Certification, started with a quick overvie...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Rebecca Willis
Rebecca Willis
— June 3, 2020

Azure vs. AWS: Which Certification Provides the Brighter Future?

More and more companies are using cloud services, prompting more and more people to switch their current IT position to something cloud-related. The problem is most people only have that much time after work to learn new technologies, and there are plenty of cloud services that you can ...

Read more
  • AWS
  • Azure
  • certification
Alisha Reyes
Alisha Reyes
— June 2, 2020

Blog Digest: 5 Reasons to Get AWS Certified, OWASP Top 10, Getting Started with VPCs, Top 10 Soft Skills, and More

Thank you for being a valued member of our community! We recently sent out a short survey to understand what type of content you would like us to add to Cloud Academy, and we want to thank everyone who gave us their input. If you would like to complete the survey, it's not too late. It ...

Read more
  • AWS
  • Azure
  • blog digest
  • Certifications
  • Cloud Academy
  • OWASP
  • OWASP Top 10
  • Security
  • VPCs