amazon-pricing 0.1.67 → 0.1.68
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWIyZjg3NWM2MzQ2OTE1MmM0ZGI2YzYzNTg5ZmI1OWZmODE4NTZkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjAzM2YyM2VkY2RiODU3MDgxZTk1MTJmMDBiMjZiMTA2ZDEzZWE2NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjY3YTQ1YTMzNTIwY2FiZWYxMTkzM2VlMDc4MzFjMjczYTQ4ZmQ4MWRiMjIy
|
10
|
+
MGViMGY1NTFhNWM0Y2E4NWZiYjQzZGI5N2MyMzlkYzRjMTk1NjM0ZjNhNzll
|
11
|
+
ZjZhMTUyMzNlMTVhZjkyYjM5MmQ4Y2UyNDRkNGRhNDc2YmZiZjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmYxNjdlMjIzN2Q3YTY0YzgyYjI4MjUxNGVmOTlmODRkOGRkM2ZkMjM3NzMx
|
14
|
+
MDI4YmUwNjI0YjUwY2Q2OTczOWFjN2YzMDNhZGFlY2JjOThmOTg0MGEwNGUz
|
15
|
+
ZmFlOTQ3OThiMmM1ZGIxYzY5YzRhMjE2MzcxMmVmYzZiNjdmNTQ=
|
data/Gemfile.lock
CHANGED
@@ -32,8 +32,13 @@ module AwsPricing
|
|
32
32
|
'sqlserver_se_multiaz' => 'Microsoft SQL Server Standard Edition (Multi-AZ)',
|
33
33
|
'sqlserver_se_byol' => 'Microsoft SQL Server Standard Edition (BYOL)',
|
34
34
|
'sqlserver_se_byol_multiaz' => 'Microsoft SQL Server Standard Edition (BYOL Multi-AZ)',
|
35
|
+
'sqlserver_ee_standard' => 'Microsoft SQL Server Enterprise Edition',
|
36
|
+
'sqlserver_ee_multiaz' => 'Microsoft SQL Server Enterprise Edition (Multi-AZ)',
|
35
37
|
'sqlserver_ee_byol' => 'Microsoft SQL Server Enterprise Edition (BYOL)',
|
36
38
|
'sqlserver_ee_byol_multiaz' => 'Microsoft SQL Server Enterprise Edition (BYOL Multi-AZ)',
|
39
|
+
'aurora_multiaz' => 'Amazon Aurora (Multi-AZ)',
|
40
|
+
'mariadb_standard' => 'MariaDB Standard',
|
41
|
+
'mariadb_multiaz' => 'MariaDB (Multi-AZ)',
|
37
42
|
}
|
38
43
|
|
39
44
|
@@Display_Name_To_Qualified_Database_Name = @@Database_Name_Lookup.invert
|
@@ -55,6 +60,8 @@ module AwsPricing
|
|
55
60
|
'oracle-ee(byol)_multiaz' => 'oracle_ee_byol_multiaz',
|
56
61
|
'sqlserver-ee(byol)' => 'sqlserver_ee_byol',
|
57
62
|
'sqlserver-ee(byol)_multiaz' => 'sqlserver_ee_byol_multiaz',
|
63
|
+
'sqlserver-ee(li)' => 'sqlserver_ee_standard',
|
64
|
+
'sqlserver-ee(li)_multiaz' => 'sqlserver_ee_multiaz',
|
58
65
|
'sqlserver-ex(li)' => 'sqlserver_ex',
|
59
66
|
'sqlserver-se(byol)' => 'sqlserver_se_byol',
|
60
67
|
'sqlserver-se(byol)_multiaz' => 'sqlserver_se_byol_multiaz',
|
@@ -63,31 +70,33 @@ module AwsPricing
|
|
63
70
|
'sqlserver-web(li)' => 'sqlserver_web',
|
64
71
|
}
|
65
72
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
@@DB_Deploy_Types = {
|
74
|
+
:mysql => [:standard, :multiaz],
|
75
|
+
:postgresql => [:standard, :multiaz],
|
76
|
+
:oracle_se1 => [:standard, :multiaz, :byol, :byol_multiaz],
|
77
|
+
:oracle_se => [:byol, :byol_multiaz],
|
78
|
+
:oracle_ee => [:byol, :byol_multiaz],
|
79
|
+
:sqlserver_se => [:standard, :multiaz, :byol, :byol_multiaz],
|
80
|
+
:sqlserver_ee => [:byol, :byol_multiaz, :standard, :multiaz],
|
81
|
+
:aurora => [:multiaz],
|
82
|
+
:mariadb => [:standard, :multiaz],
|
83
|
+
}
|
75
84
|
|
76
85
|
def self.display_name(name)
|
77
86
|
@@Database_Name_Lookup[name]
|
78
87
|
end
|
79
88
|
|
80
89
|
def self.get_database_name
|
81
|
-
[:mysql, :postgresql, :oracle_se1, :oracle_se, :oracle_ee, :sqlserver_ex, :sqlserver_web, :sqlserver_se, :sqlserver_ee]
|
90
|
+
[:mysql, :postgresql, :oracle_se1, :oracle_se, :oracle_ee, :sqlserver_ex, :sqlserver_web, :sqlserver_se, :sqlserver_ee, :aurora, :mariadb]
|
82
91
|
end
|
83
92
|
|
84
93
|
def self.get_available_types(db)
|
85
|
-
@@DB_Deploy_Types[db]
|
94
|
+
@@DB_Deploy_Types[db]
|
86
95
|
end
|
87
96
|
|
88
97
|
def self.db_mapping(product, is_multi_az)
|
89
98
|
if is_multi_az
|
90
|
-
display_name(@@ProductDescription["#{product}_multiaz"])
|
99
|
+
display_name(@@ProductDescription["#{product}_multiaz"])
|
91
100
|
else
|
92
101
|
display_name(@@ProductDescription["#{product}"])
|
93
102
|
end
|
@@ -20,7 +20,7 @@ module AwsPricing
|
|
20
20
|
#
|
21
21
|
class InstanceType
|
22
22
|
attr_accessor :name, :api_name, :memory_in_mb, :platform, :compute_units, :virtual_cores, :disk_type, :disk_in_gb
|
23
|
-
|
23
|
+
|
24
24
|
def initialize(region, api_name, name)
|
25
25
|
@category_types = {}
|
26
26
|
|
@@ -65,14 +65,14 @@ module AwsPricing
|
|
65
65
|
# term = :year_1, :year_3, nil
|
66
66
|
def price_per_hour(category_type, type_of_instance, term = nil, is_multi_az = false, isByol = false)
|
67
67
|
cat = get_category_type(category_type, is_multi_az, isByol)
|
68
|
-
cat.price_per_hour(type_of_instance, term) unless cat.nil?
|
68
|
+
cat.price_per_hour(type_of_instance, term) unless cat.nil?
|
69
69
|
end
|
70
70
|
|
71
71
|
# type_of_instance = :ondemand, :light, :medium, :heavy
|
72
72
|
# term = :year_1, :year_3, nil
|
73
73
|
def prepay(category_type, type_of_instance, term = nil, is_multi_az = false, isByol = false)
|
74
74
|
cat = get_category_type(category_type, is_multi_az, isByol)
|
75
|
-
cat.prepay(type_of_instance, term) unless cat.nil?
|
75
|
+
cat.prepay(type_of_instance, term) unless cat.nil?
|
76
76
|
end
|
77
77
|
|
78
78
|
# type_of_instance = :ondemand, :light, :medium, :heavy
|
@@ -105,8 +105,8 @@ module AwsPricing
|
|
105
105
|
begin
|
106
106
|
api_name = size["size"]
|
107
107
|
@@Memory_Lookup[api_name] = size["memoryGiB"].to_f * 1000
|
108
|
-
@@Compute_Units_Lookup[api_name] = size["ECU"].to_i
|
109
|
-
@@Virtual_Cores_Lookup[api_name] = size["vCPU"].to_i
|
108
|
+
@@Compute_Units_Lookup[api_name] = size["ECU"].to_i
|
109
|
+
@@Virtual_Cores_Lookup[api_name] = size["vCPU"].to_i
|
110
110
|
rescue UnknownTypeError
|
111
111
|
$stderr.puts "[populate_lookups] WARNING: encountered #{$!.message}"
|
112
112
|
end
|
@@ -172,7 +172,7 @@ module AwsPricing
|
|
172
172
|
'cg1.4xlarge' => 'Cluster GPU Quadruple Extra Large',
|
173
173
|
'cc1.4xlarge' => 'Cluster Compute Quadruple Extra Large', 'cc2.8xlarge' => 'Cluster Compute Eight Extra Large',
|
174
174
|
't1.micro' => 'Micro',
|
175
|
-
'cr1.8xlarge' => 'High-Memory Cluster Eight Extra Large',
|
175
|
+
'cr1.8xlarge' => 'High-Memory Cluster Eight Extra Large',
|
176
176
|
'hs1.8xlarge' => 'High-Storage Eight Extra Large',
|
177
177
|
'g2.2xlarge' => 'Cluster GPU Double Extra Large', 'g2.8xlarge' => 'Cluster GPU Eight Extra Large',
|
178
178
|
'c3.large' => 'High-Compute Large', 'c3.xlarge' => 'High-Compute Extra Large', 'c3.2xlarge' => 'High-Compute Double Extra Large', 'c3.4xlarge' => 'High-Compute Quadruple Extra Large', 'c3.8xlarge' => 'High-Compute Eight Extra Large',
|
@@ -181,7 +181,7 @@ module AwsPricing
|
|
181
181
|
'r3.large' => 'Memory Optimized Large', 'r3.xlarge' => 'Memory Optimized Extra Large', 'r3.2xlarge' => 'Memory Optimized Double Extra Large', 'r3.4xlarge' => 'Memory Optimized Quadruple Extra Large', 'r3.8xlarge' => 'Memory Optimized Eight Extra Large',
|
182
182
|
't2.micro' => 'Burstable Performance Instance Micro', 't2.small' => 'Burstable Performance Instance Small', 't2.medium' => 'Burstable Performance Instance Medium', 't2.large' => 'Burstable Performance Instance Large',
|
183
183
|
'c4.large' => 'Compute Optimized Large', 'c4.xlarge' => 'Compute Optimized Extra Large', 'c4.2xlarge' => 'Compute Optimized Double Extra Large', 'c4.4xlarge' => 'Compute Optimized Quadruple Extra Large', 'c4.8xlarge' => 'Compute Optimized Eight Extra Large',
|
184
|
-
}
|
184
|
+
}
|
185
185
|
@@Disk_Lookup = {
|
186
186
|
'm1.small' => 160, 'm1.medium' => 410, 'm1.large' =>850, 'm1.xlarge' => 1690,
|
187
187
|
'm2.xlarge' => 420, 'm2.2xlarge' => 850, 'm2.4xlarge' => 1690,
|
@@ -198,12 +198,12 @@ module AwsPricing
|
|
198
198
|
'db.m1.small' => 160, 'db.m1.medium' => 410, 'db.m1.large' =>850, 'db.m1.xlarge' => 1690,
|
199
199
|
'db.m2.xlarge' => 420, 'db.m2.2xlarge' => 850, 'db.m2.4xlarge' => 1690, 'db.cr1.8xlarge' => 1690,
|
200
200
|
'db.t1.micro' => 160,
|
201
|
-
'c3.large' => 32, 'c3.xlarge' => 80, 'c3.2xlarge' => 160, 'c3.4xlarge' => 320, 'c3.8xlarge' => 640,
|
201
|
+
'c3.large' => 32, 'c3.xlarge' => 80, 'c3.2xlarge' => 160, 'c3.4xlarge' => 320, 'c3.8xlarge' => 640,
|
202
202
|
'i2.large' => 360, 'i2.xlarge' => 720, 'i2.2xlarge' => 1440, 'i2.4xlarge' => 2880, 'i2.8xlarge' => 5760,
|
203
203
|
'd2.xlarge' => 6000, 'd2.2xlarge' => 12000, 'd2.4xlarge' => 24000, 'd2.8xlarge' => 48000,
|
204
204
|
'r3.large' => 32, 'r3.xlarge' => 80, 'r3.2xlarge' => 160, 'r3.4xlarge' => 320, 'r3.8xlarge' => 640,
|
205
205
|
't2.micro' => 0, 't2.small' => 0, 't2.medium' => 0, 't2.large' => 0,
|
206
|
-
'c4.large' => 0, 'c4.xlarge' => 0, 'c4.2xlarge' => 0, 'c4.4xlarge' => 0, 'c4.8xlarge' => 0,
|
206
|
+
'c4.large' => 0, 'c4.xlarge' => 0, 'c4.2xlarge' => 0, 'c4.4xlarge' => 0, 'c4.8xlarge' => 0,
|
207
207
|
}
|
208
208
|
@@Platform_Lookup = {
|
209
209
|
'm1.small' => 32, 'm1.medium' => 32, 'm1.large' => 64, 'm1.xlarge' => 64,
|
@@ -221,12 +221,12 @@ module AwsPricing
|
|
221
221
|
'db.m1.small' => 64, 'db.m1.medium' => 64, 'db.m1.large' => 64, 'db.m1.xlarge' => 64,
|
222
222
|
'db.m2.xlarge' => 64, 'db.m2.2xlarge' => 64, 'db.m2.4xlarge' => 64, 'db.cr1.8xlarge' => 64,
|
223
223
|
'db.t1.micro' => 64,
|
224
|
-
'c3.large' => 64, 'c3.xlarge' => 64, 'c3.2xlarge' => 64, 'c3.4xlarge' => 64, 'c3.8xlarge' => 64,
|
224
|
+
'c3.large' => 64, 'c3.xlarge' => 64, 'c3.2xlarge' => 64, 'c3.4xlarge' => 64, 'c3.8xlarge' => 64,
|
225
225
|
'i2.large' => 64, 'i2.xlarge' => 64, 'i2.2xlarge' => 64, 'i2.4xlarge' => 64, 'i2.8xlarge' => 64,
|
226
226
|
'd2.xlarge' => 64, 'd2.2xlarge' => 64, 'd2.4xlarge' => 64, 'd2.8xlarge' => 64,
|
227
227
|
'r3.large' => 64, 'r3.xlarge' => 64, 'r3.2xlarge' => 64, 'r3.4xlarge' => 64, 'r3.8xlarge' => 64,
|
228
228
|
't2.micro' => 64, 't2.small' => 64, 't2.medium' => 64, 't2.large' => 64,
|
229
|
-
'c4.large' => 64, 'c4.xlarge' => 64, 'c4.2xlarge' => 64, 'c4.4xlarge' => 64, 'c4.8xlarge' => 64,
|
229
|
+
'c4.large' => 64, 'c4.xlarge' => 64, 'c4.2xlarge' => 64, 'c4.4xlarge' => 64, 'c4.8xlarge' => 64,
|
230
230
|
}
|
231
231
|
@@Disk_Type_Lookup = {
|
232
232
|
'm1.small' => :ephemeral, 'm1.medium' => :ephemeral, 'm1.large' => :ephemeral, 'm1.xlarge' => :ephemeral,
|
@@ -241,16 +241,16 @@ module AwsPricing
|
|
241
241
|
'cr1.8xlarge' => :ssd,
|
242
242
|
'hs1.8xlarge' => :ephemeral,
|
243
243
|
'g2.2xlarge' => :ssd, 'g2.8xlarge' => :ssd,
|
244
|
-
'unknown' => :ephemeral,
|
244
|
+
'unknown' => :ephemeral,
|
245
245
|
'db.m1.small' => :ephemeral, 'db.m1.medium' => :ephemeral, 'db.m1.large' => :ephemeral, 'db.m1.xlarge' => :ephemeral,
|
246
246
|
'db.m2.xlarge' => :ephemeral, 'db.m2.2xlarge' => :ephemeral, 'db.m2.4xlarge' => :ephemeral, 'db.cr1.8xlarge' => :ephemeral,
|
247
247
|
'db.t1.micro' => :ebs,
|
248
|
-
'c3.large' => :ssd, 'c3.xlarge' => :ssd, 'c3.2xlarge' => :ssd, 'c3.4xlarge' => :ssd, 'c3.8xlarge' => :ssd,
|
248
|
+
'c3.large' => :ssd, 'c3.xlarge' => :ssd, 'c3.2xlarge' => :ssd, 'c3.4xlarge' => :ssd, 'c3.8xlarge' => :ssd,
|
249
249
|
'i2.large' => :ssd, 'i2.xlarge' => :ssd, 'i2.2xlarge' => :ssd, 'i2.4xlarge' => :ssd, 'i2.8xlarge' => :ssd,
|
250
250
|
'd2.xlarge' => :ephemeral, 'd2.2xlarge' => :ephemeral, 'd2.4xlarge' => :ephemeral, 'd2.8xlarge' => :ephemeral,
|
251
251
|
'r3.large' => :ssd, 'r3.xlarge' => :ssd, 'r3.2xlarge' => :ssd, 'r3.4xlarge' => :ssd, 'r3.8xlarge' => :ssd,
|
252
252
|
't2.micro' => :ebs, 't2.small' => :ebs, 't2.medium' => :ebs, 't2.large' => :ebs,
|
253
|
-
'c4.large' => :ebs, 'c4.xlarge' => :ebs, 'c4.2xlarge' => :ebs, 'c4.4xlarge' => :ebs, 'c4.8xlarge' => :ebs,
|
253
|
+
'c4.large' => :ebs, 'c4.xlarge' => :ebs, 'c4.2xlarge' => :ebs, 'c4.4xlarge' => :ebs, 'c4.8xlarge' => :ebs,
|
254
254
|
}
|
255
255
|
|
256
256
|
# NOTE: These are populated by "populate_lookups"
|
@@ -261,7 +261,7 @@ module AwsPricing
|
|
261
261
|
'cache.m3.medium' => 2780, 'cache.m3.large' => 6050, 'cache.m3.xlarge' => 13300, 'cache.m3.2xlarge' => 27900,
|
262
262
|
't2.micro' => 1000, 't2.small' => 2000, 't2.medium' => 4000, 't2.large' => 8000,
|
263
263
|
'cache.t2.micro' => 555, 'cache.t2.small' => 1550, 'cache.t2.medidium' => 3220,
|
264
|
-
|
264
|
+
|
265
265
|
'cache.m1.small' => 1300, 'cache.m1.medium' => 3350, 'cache.m1.large' => 7100, 'cache.m1.xlarge' => 14600,
|
266
266
|
'cache.m2.xlarge' => 16700, 'cache.m2.2xlarge' => 33800, 'cache.m2.4xlarge' => 68000,
|
267
267
|
'cache.c1.xlarge' => 6600,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module AwsPricing
|
2
2
|
class RdsPriceList < PriceList
|
3
|
-
|
3
|
+
|
4
4
|
def initialize
|
5
5
|
super
|
6
6
|
InstanceType.populate_lookups
|
@@ -11,9 +11,11 @@ module AwsPricing
|
|
11
11
|
|
12
12
|
protected
|
13
13
|
|
14
|
-
|
14
|
+
# NOTE if you add to DB_TYPE, make sure to update self.get_database_name
|
15
|
+
# in amazon-pricing/lib/amazon-pricing/definitions/database-type.rb
|
16
|
+
@@DB_TYPE = [:mysql, :postgresql, :oracle, :sqlserver, :aurora, :mariadb]
|
15
17
|
@@RES_TYPES = [:light, :medium, :heavy]
|
16
|
-
|
18
|
+
|
17
19
|
@@OD_DB_DEPLOY_TYPE = {
|
18
20
|
:mysql => {:mysql=>["standard","multiAZ"]},
|
19
21
|
:postgresql => {:postgresql=>["standard","multiAZ"]},
|
@@ -26,8 +28,10 @@ module AwsPricing
|
|
26
28
|
:sqlserver_ex=>["li-ex"],
|
27
29
|
:sqlserver_web=>["li-web"],
|
28
30
|
:sqlserver_se=>["li-se", "li-se-multiAZ", "byol", "byol-multiAZ"],
|
29
|
-
:sqlserver_ee=>["byol", "byol-multiAZ"]
|
30
|
-
}
|
31
|
+
:sqlserver_ee=>["byol", "byol-multiAZ", "li-ee", 'li-ee-multiAZ']
|
32
|
+
},
|
33
|
+
:aurora => { :aurora => ["multiAZ"] },
|
34
|
+
:mariadb => { :mariadb => ["standard", "multiAZ"] }
|
31
35
|
}
|
32
36
|
|
33
37
|
@@RESERVED_DB_DEPLOY_TYPE = {
|
@@ -40,7 +44,9 @@ module AwsPricing
|
|
40
44
|
:postgresql => {:postgresql=>["standard","multiAZ"]},
|
41
45
|
:oracle => {:oracle_se1=>["license-included-standard", "license-included-multiAZ"],
|
42
46
|
:oracle_se=>["byol-standard", "byol-multiAZ"]},
|
43
|
-
:sqlserver=> {:sqlserver_se=>["byol-standard", "byol-multiAZ"]}
|
47
|
+
:sqlserver => {:sqlserver_se=>["byol-standard", "byol-multiAZ"]},
|
48
|
+
:aurora => {:aurora => ["multiAZ"]},
|
49
|
+
:mariadb => {:mariadb => ["standard", "multiAZ"]}
|
44
50
|
}
|
45
51
|
|
46
52
|
@@RESERVED_DB_WITH_SAME_PRICING2 = {
|
@@ -48,9 +54,15 @@ module AwsPricing
|
|
48
54
|
:postgresql => [:postgresql],
|
49
55
|
:oracle_se1 => [:oracle_se1],
|
50
56
|
:oracle_se => [:oracle_se, :oracle_se1, :oracle_ee],
|
51
|
-
:sqlserver_se => [:sqlserver_se, :sqlserver_ee]
|
57
|
+
:sqlserver_se => [:sqlserver_se, :sqlserver_ee],
|
58
|
+
:aurora => [:aurora],
|
59
|
+
:mariadb => [:mariadb]
|
52
60
|
}
|
53
61
|
|
62
|
+
# old RI pricing was broken out by utilization levels: light, medium & heavy.
|
63
|
+
# this data is not available for new offerings
|
64
|
+
@@NO_LEGACY_RI_PRICING_AVAILABLE = [:aurora, :mariadb]
|
65
|
+
|
54
66
|
def is_multi_az?(type)
|
55
67
|
return true if type.upcase.match("MULTI-AZ")
|
56
68
|
false
|
@@ -59,7 +71,7 @@ module AwsPricing
|
|
59
71
|
def is_byol?(type)
|
60
72
|
return true if type.match("byol")
|
61
73
|
false
|
62
|
-
end
|
74
|
+
end
|
63
75
|
|
64
76
|
def get_rds_on_demand_instance_pricing
|
65
77
|
@@DB_TYPE.each do |db|
|
@@ -71,7 +83,7 @@ module AwsPricing
|
|
71
83
|
is_multi_az = dp_type.upcase.include?("MULTIAZ")
|
72
84
|
dp_type = dp_type.gsub('-multiAZ', '') if db == :sqlserver
|
73
85
|
|
74
|
-
if [:mysql, :postgresql, :oracle].include? db
|
86
|
+
if [:mysql, :postgresql, :oracle, :aurora, :mariadb].include? db
|
75
87
|
fetch_on_demand_rds_instance_pricing(RDS_BASE_URL+"#{db}/pricing-#{dp_type}-deployments.min.js",:ondemand, db_type, is_byol, is_multi_az)
|
76
88
|
elsif db == :sqlserver
|
77
89
|
if is_multi_az
|
@@ -85,13 +97,13 @@ module AwsPricing
|
|
85
97
|
if [:mysql, :postgresql, :oracle].include? db
|
86
98
|
fetch_on_demand_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/pricing-#{dp_type}-deployments.min.js",:ondemand, db_type, is_byol, is_multi_az)
|
87
99
|
elsif db == :sqlserver
|
100
|
+
next if dp_type == 'li-ee' || dp_type == 'li-ee-multiAZ'
|
88
101
|
if is_multi_az
|
89
102
|
fetch_on_demand_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/sqlserver-#{dp_type}-ondemand-maz.min.js",:ondemand, db_type, is_byol, is_multi_az)
|
90
103
|
else
|
91
104
|
fetch_on_demand_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/sqlserver-#{dp_type}-ondemand.min.js",:ondemand, db_type, is_byol, is_multi_az)
|
92
105
|
end
|
93
106
|
end
|
94
|
-
|
95
107
|
end
|
96
108
|
}
|
97
109
|
end
|
@@ -152,21 +164,22 @@ module AwsPricing
|
|
152
164
|
end
|
153
165
|
|
154
166
|
def get_rds_reserved_instance_pricing
|
155
|
-
|
167
|
+
@@DB_TYPE.each do |db|
|
168
|
+
next if @@NO_LEGACY_RI_PRICING_AVAILABLE.include? db
|
156
169
|
if [:mysql, :postgresql].include? db
|
157
170
|
@@RES_TYPES.each do |res_type|
|
158
171
|
if db == :postgresql and res_type == :heavy
|
159
172
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/pricing-#{res_type}-utilization-reserved-instances.min.js", res_type, db, false)
|
160
173
|
elsif db == :mysql
|
161
174
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/pricing-#{res_type}-utilization-reserved-instances.min.js", res_type, db, false)
|
162
|
-
end
|
175
|
+
end
|
163
176
|
|
164
177
|
# Now repeat for legacy instances
|
165
178
|
if db == :postgresql and res_type == :heavy
|
166
179
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/pricing-#{res_type}-utilization-reserved-instances.min.js", res_type, db, false)
|
167
180
|
elsif db == :mysql
|
168
181
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/pricing-#{res_type}-utilization-reserved-instances.min.js", res_type, db, false)
|
169
|
-
end
|
182
|
+
end
|
170
183
|
end
|
171
184
|
else
|
172
185
|
@@RESERVED_DB_DEPLOY_TYPE[db].each {|db_type, db_instance|
|
@@ -174,20 +187,20 @@ module AwsPricing
|
|
174
187
|
db_instance.each do |dp_type|
|
175
188
|
is_byol = is_byol? dp_type
|
176
189
|
if db == :oracle
|
177
|
-
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/pricing-#{dp_type}-#{res_type}-utilization-reserved-instances.min.js", res_type, db_type, is_byol)
|
190
|
+
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/pricing-#{dp_type}-#{res_type}-utilization-reserved-instances.min.js", res_type, db_type, is_byol)
|
178
191
|
elsif db == :sqlserver
|
179
192
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/sqlserver-#{dp_type}-#{res_type}-ri.min.js", res_type, db_type, is_byol)
|
180
193
|
end
|
181
194
|
|
182
195
|
# Now repeat for legacy instances
|
183
196
|
if db == :oracle
|
184
|
-
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/pricing-#{dp_type}-#{res_type}-utilization-reserved-instances.min.js", res_type, db_type, is_byol)
|
197
|
+
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/pricing-#{dp_type}-#{res_type}-utilization-reserved-instances.min.js", res_type, db_type, is_byol)
|
185
198
|
elsif db == :sqlserver
|
186
199
|
fetch_reserved_rds_instance_pricing(RDS_BASE_URL+"#{db}/previous-generation/sqlserver-#{dp_type}-#{res_type}-ri.min.js", res_type, db_type, is_byol)
|
187
200
|
end
|
188
201
|
|
189
|
-
end
|
190
|
-
end
|
202
|
+
end
|
203
|
+
end
|
191
204
|
}
|
192
205
|
end
|
193
206
|
end
|
@@ -207,16 +220,16 @@ module AwsPricing
|
|
207
220
|
# is_multi_az = true
|
208
221
|
#else
|
209
222
|
# is_multi_az = is_multi_az? type["name"]
|
210
|
-
#end
|
223
|
+
#end
|
211
224
|
api_name, name = RdsInstanceType.get_name(type["name"], tier["name"], type_of_rds_instance != :ondemand)
|
212
|
-
|
225
|
+
|
213
226
|
instance_type = region.add_or_update_rds_instance_type(api_name, name)
|
214
227
|
instance_type.update_pricing(db_type, type_of_rds_instance, tier, is_multi_az, is_byol)
|
215
228
|
rescue UnknownTypeError
|
216
229
|
$stderr.puts "[fetch_on_demand_rds_instance_pricing] WARNING: encountered #{$!.message}"
|
217
230
|
end
|
218
231
|
end
|
219
|
-
end
|
232
|
+
end
|
220
233
|
end
|
221
234
|
end
|
222
235
|
|
@@ -230,7 +243,7 @@ module AwsPricing
|
|
230
243
|
begin
|
231
244
|
is_multi_az = is_multi_az? type["type"]
|
232
245
|
api_name, name = RdsInstanceType.get_name(type["type"], tier["size"], true)
|
233
|
-
|
246
|
+
|
234
247
|
instance_type = region.add_or_update_rds_instance_type(api_name, name)
|
235
248
|
instance_type.update_pricing(db_type, type_of_rds_instance, tier, is_multi_az, is_byol)
|
236
249
|
rescue UnknownTypeError
|
@@ -242,6 +255,6 @@ module AwsPricing
|
|
242
255
|
rescue => ex
|
243
256
|
$sterr.puts "Failed to fetch: #{url}"
|
244
257
|
raise
|
245
|
-
end
|
258
|
+
end
|
246
259
|
end
|
247
260
|
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.68
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Kinsella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
14
14
|
email:
|