The AWS Pricing Calculator - An ultra-low-cost product. How to save every penny?

FabianLober1 157 views 26 slides Oct 20, 2022
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

The AWS Pricing Calculator is a tool many of us know and use in our daily business.
Some may love it, and some hate it, but have you ever looked behind the shiny front?
We will dive deep into what we reversed-engineered and show how it is designed and built.
We will answer the question: Why was this...


Slide Content

1
The AWS Pricing Calculator
An ultra-low-cost product. How to save every penny?


@ AWS Community Day 2022


Fabian Lober
Team Lead SA DACH
AllCloud

2
Who doesn’t knows it?

3
Who hasn’t used it?

4
How is your technical level?

AWS Pricing Calculator
What is it?
5
●Free web-based planning tool

●Create estimates for AWS use cases

●Share and export estimates

●Includes ~150 services but not all

●Successor of the Simple Monthly Calc

6
AWS Pricing Calculator
How does it work?*
* maybe

7
AWS Pricing Calculator
How does it work?*
* hopefully

8
AWS Pricing Calculator

9
AWS Pricing Calculator
How does it work?*
* perhaps

10
AWS Pricing Calculator
How does it work?*
* fore sure
●Includes all Data
Transfer prices

●One global file

●Includes all EBS prices


●One global file

●Selection of main
categories

●File per Region

●All EC2 Instances with
prices

●File for every
combination of the
main category

11
AWS Pricing Calculator
How does it work?*
* possibly
Operating System Tenancy
Pricing Model
Reservation Period
Payment OptionsOffering Class
Generation
License Model
Pre-Installed SW
Location
Instance Family vCPU / Memory
On-Demand
Shared
Dedicated
Reserved

3yrs
SQL Ent
12
AWS Pricing Calculator
How does it work?*
* for all we know
Operating System Tenancy
Pricing Model
Reservation Period
Payment OptionsOffering Class
Generation
License Model
Pre-Installed SW
Location
Instance Family
Reserved
vCPU / Memory
Dedicated
On-Demand
Shared
Convertible
Standard
Linux
Windows
RHEL
SUSE
1yr
SQL Web
SQL Std
NA
NA
No Upfront
…..
BYOL
No License
Partial Upfront
Memory
……
All Upfront
Compute
General Purpose
us-east-1
eu-west-1
eu-central-1
172.534 combinations, only for eu-central-1!

13
AWS Pricing Calculator
How does it work?*
* for all we know
c5.xlarge
● Linux

●Tenancy Shared

● On-Demand



141.62$/Month
c5.xlarge
●Linux

●Tenancy Shared

●1yr Reserved No-Upfront



89.06$/Month

c5.xlarge
●Windows Server 2019

●Tenancy Shared

●1yr Reserved No-Upfront



223.38$/Month

14
AWS Pricing Calculator
How does it work?*
* hopefully
primary-selector-aggregations.json
●Contains all 690 main combinations

●No Instance details included

●Further used to build the subsequent
requests

15
AWS Pricing Calculator
How does it work?*
* perhaps
[...]/{Region}/{TermType}/{Tenancy}/{OS}/{PreInstalledSW}/{LicenseModel}/{LeaseContractLength}/{PurchaseOption}/{Off
eringClass}/{CurrentGeneration}/index.json
"selectors": {
"TermType": "Reserved",
"Tenancy": "Dedicated",
"Operating System" : "Linux",
"Pre Installed S/W" : "NA",
"License Model": "No License required" ,
"LeaseContractLength" : "3yr",
"PurchaseOption": "Partial Upfront" ,
"OfferingClass": "convertible",
"Current Generation" : "Yes"
}
[...]/EU (Frankfurt)/Reserved/Dedicated/Linux/NA/No License required/3yr/Partial Upfront/convertible/Yes/index.json
For every combination

16
AWS Pricing Calculator
How does it work?*
* maybe
index.json
●Response with Instance details and price

●Available per Region and OS

●Can be used for further processing

17
AWS Pricing Calculator

18
AWS Pricing Calculator
How does it work?*
* for sure
Calculation Data
●Build together locally and used for display

●Contains groups, services, metadata, prices,
totals, and more

●The only correct & nice JSON

19
AWS Pricing Calculator
How does it work?*
* perhaps

20
AWS Pricing Calculator
How does it work?
Public and no OAIWhy is this bad?

21
How?
●Every connection over CloudFront

●Everything stored in S3

●Offload all compute to the Users

●New files are cheaper than updates


AWS Pricing Calculator
Why does it work like this?*
Why?
●Costs, Costs, Costs and Costs

●Probably millions of requests

* what a stupid question
??????

22
AWS Pricing Calculator
Why does it work like this?
Assumptions
●1.000.000 requests per hour
○420 Users can call fifty times EC2

●Every API Call goes to Lambda

●1GB data and 75% cache hits in the DB

●10% save their calculations
○Average size 75 kB

2856%

AWS Pricing Calculator
Why does it work like this?
23
Pricing Calculation

24
AWS Pricing Calculator
(Fun) Facts
Naming Mismatches

●1yr vs. 1 Year

●OnDemand vs. On-Demand vs On Demand

●NA vs. N/A vs. empty Value

●EU (Frankfurt) vs. eu-central-1
●A badly pieced together software

●No standard, every service is different

●If you miss key “version” for c5.* its empty
○For all others it’s working without

25
Can you imagine how many files must be
in this bucket?

26


Thank You!


Fabian Lober <[email protected]>
Team Lead SA DACH
Tags