If you handle Cloud Infrastructure, you invariably will find yourself needing to do cost forecasting - either for your whole infrastructure or for a specific service - to have data supporting a case or strategy.
How much does it cost?
This is a regular question we get when managing AWS configurations; in an ideal world we would have our resources fully (and correctly) tagged as per recommended best practices but usually with an infrastructure mix of legacy services and acquired products in the organization, this isn't always true - or easy to achieve. This process is usually cumbersome and time consuming - maybe not all infrastructure is defined as IaC or, if it is, it won't be in the most manageable way, that would allow the team to easily add the needed tags.
While your team works thoroughly in the background importing resources, refactoring the IaC and implementing the newly defined tagging policy, this question comes along and now you have to estimate the cost of your AWS Organization and the impact of changes you have for next year.
Ok so, how...?
Enter the AWS Cost Explorer tool, which is used to analyze historical data, generate forecasts, and identify spending trends, hopefully to make our life easier!
AWS Cost Explorer can provide a forecast, by predicting how much we will use AWS services over time based on the past usage patterns. For example, selecting 12 months, we get:
What about changes?
Of course this is assuming no drastic changes, but fortunately some of our services are marked for retirement/replacement during the next year, and the teams plan to do some usage optimization too.. To understand the impact of those plans in the infrastructure cost, and inform if a task prioritization review is needed to meet our budget goals, we can look at the current and future cost.
For example, by doing a filter by accounts for a particular service, we are able to estimate an average cost for the next year
We know from previous months, that this particular application environment cost can be split equally between production and non-production environments. This will be useful for the following steps.
Next we need to look at cost optimization - for this example we took into consideration a couple of impactful database queries optimizations, which we expect will result in a mitigation of auto scaling events during peak times in this cluster.. and looking at the last months, we know the extra on-demand read instance costs on average $1254.87/month.
Similarly the teams are working on use cases migrations - for this example, we will use a migration of a legacy data store in Elastic Search to S3 - this will help reduce our infrastructure cost, with the deletion of this ES Cluster. Using the AWS Pricing Calculator, we can estimate how much it is costing, by looking at its configuration (instances, storage, etc).
If we compile these numbers.. and propose these changes in the following quarters..
Initiative | Monthly Cost | Proposed Quarter (by the end of) |
---|---|---|
Legacy Application #1 Non-Production | $2,210 | Q1 |
Legacy Application #1 Production | $2,537 | Q2 |
SQL Queries Optimization | $1,254.87 | Q1 |
Legacy Elastic Search retirement | $6,670.56 | Q2 |
Legacy Application #2 | $6,944.13 | Q3 |
Now with the CSV data export from AWS Cost Explorer, the proposed changes and the help of our favorite spreadsheet tool, we can do some data import and calculations to draft the different costs and costs trends - and visualize the per month impact of the proposed plan:
We can (and should) take other factors into consideration and adjust estimations - e.g. if a team is launching a new product/feature, we can make use of AWS Pricing Calculator, or a cost growth based on current metrics-cost, to estimate costs...
Hopefully you get the idea - Cost Explorer and AWS Pricing Calculator are great free tools to support these (and similar) exercises, even when your insight and tagging of the cloud infrastructure is less than perfect.
As for us, we will have improved tagging in place next year, and will be able to perform better cost monitoring and fine-grained estimations for prioritization and budgets.
Top comments (0)