amazon-pricing 0.1.140 → 0.1.141
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +0 -7
- data/lib/amazon-pricing.rb +0 -1
- data/lib/amazon-pricing/definitions/ec2-instance-type.rb +2 -320
- data/lib/amazon-pricing/version.rb +1 -1
- metadata +2 -5
- data/lib/amazon-pricing/ec2-dhi-price-list.rb +0 -107
- data/spec/lib/amazon-pricing/ec2_dhi_pricing_spec.rb +0 -37
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjU5NTVhZjFmYTFjYWFhODhjYjdkY2ZmNDdlMTA0NjFhNjk5YWE4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjZiNzAyMTMyZDgyZmYzY2NmOTI2MWM0YjVmYWQyNzQ3NzEzODIyOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmVmY2IyYjU4YmU1MWViN2QzMjAyOWViMzcxYTg4ZDZjNWRkYmRlZjc1ZjAw
|
10
|
+
NTJlMThmYmM1YzQ0Mjc0MGM5OTI4NTZhODVkZjA3ZDFkZTk0YzNhOTk0YWVm
|
11
|
+
ZDYzNTExYzY0ZTAzZWFlMTZlNzM4ZjRlMjFkMTM3NTNhZjBiNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjA5NWNiNThmNjk0NjJiZjFjODhmMjg0NmFkNGRhNzk1NDkwYTQxZWQ5YmIw
|
14
|
+
YjQyOGU4MTg3NTViYjRiZDg2YTA1NWU5NWQzYWEzMTVmYzU0MDEwMDRmYTJi
|
15
|
+
YjFlZWIzYWZjZWYzMjRlODE3ZDFiYTZmYWFmMDE0Njk3NjhiNDE=
|
data/Rakefile
CHANGED
@@ -41,13 +41,6 @@ task :print_ec2_di_price_list do
|
|
41
41
|
print_ec2_table(pricing)
|
42
42
|
end
|
43
43
|
|
44
|
-
desc "Prints current EC2 Dedicated Host Instance pricing in CSV format"
|
45
|
-
task :print_ec2_dhi_price_list do
|
46
|
-
require 'amazon-pricing'
|
47
|
-
pricing = AwsPricing::Ec2DedicatedHostInstancePriceList.new
|
48
|
-
print_ec2_table(pricing)
|
49
|
-
end
|
50
|
-
|
51
44
|
desc "Prints current EC2 Dedicated Host pricing in CSV format"
|
52
45
|
task :print_ec2_dh_price_list do
|
53
46
|
require 'amazon-pricing'
|
data/lib/amazon-pricing.rb
CHANGED
@@ -8,7 +8,6 @@ require 'amazon-pricing/common/ec2_common'
|
|
8
8
|
require 'amazon-pricing/aws-price-list'
|
9
9
|
require 'amazon-pricing/ec2-price-list'
|
10
10
|
require 'amazon-pricing/ec2-di-price-list'
|
11
|
-
require 'amazon-pricing/ec2-dhi-price-list'
|
12
11
|
require 'amazon-pricing/ec2-dh-price-list'
|
13
12
|
require 'amazon-pricing/rds-price-list'
|
14
13
|
require 'amazon-pricing/dynamo-db-price-list'
|
@@ -8,8 +8,8 @@ module AwsPricing
|
|
8
8
|
def get_operating_system(type)
|
9
9
|
get_category_type(type)
|
10
10
|
end
|
11
|
-
|
12
|
-
# Returns whether an instance_type is available.
|
11
|
+
|
12
|
+
# Returns whether an instance_type is available.
|
13
13
|
# operating_system = :linux, :mswin, :rhel, :sles, :mswinSQL, :mswinSQLWeb
|
14
14
|
# type_of_instance = :ondemand, :light, :medium, :heavy
|
15
15
|
def available?(type_of_instance = :ondemand, operating_system = :linux)
|
@@ -90,22 +90,6 @@ module AwsPricing
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
# operating_system = :linux, :mswin, :rhel, :sles, :mswinSQL, :mswinSQLWeb
|
94
|
-
# dhprice is a string representing the price per hour for the Dedicated Host
|
95
|
-
# capacity is the number of this type of instancess supported on this Dedicated Host
|
96
|
-
def update_dhi_pricing(operating_system, dhprice, capacity)
|
97
|
-
os = get_category_type(operating_system)
|
98
|
-
if os.nil?
|
99
|
-
os = OperatingSystem.new(self, operating_system)
|
100
|
-
@category_types[operating_system] = os
|
101
|
-
end
|
102
|
-
|
103
|
-
category = operating_system.to_s
|
104
|
-
values = { category => dhprice }
|
105
|
-
price = coerce_price(values[category])
|
106
|
-
os.set_price_per_hour(:ondemand, nil, price/capacity)
|
107
|
-
end
|
108
|
-
|
109
93
|
def update_pricing2(operating_system, res_type, ondemand_pph = nil, year1_prepay = nil, year3_prepay = nil, year1_pph = nil, year3_pph = nil)
|
110
94
|
|
111
95
|
os = get_category_type(operating_system)
|
@@ -126,15 +110,6 @@ module AwsPricing
|
|
126
110
|
@category_types
|
127
111
|
end
|
128
112
|
|
129
|
-
# aws does not provide any json-sourced network_capacity, so for now we provide this hardcoded lookup
|
130
|
-
# see https://aws.amazon.com/ec2/instance-types/, under 'Instance Types Matrix', under 'Networking Performance'
|
131
|
-
def self.get_network_capacity(api_name)
|
132
|
-
throughput = @Network_Performance[api_name]
|
133
|
-
if not throughput
|
134
|
-
$stderr.puts "Unknown network throughput for instance type #{api_name}"
|
135
|
-
end
|
136
|
-
throughput
|
137
|
-
end
|
138
113
|
def self.get_network_mbps(throughput)
|
139
114
|
network_mbps = @Network_Throughput_MBits_Per_Second[throughput]
|
140
115
|
if not network_mbps
|
@@ -207,298 +182,5 @@ module AwsPricing
|
|
207
182
|
'100 Gigabit' => :one_hundred_gigabit
|
208
183
|
}
|
209
184
|
|
210
|
-
# handy summary here: www.ec2instances.info
|
211
|
-
@Network_Performance = {
|
212
|
-
'a1.medium' => :ten_gigabit, # up to 10G
|
213
|
-
'a1.large' => :ten_gigabit, # up to 10G
|
214
|
-
'a1.xlarge' => :ten_gigabit, # up to 10G
|
215
|
-
'a1.2xlarge' => :ten_gigabit, # up to 10G
|
216
|
-
'a1.4xlarge' => :ten_gigabit, # up to 10G
|
217
|
-
'c1.medium' => :moderate,
|
218
|
-
'c1.xlarge' => :high,
|
219
|
-
'c3.2xlarge' => :high,
|
220
|
-
'c3.4xlarge' => :high,
|
221
|
-
'c3.8xlarge' => :ten_gigabit,
|
222
|
-
'c3.large' => :moderate,
|
223
|
-
'c3.xlarge' => :moderate,
|
224
|
-
'c4.2xlarge' => :high,
|
225
|
-
'c4.4xlarge' => :high,
|
226
|
-
'c4.8xlarge' => :ten_gigabit,
|
227
|
-
'c4.large' => :moderate,
|
228
|
-
'c4.xlarge' => :high,
|
229
|
-
'c5.18xlarge' => :twentyfive_gigabit,
|
230
|
-
'c5.2xlarge' => :ten_gigabit, # upto 10G
|
231
|
-
'c5.4xlarge' => :ten_gigabit, # upto 10G
|
232
|
-
'c5.9xlarge' => :ten_gigabit,
|
233
|
-
'c5.large' => :ten_gigabit, # upto 10G
|
234
|
-
'c5.xlarge' => :ten_gigabit, # upto 10G
|
235
|
-
'c5d.18xlarge' => :twentyfive_gigabit,
|
236
|
-
'c5d.2xlarge' => :ten_gigabit, # upto 10G
|
237
|
-
'c5d.4xlarge' => :ten_gigabit, # upto 10G
|
238
|
-
'c5d.9xlarge' => :ten_gigabit,
|
239
|
-
'c5d.large' => :ten_gigabit, # upto 10G
|
240
|
-
'c5d.xlarge' => :ten_gigabit, # upto 10G
|
241
|
-
'c5n.large' => :twentyfive_gigabit, # up to 25gb
|
242
|
-
'c5n.xlarge' => :twentyfive_gigabit, # up to 25gb
|
243
|
-
'c5n.2xlarge' => :twentyfive_gigabit, # up to 25gb
|
244
|
-
'c5n.4xlarge' => :twentyfive_gigabit, # up to 25gb
|
245
|
-
'c5n.9xlarge' => :fifty_gigabit,
|
246
|
-
'c5n.18xlarge' => :one_hundred_gigabit,
|
247
|
-
'cache.c1.xlarge' => :high,
|
248
|
-
'cache.m1.large' => :moderate,
|
249
|
-
'cache.m1.medium' => :moderate,
|
250
|
-
'cache.m1.small' => :low,
|
251
|
-
'cache.m1.xlarge' => :high,
|
252
|
-
'cache.m2.2xlarge' => :moderate,
|
253
|
-
'cache.m2.4xlarge' => :high,
|
254
|
-
'cache.m2.xlarge' => :moderate,
|
255
|
-
'cache.m3.2xlarge' => :high,
|
256
|
-
'cache.m3.large' => :moderate,
|
257
|
-
'cache.m3.medium' => :moderate,
|
258
|
-
'cache.m3.xlarge' => :high,
|
259
|
-
'cache.m4.large' => :moderate,
|
260
|
-
'cache.m4.xlarge' => :high,
|
261
|
-
'cache.m4.2xlarge' => :high,
|
262
|
-
'cache.m4.4xlarge' => :high,
|
263
|
-
'cache.m4.10xlarge' => :ten_gigabit,
|
264
|
-
'cache.r3.2xlarge' => :high,
|
265
|
-
'cache.r3.4xlarge' => :high,
|
266
|
-
'cache.r3.8xlarge' => :ten_gigabit,
|
267
|
-
'cache.r3.large' => :moderate,
|
268
|
-
'cache.r3.xlarge' => :moderate,
|
269
|
-
'cache.r4.16xlarge' => :twentyfive_gigabit,
|
270
|
-
'cache.r4.2xlarge' => :ten_gigabit, # upto 10G
|
271
|
-
'cache.r4.4xlarge' => :ten_gigabit, # upto 10G
|
272
|
-
'cache.r4.8xlarge' => :ten_gigabit,
|
273
|
-
'cache.r4.large' => :ten_gigabit, # upto 10G
|
274
|
-
'cache.r4.xlarge' => :ten_gigabit, # upto 10G
|
275
|
-
'cache.x1.16xlarge' => :ten_gigabit,
|
276
|
-
'cache.x1.32xlarge' => :ten_gigabit,
|
277
|
-
'cache.t1.micro' => :very_low,
|
278
|
-
'cache.t2.medium' => :low_to_moderate,
|
279
|
-
'cache.t2.micro' => :low_to_moderate,
|
280
|
-
'cache.t2.small' => :low_to_moderate,
|
281
|
-
'cc1.4xlarge' => :ten_gigabit,
|
282
|
-
'cc2.8xlarge' => :ten_gigabit,
|
283
|
-
'cg1.4xlarge' => :ten_gigabit,
|
284
|
-
'cr1.8xlarge' => :ten_gigabit,
|
285
|
-
'd2.2xlarge' => :high,
|
286
|
-
'd2.4xlarge' => :high,
|
287
|
-
'd2.8xlarge' => :ten_gigabit,
|
288
|
-
'd2.xlarge' => :moderate,
|
289
|
-
'db.cr1.8xlarge' => :ten_gigabit,
|
290
|
-
'db.m1.large' => :moderate,
|
291
|
-
'db.m1.medium' => :moderate,
|
292
|
-
'db.m1.small' => :low,
|
293
|
-
'db.m1.xlarge' => :high,
|
294
|
-
'db.m2.2xlarge' => :moderate,
|
295
|
-
'db.m2.4xlarge' => :high,
|
296
|
-
'db.m2.xlarge' => :moderate,
|
297
|
-
'db.m3.2xlarge' => :high,
|
298
|
-
'db.m3.large' => :moderate,
|
299
|
-
'db.m3.medium' => :moderate,
|
300
|
-
'db.m3.xlarge' => :high,
|
301
|
-
'db.m4.10xlarge' => :ten_gigabit,
|
302
|
-
'db.m4.2xlarge' => :high,
|
303
|
-
'db.m4.4xlarge' => :high,
|
304
|
-
'db.m4.large' => :moderate,
|
305
|
-
'db.m4.xlarge' => :high,
|
306
|
-
'db.m4.16xlarge' => :twentyfive_gigabit,
|
307
|
-
'db.r3.2xlarge' => :high,
|
308
|
-
'db.r3.4xlarge' => :high,
|
309
|
-
'db.r3.8xlarge' => :ten_gigabit,
|
310
|
-
'db.r3.large' => :moderate,
|
311
|
-
'db.r3.xlarge' => :moderate,
|
312
|
-
'db.r4.large' => :ten_gigabit,
|
313
|
-
'db.r4.xlarge' => :ten_gigabit,
|
314
|
-
'db.r4.2xlarge' => :ten_gigabit,
|
315
|
-
'db.r4.4xlarge' => :ten_gigabit,
|
316
|
-
'db.r4.8xlarge' => :ten_gigabit,
|
317
|
-
'db.r4.16xlarge' => :twentyfive_gigabit,
|
318
|
-
'db.r5.large' => :ten_gigabit,
|
319
|
-
'db.r5.xlarge' => :ten_gigabit,
|
320
|
-
'db.r5.2xlarge' => :ten_gigabit,
|
321
|
-
'db.r5.4xlarge' => :ten_gigabit,
|
322
|
-
'db.r5.12xlarge' => :ten_gigabit,
|
323
|
-
'db.r5.24xlarge' => :twentyfive_gigabit,
|
324
|
-
'db.t1.micro' => :very_low,
|
325
|
-
'db.t2.large' => :low_to_moderate,
|
326
|
-
'db.t2.medium' => :low_to_moderate,
|
327
|
-
'db.t2.micro' => :low,
|
328
|
-
'db.t2.small' => :low_to_moderate,
|
329
|
-
'db.t2.xlarge' => :moderate,
|
330
|
-
'db.t2.2xlarge' => :moderate,
|
331
|
-
'db.t3.micro' => :low_to_moderate,
|
332
|
-
'db.t3.small' => :low_to_moderate,
|
333
|
-
'db.t3.medium' => :low_to_moderate,
|
334
|
-
'db.t3.large' => :low_to_moderate,
|
335
|
-
'db.t3.xlarge' => :moderate,
|
336
|
-
'db.t3.2xlarge' => :moderate,
|
337
|
-
'db.x1.16xlarge' => :ten_gigabit,
|
338
|
-
'db.x1.32xlarge' => :ten_gigabit,
|
339
|
-
'f1.2xlarge' => :high,
|
340
|
-
'f1.4xlarge' => :high,
|
341
|
-
'f1.16xlarge' => :twentyfive_gigabit,
|
342
|
-
'g2.2xlarge' => :high,
|
343
|
-
'g2.8xlarge' => :ten_gigabit,
|
344
|
-
'g3.4xlarge' => :ten_gigabit,
|
345
|
-
'g3.8xlarge' => :ten_gigabit,
|
346
|
-
'g3.16xlarge' => :twenty_gigabit,
|
347
|
-
'g3s.xlarge' => :ten_gigabit,
|
348
|
-
'h1.2xlarge' => :ten_gigabit, # upto 10G
|
349
|
-
'h1.4xlarge' => :ten_gigabit, # upto 10G
|
350
|
-
'h1.8xlarge' => :ten_gigabit,
|
351
|
-
'h1.16xlarge' => :twentyfive_gigabit,
|
352
|
-
'hi1.4xlarge' => :ten_gigabit,
|
353
|
-
'hs1.8xlarge' => :ten_gigabit,
|
354
|
-
'i2.2xlarge' => :high,
|
355
|
-
'i2.4xlarge' => :high,
|
356
|
-
'i2.8xlarge' => :ten_gigabit,
|
357
|
-
'i2.xlarge' => :moderate,
|
358
|
-
'i3.16xlarge' => :twentyfive_gigabit,
|
359
|
-
'i3.2xlarge' => :ten_gigabit,
|
360
|
-
'i3.4xlarge' => :ten_gigabit,
|
361
|
-
'i3.8xlarge' => :ten_gigabit,
|
362
|
-
'i3.large' => :ten_gigabit,
|
363
|
-
'i3.metal' => :twentyfive_gigabit,
|
364
|
-
'i3p.16xlarge' => :twentyfive_gigabit,
|
365
|
-
'i3.xlarge' => :ten_gigabit,
|
366
|
-
'i3en.large'=> :twentyfive_gigabit,
|
367
|
-
'i3en.xlarge'=> :twentyfive_gigabit,
|
368
|
-
'i3en.2xlarge'=> :twentyfive_gigabit,
|
369
|
-
'i3en.3xlarge'=> :twentyfive_gigabit,
|
370
|
-
'i3en.6xlarge'=> :twentyfive_gigabit,
|
371
|
-
'i3en.12xlarge'=> :fifty_gigabit,
|
372
|
-
'i3en.24xlarge'=> :one_hundred_gigabit,
|
373
|
-
'm1.large' => :moderate,
|
374
|
-
'm1.medium' => :moderate,
|
375
|
-
'm1.small' => :low,
|
376
|
-
'm1.xlarge' => :high,
|
377
|
-
'm2.2xlarge' => :moderate,
|
378
|
-
'm2.4xlarge' => :high,
|
379
|
-
'm2.xlarge' => :moderate,
|
380
|
-
'm3.2xlarge' => :high,
|
381
|
-
'm3.large' => :moderate,
|
382
|
-
'm3.medium' => :moderate,
|
383
|
-
'm3.xlarge' => :high,
|
384
|
-
'm4.16xlarge' => :twentyfive_gigabit,
|
385
|
-
'm4.10xlarge' => :ten_gigabit,
|
386
|
-
'm4.2xlarge' => :high,
|
387
|
-
'm4.4xlarge' => :high,
|
388
|
-
'm4.large' => :moderate,
|
389
|
-
'm4.xlarge' => :high,
|
390
|
-
'm5.large' => :ten_gigabit, # upto 10G
|
391
|
-
'm5.xlarge' => :ten_gigabit, # upto 10G
|
392
|
-
'm5.2xlarge' => :ten_gigabit, # upto 10G
|
393
|
-
'm5.4xlarge' => :ten_gigabit, # upto 10G
|
394
|
-
'm5.12xlarge' => :ten_gigabit,
|
395
|
-
'm5.24xlarge' => :twentyfive_gigabit,
|
396
|
-
'm5.metal' => :twentyfive_gigabit,
|
397
|
-
'm5d.large' => :ten_gigabit, # upto 10G
|
398
|
-
'm5d.xlarge' => :ten_gigabit, # upto 10G
|
399
|
-
'm5d.2xlarge' => :ten_gigabit, # upto 10G
|
400
|
-
'm5d.4xlarge' => :ten_gigabit, # upto 10G
|
401
|
-
'm5d.12xlarge' => :ten_gigabit,
|
402
|
-
'm5d.24xlarge' => :twentyfive_gigabit,
|
403
|
-
'm5d.metal' => :twentyfive_gigabit,
|
404
|
-
'm5a.large' => :ten_gigabit, # upto 10G
|
405
|
-
'm5a.xlarge' => :ten_gigabit, # upto 10G
|
406
|
-
'm5a.2xlarge' => :ten_gigabit, # upto 10G
|
407
|
-
'm5a.4xlarge' => :ten_gigabit, # upto 10G
|
408
|
-
'm5a.12xlarge' => :ten_gigabit,
|
409
|
-
'm5a.24xlarge' => :twenty_gigabit,
|
410
|
-
'm5ad.large' => :ten_gigabit, # upto 10G
|
411
|
-
'm5ad.xlarge' => :ten_gigabit, # upto 10G
|
412
|
-
'm5ad.2xlarge' => :ten_gigabit, # upto 10G
|
413
|
-
'm5ad.4xlarge' => :ten_gigabit, # upto 10G
|
414
|
-
'm5ad.12xlarge' => :ten_gigabit,
|
415
|
-
'm5ad.24xlarge' => :twenty_gigabit,
|
416
|
-
'p2.xlarge' => :high,
|
417
|
-
'p2.8xlarge' => :ten_gigabit,
|
418
|
-
'p2.16xlarge' => :twenty_gigabit,
|
419
|
-
'p3.2xlarge' => :ten_gigabit,
|
420
|
-
'p3.8xlarge' => :ten_gigabit,
|
421
|
-
'p3.16xlarge' => :twentyfive_gigabit,
|
422
|
-
'p3dn.24xlarge' => :one_hundred_gigabit,
|
423
|
-
'r3.2xlarge' => :high,
|
424
|
-
'r3.4xlarge' => :high,
|
425
|
-
'r3.8xlarge' => :ten_gigabit,
|
426
|
-
'r3.large' => :moderate,
|
427
|
-
'r3.xlarge' => :moderate,
|
428
|
-
'r4.16xlarge' => :twentyfive_gigabit,
|
429
|
-
'r4.2xlarge' => :ten_gigabit,
|
430
|
-
'r4.4xlarge' => :ten_gigabit,
|
431
|
-
'r4.8xlarge' => :ten_gigabit,
|
432
|
-
'r4.large' => :ten_gigabit,
|
433
|
-
'r4.xlarge' => :ten_gigabit,
|
434
|
-
'r5.large' => :ten_gigabit, # upto 10G
|
435
|
-
'r5.xlarge' => :ten_gigabit, # upto 10G
|
436
|
-
'r5.2xlarge' => :ten_gigabit, # upto 10G
|
437
|
-
'r5.4xlarge' => :ten_gigabit, # upto 10G
|
438
|
-
'r5.12xlarge' => :ten_gigabit,
|
439
|
-
'r5.24xlarge' => :twentyfive_gigabit,
|
440
|
-
'r5.metal' => :twentyfive_gigabit,
|
441
|
-
'r5d.large' => :ten_gigabit, # upto 10G
|
442
|
-
'r5d.xlarge' => :ten_gigabit, # upto 10G
|
443
|
-
'r5d.2xlarge' => :ten_gigabit, # upto 10G
|
444
|
-
'r5d.4xlarge' => :ten_gigabit, # upto 10G
|
445
|
-
'r5d.12xlarge' => :ten_gigabit,
|
446
|
-
'r5d.24xlarge' => :twentyfive_gigabit,
|
447
|
-
'r5d.metal' => :twentyfive_gigabit,
|
448
|
-
'r5a.large' => :ten_gigabit, # upto 10G
|
449
|
-
'r5a.xlarge' => :ten_gigabit, # upto 10G
|
450
|
-
'r5a.2xlarge' => :ten_gigabit, # upto 10G
|
451
|
-
'r5a.4xlarge' => :ten_gigabit, # upto 10G
|
452
|
-
'r5a.12xlarge' => :ten_gigabit,
|
453
|
-
'r5a.24xlarge' => :twenty_gigabit,
|
454
|
-
'r5ad.large' => :ten_gigabit, # upto 10G
|
455
|
-
'r5ad.xlarge' => :ten_gigabit, # upto 10G
|
456
|
-
'r5ad.2xlarge' => :ten_gigabit, # upto 10G
|
457
|
-
'r5ad.4xlarge' => :ten_gigabit, # upto 10G
|
458
|
-
'r5ad.12xlarge' => :ten_gigabit,
|
459
|
-
'r5ad.24xlarge' => :twenty_gigabit,
|
460
|
-
't1.micro' => :very_low,
|
461
|
-
't2.large' => :low_to_moderate,
|
462
|
-
't2.medium' => :low_to_moderate,
|
463
|
-
't2.micro' => :low_to_moderate,
|
464
|
-
't2.nano' => :low,
|
465
|
-
't2.small' => :low_to_moderate,
|
466
|
-
't2.xlarge' => :moderate, # same as c4.2xlarge, cf:https://aws.amazon.com/blogs/aws/new-t2-xlarge-and-t2-2xlarge-instances/
|
467
|
-
't2.2xlarge' => :moderate, # same as m4.xlarge, cf:https://aws.amazon.com/blogs/aws/new-t2-xlarge-and-t2-2xlarge-instances/
|
468
|
-
't3.nano' => :low,
|
469
|
-
't3.micro' => :low_to_moderate,
|
470
|
-
't3.small' => :low_to_moderate,
|
471
|
-
't3.medium' => :low_to_moderate,
|
472
|
-
't3.large' => :low_to_moderate,
|
473
|
-
't3.xlarge' => :moderate,
|
474
|
-
't3.2xlarge' => :moderate,
|
475
|
-
't3a.nano' => :low_to_moderate,
|
476
|
-
't3a.micro' => :low_to_moderate,
|
477
|
-
't3a.small' => :low_to_moderate,
|
478
|
-
't3a.medium' => :low_to_moderate,
|
479
|
-
't3a.large' => :low_to_moderate,
|
480
|
-
't3a.xlarge' => :low_to_moderate,
|
481
|
-
't3a.2xlarge' => :low_to_moderate,
|
482
|
-
'x1.16xlarge' => :ten_gigabit,
|
483
|
-
'x1.32xlarge' => :twenty_gigabit,
|
484
|
-
'x1e.16xlarge' => :ten_gigabit,
|
485
|
-
'x1e.2xlarge' => :ten_gigabit, # upto 10G
|
486
|
-
'x1e.32xlarge' => :twentyfive_gigabit,
|
487
|
-
'x1e.4xlarge' => :ten_gigabit, # upto 10G
|
488
|
-
'x1e.8xlarge' => :ten_gigabit, # upto 10G
|
489
|
-
'x1e.xlarge' => :ten_gigabit, # upto 10G
|
490
|
-
'z1d.large' => :ten_gigabit, # upto 10G
|
491
|
-
'z1d.xlarge' => :ten_gigabit, # upto 10G
|
492
|
-
'z1d.2xlarge' => :ten_gigabit, # upto 10G
|
493
|
-
'z1d.3xlarge' => :ten_gigabit, # upto 10G
|
494
|
-
'z1d.6xlarge' => :ten_gigabit,
|
495
|
-
'z1d.12xlarge' => :twentyfive_gigabit,
|
496
|
-
'z1d.metal' => :twentyfive_gigabit,
|
497
|
-
'u-6tb1.metal' => :twentyfive_gigabit,
|
498
|
-
'u-9tb1.metal' => :twentyfive_gigabit,
|
499
|
-
'u-12tb1.metal' => :twentyfive_gigabit,
|
500
|
-
}
|
501
|
-
|
502
185
|
end
|
503
|
-
|
504
186
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-pricing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.141
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Kinsella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
14
14
|
email:
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- lib/amazon-pricing/definitions/region.rb
|
51
51
|
- lib/amazon-pricing/dynamo-db-price-list.rb
|
52
52
|
- lib/amazon-pricing/ec2-dh-price-list.rb
|
53
|
-
- lib/amazon-pricing/ec2-dhi-price-list.rb
|
54
53
|
- lib/amazon-pricing/ec2-di-price-list.rb
|
55
54
|
- lib/amazon-pricing/ec2-price-list.rb
|
56
55
|
- lib/amazon-pricing/elasticache-price-list.rb
|
@@ -59,7 +58,6 @@ files:
|
|
59
58
|
- lib/amazon-pricing/version.rb
|
60
59
|
- spec/lib/amazon-pricing/definitions/database-type_spec.rb
|
61
60
|
- spec/lib/amazon-pricing/ec2_dh_pricing_spec.rb
|
62
|
-
- spec/lib/amazon-pricing/ec2_dhi_pricing_spec.rb
|
63
61
|
- spec/lib/amazon-pricing/elasticache_pricing_spec.rb
|
64
62
|
- spec/lib/amazon-pricing/helpers/instance-type-spec.rb
|
65
63
|
- spec/lib/amazon-pricing/rds_pricing_spec.rb
|
@@ -99,7 +97,6 @@ summary: Amazon Web Services Pricing Ruby gem
|
|
99
97
|
test_files:
|
100
98
|
- spec/lib/amazon-pricing/definitions/database-type_spec.rb
|
101
99
|
- spec/lib/amazon-pricing/ec2_dh_pricing_spec.rb
|
102
|
-
- spec/lib/amazon-pricing/ec2_dhi_pricing_spec.rb
|
103
100
|
- spec/lib/amazon-pricing/elasticache_pricing_spec.rb
|
104
101
|
- spec/lib/amazon-pricing/helpers/instance-type-spec.rb
|
105
102
|
- spec/lib/amazon-pricing/rds_pricing_spec.rb
|
@@ -1,107 +0,0 @@
|
|
1
|
-
module AwsPricing
|
2
|
-
class Ec2DedicatedHostInstancePriceList < PriceList
|
3
|
-
include AwsPricing::Ec2Common
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
super
|
7
|
-
InstanceType.populate_lookups
|
8
|
-
get_ec2_dhi_od_pricing
|
9
|
-
end
|
10
|
-
|
11
|
-
def os_types
|
12
|
-
@@OS_TYPES
|
13
|
-
end
|
14
|
-
|
15
|
-
protected
|
16
|
-
|
17
|
-
@@OS_TYPES = [ 'linux', 'rhel', 'sles', 'mswin',
|
18
|
-
'mswinSQL', 'mswinSQLWeb', 'mswinSQLEnterprise',
|
19
|
-
'linuxSQL', 'linuxSQLWeb', 'linuxSQLEnterprise',
|
20
|
-
]
|
21
|
-
|
22
|
-
@@CAPACITY_HASH = { # number of instances a host can run, by definition largest size can only run one instance/host
|
23
|
-
'a1' => {"medium" =>16, "large"=>8, "xlarge"=>4, "2xlarge"=>2, "4xlarge"=>1},
|
24
|
-
'c3' => { "large"=>16, "xlarge"=>8, "2xlarge"=>4, "4xlarge"=>2, "8xlarge"=>1 },
|
25
|
-
'c4' => { "large"=>16, "xlarge"=>8, "2xlarge"=>4, "4xlarge"=>2, "8xlarge"=>1 },
|
26
|
-
'c5' => { "large"=>36, "xlarge"=>18, "2xlarge"=>8, "4xlarge"=>4,"9xlarge"=>2, "18xlarge"=>1 },
|
27
|
-
'c5d' => { "large"=>36, "xlarge"=>18, "2xlarge"=>8, "4xlarge"=>4,"9xlarge"=>2, "18xlarge"=>1 },
|
28
|
-
'c5n' => { "large"=>36, "xlarge"=>18, "2xlarge"=>8, "4xlarge"=>4, "9xlarge"=>2, "18xlarge" =>1 },
|
29
|
-
'p2' => { "xlarge"=>16, "8xlarge"=>2, "16xlarge"=>1 },
|
30
|
-
'p3' => { "2xlarge"=>8, "8xlarge"=>2, "16xlarge"=>1 },
|
31
|
-
'p3dn' => { "24xlarge"=>1 },
|
32
|
-
'g2' => { "2xlarge"=>4, "8xlarge"=>1 },
|
33
|
-
'g3' => { "4xlarge"=>4, "8xlarge"=>2, "16xlarge"=>1 },
|
34
|
-
'g3s' => { "xlarge" => 1},
|
35
|
-
'f1' => { "2xlarge"=>8, "4xlarge"=>4, "16xlarge" =>1 },
|
36
|
-
'm3' => { "medium"=>32, "large"=>16, "xlarge"=>8, "2xlarge"=>4 },
|
37
|
-
'd2' => { "xlarge"=>8, "2xlarge"=>4, "4xlarge"=>2, "8xlarge"=>1 },
|
38
|
-
'h1' => { "2xlarge"=>8, "4xlarge"=>4, "8xlarge"=>2, "16xlarge"=>1 },
|
39
|
-
'r3' => { "large"=>16, "xlarge"=>8, "2xlarge"=>4, "4xlarge"=>2, "8xlarge"=>1 },
|
40
|
-
'r4' => { "large"=>32, "xlarge"=>16, "2xlarge"=>8, "4xlarge"=>4, "8xlarge"=>2, "16xlarge"=>1 },
|
41
|
-
'r5' => { "large"=> 48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1, "metal"=>1 },
|
42
|
-
'r5d' => { "large"=> 48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1, "metal"=>1 },
|
43
|
-
'r5a' => { "large"=> 48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1 },
|
44
|
-
'r5ad' => { "large"=> 48, "xlarge"=> 24, "2xlarge"=> 12, "4xlarge"=> 6, "12xlarge"=> 2, "24xlarge" => 1},
|
45
|
-
'm4' => { "large"=>22, "xlarge"=>11, "2xlarge"=>5, "4xlarge"=>4, "10xlarge"=>1, "16xlarge"=>1 },
|
46
|
-
'm5' => { "large"=>48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1, "metal"=>1 },
|
47
|
-
'm5d' => { "large"=>48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1, "metal"=>1 },
|
48
|
-
'm5a' => { "large"=>48, "xlarge"=>24, "2xlarge"=>12, "4xlarge"=>6, "12xlarge"=>2, "24xlarge"=>1 },
|
49
|
-
'm5ad' => { "large"=> 48, "xlarge"=> 24, "2xlarge"=> 12, "4xlarge"=> 6, "12xlarge"=> 2, "24xlarge" => 1},
|
50
|
-
'i2' => { "xlarge"=>8, "2xlarge"=>4, "4xlarge"=>2, "8xlarge"=>1, "16xlarge"=>1 },
|
51
|
-
'i3' => { "large"=>32, "xlarge"=>16, "2xlarge"=>8, "4xlarge"=>4, "8xlarge"=>2, "16xlarge"=>1, "metal"=>1},
|
52
|
-
'i3p' => {"16xlarge"=>1},
|
53
|
-
'x1' => { "16xlarge"=>2, "32xlarge"=>1 },
|
54
|
-
'x1e' =>{ "xlarge"=>32, "2xlarge"=>16, "4xlarge"=>8, "8xlarge"=>4, "16xlarge"=>2, "32xlarge"=>1 },
|
55
|
-
'z1d' => {"large"=> 24, "xlarge"=> 12, "2xlarge"=> 6, "3xlarge"=> 4, "6xlarge"=> 2, "12xlarge"=> 1, "metal"=> 1},
|
56
|
-
'u-6tb1' => {"metal" => 1},
|
57
|
-
'u-9tb1' => {"metal" => 1},
|
58
|
-
'u-12tb1' => {"metal" => 1},
|
59
|
-
}
|
60
|
-
|
61
|
-
def get_ec2_dhi_od_pricing
|
62
|
-
@@OS_TYPES.each do |os|
|
63
|
-
fetch_ec2_dedicated_host_instance_pricing(DH_OD_BASE_URL + "dh-od.min.js", os.to_sym)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def fetch_ec2_dedicated_host_instance_pricing(url, operating_system)
|
68
|
-
res = PriceList.fetch_url(url)
|
69
|
-
res['config']['regions'].each do |reg|
|
70
|
-
begin
|
71
|
-
region_name = reg['region']
|
72
|
-
region = get_region(region_name)
|
73
|
-
if region.nil?
|
74
|
-
$stderr.puts "[fetch_ec2_dedicated_host_instance_pricing] WARNING: unable to find region #{region_name}"
|
75
|
-
next
|
76
|
-
end
|
77
|
-
reg['types'].each do |type|
|
78
|
-
type_name = type['name']
|
79
|
-
tiers = type['tiers']
|
80
|
-
next if tiers.nil?
|
81
|
-
tiers.each do |tier|
|
82
|
-
family = tier['name']
|
83
|
-
|
84
|
-
# hack for now until I can get capacity for fpga instances
|
85
|
-
next if family == 'f1'
|
86
|
-
if @@CAPACITY_HASH[family].nil?
|
87
|
-
# 2017-11-08 family == 'c5' not supported for DH
|
88
|
-
$stderr.puts "[fetch_ec2_dedicated_host_instance_pricing] WARNING: unable to find CAPACITY_HASH for #{family}"
|
89
|
-
next
|
90
|
-
end
|
91
|
-
|
92
|
-
dhprice = tier['prices']['USD']
|
93
|
-
@@CAPACITY_HASH[family].each do |inst_size,capacity|
|
94
|
-
api_name, name = Ec2InstanceType.get_name(family, "#{family}.#{inst_size}", false)
|
95
|
-
instance_type = region.add_or_update_ec2_instance_type(api_name, name)
|
96
|
-
instance_type.update_dhi_pricing(operating_system, dhprice, capacity)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
rescue UnknownTypeError
|
102
|
-
$stderr.puts "[fetch_ec2_dedicated_host_instance_pricing] WARNING: encountered #{$!.message}"
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe AwsPricing::Ec2DedicatedHostInstancePriceList do
|
4
|
-
|
5
|
-
before(:all) do
|
6
|
-
@pricing = AwsPricing::Ec2DedicatedHostInstancePriceList.new
|
7
|
-
@dh_pricing = AwsPricing::Ec2DedicatedHostPriceList.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def validate_price_in_region region
|
11
|
-
# Result have valid node name
|
12
|
-
region.ec2_instance_types.each do |inst_type|
|
13
|
-
expect(inst_type.api_name).to match(/[[:alpha:]][[:alpha:]]./)
|
14
|
-
expect(inst_type.category_types).to have_exactly(@pricing.os_types.length).items
|
15
|
-
expect(inst_type.category_types[0].price_per_hour.class).to eq(Float)
|
16
|
-
|
17
|
-
family_name = inst_type.api_name.split('.').first
|
18
|
-
dh_region_arr = @dh_pricing.regions.select { |reg| reg.name == region.name }
|
19
|
-
expect(dh_region_arr).to have_exactly(1).items
|
20
|
-
dh_region = dh_region_arr[0]
|
21
|
-
dh_price_per_hour = dh_region.ec2_dh_types[0].price_per_hour(:linux, :ondemand)
|
22
|
-
dh_dh_type_arr = dh_region.ec2_dh_types.select { |type| type.api_name == family_name }
|
23
|
-
expect(dh_dh_type_arr).to have_exactly(1).items
|
24
|
-
dh_dh_type = dh_dh_type_arr[0]
|
25
|
-
expect(inst_type.category_types[0].price_per_hour).to be <= dh_dh_type.category_types[:linux].ondemand_price_per_hour
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'new' do
|
30
|
-
it 'Ec2DedicatedHostInstancePriceList.new should return valid response' do
|
31
|
-
@pricing.regions.each do |region|
|
32
|
-
validate_price_in_region region
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|