amazon-pricing 0.1.98 → 0.1.99
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
|
+
YWU2NmQzMjliNzAyNjQ1MTk0ZTZjZmY1MjU0ZTEzM2YzM2Y3ZmE4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGQ1OTg5YjY5NjI2YzA1ZjNjNmZjM2U2NTczNzE0MjRlMzc3N2I3Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmU4YTJjNWY0Mzk0NTA1OTM1MWI1NjczNDdiMWMzZTZlYTVhYWViYjVlY2Yx
|
10
|
+
MTBmYmVjNDA4NzZhMmMxYzJhYTM3ZDA4YjhmYWI4Y2ZlY2ZkZTg4YzgwYjRk
|
11
|
+
ZGE5M2I4MTBkZGU5MWU2ZThiYmExNWRlZmIzNDQ1NDljYTE2Zjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGI1N2QxOWZmMjI0NjgzZWIwMmZhNjQ3YjI5ODY5YTM4NDIwMDMyZmE0MGQ3
|
14
|
+
YjNiZjdmMWYyZWVjYTkxMmVkYmE3OGMzNTQ3NmEzYzQ5NzZkMDVhNzkzMjEx
|
15
|
+
OWJhMjk1NzhkNjM4ODJhNjRmZGRmOTAyYjJhMDgyYTkzYTEwMzQ=
|
@@ -13,75 +13,163 @@ require 'amazon-pricing/definitions/category-type'
|
|
13
13
|
module AwsPricing
|
14
14
|
class DatabaseType < CategoryType
|
15
15
|
|
16
|
+
# Display Name, as seen in DBR/CUR
|
17
|
+
MYSQL_STANDARD = 'MySQL Community Edition'.freeze
|
18
|
+
MYSQL_MULTIAZ = 'MySQL Community Edition (Multi-AZ)'.freeze
|
19
|
+
POSTGRESQL_STANDARD = 'PostgreSql Community Edition(Beta)'.freeze
|
20
|
+
POSTGRESQL_MULTIAZ = 'PostgreSql Community Edition(Beta) (Multi-AZ)'.freeze
|
21
|
+
ORACLE_SE1_STANDARD = 'Oracle Database Standard Edition One'.freeze
|
22
|
+
ORACLE_SE1_MULTIAZ = 'Oracle Database Standard Edition One (Multi-AZ)'.freeze
|
23
|
+
ORACLE_SE1_BYOL_STANDARD = 'Oracle Database Standard Edition One (BYOL)'.freeze
|
24
|
+
ORACLE_SE1_BYOL_MULTIAZ = 'Oracle Database Standard Edition One (BYOL Multi-AZ)'.freeze
|
25
|
+
ORACLE_SE2_STANDARD = 'Oracle Database Standard Edition Two'.freeze
|
26
|
+
ORACLE_SE2_MULTIAZ = 'Oracle Database Standard Edition Two (Multi-AZ)'.freeze
|
27
|
+
ORACLE_SE2_BYOL_STANDARD = 'Oracle Database Standard Edition Two (BYOL)'.freeze
|
28
|
+
ORACLE_SE2_BYOL_MULTIAZ = 'Oracle Database Standard Edition Two (BYOL Multi-AZ)'.freeze
|
29
|
+
ORACLE_SE_BYOL_STANDARD = 'Oracle Database Standard Edition (BYOL)'.freeze
|
30
|
+
ORACLE_SE_BYOL_MULTIAZ = 'Oracle Database Standard Edition (BYOL Multi-AZ)'.freeze
|
31
|
+
ORACLE_EE_BYOL_STANDARD = 'Oracle Database Enterprise Edition (BYOL)'.freeze
|
32
|
+
ORACLE_EE_BYOL_MULTIAZ = 'Oracle Database Enterprise Edition (BYOL Multi-AZ)'.freeze
|
33
|
+
SQLSERVER_EX = 'Microsoft SQL Server Express Edition'.freeze
|
34
|
+
SQLSERVER_WEB = 'Microsoft SQL Server Web Edition'.freeze
|
35
|
+
SQLSERVER_SE_STANDARD = 'Microsoft SQL Server Standard Edition'.freeze
|
36
|
+
SQLSERVER_SE_MULTIAZ = 'Microsoft SQL Server Standard Edition (Multi-AZ)'.freeze
|
37
|
+
SQLSERVER_SE_BYOL_STANDARD= 'Microsoft SQL Server Standard Edition (BYOL)'.freeze
|
38
|
+
SQLSERVER_SE_BYOL_MULTIAZ = 'Microsoft SQL Server Standard Edition (BYOL Multi-AZ)'.freeze
|
39
|
+
SQLSERVER_EE_STANDARD = 'Microsoft SQL Server Enterprise Edition'.freeze
|
40
|
+
SQLSERVER_EE_MULTIAZ = 'Microsoft SQL Server Enterprise Edition (Multi-AZ)'.freeze
|
41
|
+
SQLSERVER_EE_BYOL_STANDARD= 'Microsoft SQL Server Enterprise Edition (BYOL)'.freeze
|
42
|
+
SQLSERVER_EE_BYOL_MULTIAZ = 'Microsoft SQL Server Enterprise Edition (BYOL Multi-AZ)'
|
43
|
+
AURORA_MYSQL = 'Amazon Aurora'.freeze # multiaz not distinguished, MySQL not distinguished
|
44
|
+
AURORA_POSTGRESQL = 'Amazon Aurora PostgreSQL'.freeze # multiaz not distinguished
|
45
|
+
MARIADB_STANDARD = 'MariaDB'.freeze
|
46
|
+
MARIADB_MULTIAZ = 'MariaDB (Multi-AZ)'.freeze
|
47
|
+
|
48
|
+
# maps RDS description to [ engine, license, multiaz, sizeflex ]
|
49
|
+
@@DB_ENGINE_MAP = {
|
50
|
+
MYSQL_STANDARD => { engine: "mysql", license: "none", multiaz: false, sizeflex: true },
|
51
|
+
MYSQL_MULTIAZ => { engine: "mysql", license: "none", multiaz: true, sizeflex: true },
|
52
|
+
POSTGRESQL_STANDARD => { engine: "postgresql", license: "none", multiaz: false, sizeflex: true },
|
53
|
+
POSTGRESQL_MULTIAZ => { engine: "postgresql", license: "none", multiaz: true, sizeflex: true },
|
54
|
+
ORACLE_SE1_STANDARD => { engine: "oracle-se1", license: "li", multiaz: false, sizeflex: false },
|
55
|
+
ORACLE_SE1_MULTIAZ => { engine: "oracle-se1", license: "li", multiaz: true, sizeflex: false },
|
56
|
+
ORACLE_SE1_BYOL_STANDARD => { engine: "oracle-se1", license: "byol", multiaz: false, sizeflex: true },
|
57
|
+
ORACLE_SE1_BYOL_MULTIAZ => { engine: "oracle-se1", license: "byol", multiaz: true, sizeflex: true },
|
58
|
+
ORACLE_SE2_STANDARD => { engine: "oracle-se2", license: "li", multiaz: false, sizeflex: false },
|
59
|
+
ORACLE_SE2_MULTIAZ => { engine: "oracle-se2", license: "li", multiaz: true, sizeflex: false },
|
60
|
+
ORACLE_SE2_BYOL_STANDARD => { engine: "oracle-se2", license: "byol", multiaz: false, sizeflex: true },
|
61
|
+
ORACLE_SE2_BYOL_MULTIAZ => { engine: "oracle-se2", license: "byol", multiaz: true, sizeflex: true },
|
62
|
+
ORACLE_SE_BYOL_STANDARD => { engine: "oracle-se", license: "byol", multiaz: false, sizeflex: true },
|
63
|
+
ORACLE_SE_BYOL_MULTIAZ => { engine: "oracle-se", license: "byol", multiaz: true, sizeflex: true },
|
64
|
+
ORACLE_EE_BYOL_STANDARD => { engine: "oracle-ee", license: "byol", multiaz: false, sizeflex: true },
|
65
|
+
ORACLE_EE_BYOL_MULTIAZ => { engine: "oracle-ee", license: "byol", multiaz: true, sizeflex: true },
|
66
|
+
SQLSERVER_EX => { engine: "sqlserver-ex", license: "li", multiaz: false, sizeflex: false },
|
67
|
+
SQLSERVER_WEB => { engine: "sqlserver-web", license: "li", multiaz: false, sizeflex: false },
|
68
|
+
SQLSERVER_SE_STANDARD => { engine: "sqlserver-se", license: "li", multiaz: false, sizeflex: false },
|
69
|
+
SQLSERVER_SE_MULTIAZ => { engine: "sqlserver-se", license: "li", multiaz: true, sizeflex: false },
|
70
|
+
SQLSERVER_SE_BYOL_STANDARD=> { engine: "sqlserver-se", license: "byol", multiaz: false, sizeflex: false },
|
71
|
+
SQLSERVER_SE_BYOL_MULTIAZ => { engine: "sqlserver-se", license: "byol", multiaz: true, sizeflex: false },
|
72
|
+
SQLSERVER_EE_STANDARD => { engine: "sqlserver-ee", license: "li", multiaz: false, sizeflex: false },
|
73
|
+
SQLSERVER_EE_MULTIAZ => { engine: "sqlserver-ee", license: "li", multiaz: true, sizeflex: false },
|
74
|
+
SQLSERVER_EE_BYOL_STANDARD=> { engine: "sqlserver-ee", license: "byol", multiaz: false, sizeflex: false },
|
75
|
+
SQLSERVER_EE_BYOL_MULTIAZ => { engine: "sqlserver-ee", license: "byol", multiaz: true, sizeflex: false },
|
76
|
+
AURORA_MYSQL => { engine: "aurora", license: "none", multiaz: true, sizeflex: true },
|
77
|
+
AURORA_POSTGRESQL => { engine: "aurora-postgresql", license: "none", multiaz: true, sizeflex: true },
|
78
|
+
MARIADB_STANDARD => { engine: "mariadb", license: "none", multiaz: false, sizeflex: true },
|
79
|
+
MARIADB_MULTIAZ => { engine: "mariadb", license: "none", multiaz: true, sizeflex: true },
|
80
|
+
}.freeze
|
81
|
+
# maps Operation to Description
|
82
|
+
@@DB_OPERATION_TO_DESCRIPTION = {
|
83
|
+
'CreateDBInstance:0002'.freeze => MYSQL_STANDARD, # MySQL
|
84
|
+
'CreateDBInstance:0003'.freeze => ORACLE_SE1_BYOL_STANDARD, # Oracle SE1 (BYOL)
|
85
|
+
'CreateDBInstance:0004'.freeze => ORACLE_SE_BYOL_STANDARD, # Oracle SE (BYOL)
|
86
|
+
'CreateDBInstance:0005'.freeze => ORACLE_EE_BYOL_STANDARD, # Oracle EE (BYOL)
|
87
|
+
'CreateDBInstance:0006'.freeze => ORACLE_SE1_STANDARD, # Oracle SE1 (LI)
|
88
|
+
'CreateDBInstance:0008'.freeze => SQLSERVER_SE_BYOL_STANDARD, # SQL Server SE (BYOL)
|
89
|
+
'CreateDBInstance:0009'.freeze => SQLSERVER_EE_BYOL_STANDARD, # SQL Server EE (BYOL)
|
90
|
+
'CreateDBInstance:0010'.freeze => SQLSERVER_EX, # SQL Server Exp (LI)
|
91
|
+
'CreateDBInstance:0011'.freeze => SQLSERVER_WEB, # SQL Server Web (LI)
|
92
|
+
'CreateDBInstance:0012'.freeze => SQLSERVER_SE_STANDARD, # SQL Server SE (LI)
|
93
|
+
'CreateDBInstance:0014'.freeze => POSTGRESQL_STANDARD, # PostgreSQL
|
94
|
+
'CreateDBInstance:0015'.freeze => SQLSERVER_EE_STANDARD, # SQL Server EE (LI)
|
95
|
+
'CreateDBInstance:0016'.freeze => AURORA_MYSQL, # Aurora MySQL
|
96
|
+
'CreateDBInstance:0018'.freeze => MARIADB_STANDARD, # MariaDB
|
97
|
+
'CreateDBInstance:0019'.freeze => ORACLE_SE2_BYOL_STANDARD, # Oracle SE2 (BYOL)
|
98
|
+
'CreateDBInstance:0020'.freeze => ORACLE_SE2_STANDARD, # Oracle SE2 (LI)
|
99
|
+
'CreateDBInstance:0021'.freeze => AURORA_POSTGRESQL, # Aurora PostgreSQL
|
100
|
+
}.freeze
|
101
|
+
|
16
102
|
@@Database_Name_Lookup = {
|
17
|
-
'mysql_standard' =>
|
18
|
-
'mysql_multiaz' =>
|
19
|
-
'postgresql_standard' =>
|
20
|
-
'postgresql_multiaz' =>
|
21
|
-
'oracle_se1_standard' =>
|
22
|
-
'oracle_se1_multiaz' =>
|
23
|
-
'oracle_se1_byol' =>
|
24
|
-
'oracle_se1_byol_multiaz' =>
|
25
|
-
'oracle_se_byol' =>
|
26
|
-
'oracle_se_byol_multiaz' =>
|
27
|
-
'oracle_ee_byol' =>
|
28
|
-
'oracle_ee_byol_multiaz' =>
|
29
|
-
'sqlserver_ex' =>
|
30
|
-
'sqlserver_web' =>
|
31
|
-
'sqlserver_se_standard' =>
|
32
|
-
'sqlserver_se_multiaz' =>
|
33
|
-
'sqlserver_se_byol' =>
|
34
|
-
'sqlserver_se_byol_multiaz' =>
|
35
|
-
'sqlserver_ee_standard' =>
|
36
|
-
'sqlserver_ee_multiaz' =>
|
37
|
-
'sqlserver_ee_byol' =>
|
38
|
-
'sqlserver_ee_byol_multiaz' =>
|
39
|
-
'aurora_standard'
|
40
|
-
'
|
41
|
-
'
|
42
|
-
|
43
|
-
|
44
|
-
'
|
103
|
+
'mysql_standard'.freeze => MYSQL_STANDARD,
|
104
|
+
'mysql_multiaz'.freeze => MYSQL_MULTIAZ,
|
105
|
+
'postgresql_standard'.freeze => POSTGRESQL_STANDARD,
|
106
|
+
'postgresql_multiaz'.freeze => POSTGRESQL_MULTIAZ,
|
107
|
+
'oracle_se1_standard'.freeze => ORACLE_SE1_STANDARD,
|
108
|
+
'oracle_se1_multiaz'.freeze => ORACLE_SE1_MULTIAZ,
|
109
|
+
'oracle_se1_byol'.freeze => ORACLE_SE1_BYOL_STANDARD,
|
110
|
+
'oracle_se1_byol_multiaz'.freeze => ORACLE_SE1_BYOL_MULTIAZ,
|
111
|
+
'oracle_se_byol'.freeze => ORACLE_SE_BYOL_STANDARD,
|
112
|
+
'oracle_se_byol_multiaz'.freeze => ORACLE_SE_BYOL_MULTIAZ,
|
113
|
+
'oracle_ee_byol'.freeze => ORACLE_EE_BYOL_STANDARD,
|
114
|
+
'oracle_ee_byol_multiaz'.freeze => ORACLE_EE_BYOL_MULTIAZ,
|
115
|
+
'sqlserver_ex'.freeze => SQLSERVER_EX,
|
116
|
+
'sqlserver_web'.freeze => SQLSERVER_WEB,
|
117
|
+
'sqlserver_se_standard'.freeze => SQLSERVER_SE_STANDARD,
|
118
|
+
'sqlserver_se_multiaz'.freeze => SQLSERVER_SE_MULTIAZ,
|
119
|
+
'sqlserver_se_byol'.freeze => SQLSERVER_SE_BYOL_STANDARD,
|
120
|
+
'sqlserver_se_byol_multiaz'.freeze => SQLSERVER_SE_BYOL_MULTIAZ,
|
121
|
+
'sqlserver_ee_standard'.freeze => SQLSERVER_EE_STANDARD,
|
122
|
+
'sqlserver_ee_multiaz'.freeze => SQLSERVER_EE_MULTIAZ,
|
123
|
+
'sqlserver_ee_byol'.freeze => SQLSERVER_EE_BYOL_STANDARD,
|
124
|
+
'sqlserver_ee_byol_multiaz'.freeze => SQLSERVER_EE_BYOL_MULTIAZ,
|
125
|
+
'aurora_standard'.freeze => AURORA_MYSQL,
|
126
|
+
'aurora_postgresql_standard'.freeze=> AURORA_POSTGRESQL,
|
127
|
+
'mariadb_standard'.freeze => MARIADB_STANDARD,
|
128
|
+
'mariadb_multiaz'.freeze => MARIADB_MULTIAZ,
|
129
|
+
|
130
|
+
'oracle_se2_standard'.freeze => ORACLE_SE2_STANDARD,
|
131
|
+
'oracle_se2_multiaz'.freeze => ORACLE_SE2_MULTIAZ,
|
45
132
|
# Oracle SE2 BYOL prices are copied from Enterprise BYOL prices and not collected
|
46
133
|
# (so no need to add rds-price-list.rb)
|
47
|
-
'oracle_se2_byol' =>
|
48
|
-
'oracle_se2_byol_multiaz' =>
|
134
|
+
'oracle_se2_byol'.freeze => ORACLE_SE2_BYOL_STANDARD,
|
135
|
+
'oracle_se2_byol_multiaz'.freeze => ORACLE_SE2_BYOL_MULTIAZ,
|
49
136
|
}
|
50
137
|
|
51
138
|
@@Display_Name_To_Qualified_Database_Name = @@Database_Name_Lookup.invert
|
52
139
|
|
53
140
|
@@ProductDescription = {
|
54
|
-
'mysql' => 'mysql_standard',
|
55
|
-
'mysql_multiaz' => 'mysql_multiaz',
|
56
|
-
'postgres' => 'postgresql_standard',
|
57
|
-
'postgres_multiaz' => 'postgresql_multiaz',
|
58
|
-
'postgresql' => 'postgresql_standard',
|
59
|
-
'postgresql_multiaz' => 'postgresql_multiaz',
|
60
|
-
'oracle-se(byol)' => 'oracle_se_byol',
|
61
|
-
'oracle-se(byol)_multiaz' => 'oracle_se_byol_multiaz',
|
62
|
-
'oracle-ee(byol)' => 'oracle_ee_byol',
|
63
|
-
'oracle-ee(byol)_multiaz' => 'oracle_ee_byol_multiaz',
|
64
|
-
'oracle-se1(li)' => 'oracle_se1_standard',
|
65
|
-
'oracle-se1(li)_multiaz' => 'oracle_se1_multiaz',
|
66
|
-
'oracle-se1(byol)' => 'oracle_se1_byol',
|
67
|
-
'oracle-se1(byol)_multiaz' => 'oracle_se1_byol_multiaz',
|
68
|
-
'oracle-se2(li)' => 'oracle_se2_standard',
|
69
|
-
'oracle-se2(li)_multiaz' => 'oracle_se2_multiaz',
|
70
|
-
'oracle-se2(byol)' => 'oracle_se2_byol',
|
71
|
-
'oracle-se2(byol)_multiaz' => 'oracle_se2_byol_multiaz',
|
72
|
-
'sqlserver-ee(byol)' => 'sqlserver_ee_byol',
|
73
|
-
'sqlserver-ee(byol)_multiaz' => 'sqlserver_ee_byol_multiaz',
|
74
|
-
'sqlserver-ee(li)' => 'sqlserver_ee_standard',
|
75
|
-
'sqlserver-ee(li)_multiaz' => 'sqlserver_ee_multiaz',
|
76
|
-
'sqlserver-ex(li)' => 'sqlserver_ex',
|
77
|
-
'sqlserver-se(byol)' => 'sqlserver_se_byol',
|
78
|
-
'sqlserver-se(byol)_multiaz' => 'sqlserver_se_byol_multiaz',
|
79
|
-
'sqlserver-se(li)' => 'sqlserver_se_standard',
|
80
|
-
'sqlserver-se(li)_multiaz' => 'sqlserver_se_multiaz',
|
81
|
-
'sqlserver-web(li)' => 'sqlserver_web',
|
82
|
-
'aurora' => 'aurora_standard',
|
83
|
-
'
|
84
|
-
'
|
141
|
+
'mysql'.freeze => 'mysql_standard'.freeze,
|
142
|
+
'mysql_multiaz'.freeze => 'mysql_multiaz'.freeze,
|
143
|
+
'postgres'.freeze => 'postgresql_standard'.freeze,
|
144
|
+
'postgres_multiaz'.freeze => 'postgresql_multiaz'.freeze,
|
145
|
+
'postgresql'.freeze => 'postgresql_standard'.freeze,
|
146
|
+
'postgresql_multiaz'.freeze => 'postgresql_multiaz'.freeze,
|
147
|
+
'oracle-se(byol)'.freeze => 'oracle_se_byol'.freeze,
|
148
|
+
'oracle-se(byol)_multiaz'.freeze => 'oracle_se_byol_multiaz'.freeze,
|
149
|
+
'oracle-ee(byol)'.freeze => 'oracle_ee_byol'.freeze,
|
150
|
+
'oracle-ee(byol)_multiaz'.freeze => 'oracle_ee_byol_multiaz'.freeze,
|
151
|
+
'oracle-se1(li)'.freeze => 'oracle_se1_standard'.freeze,
|
152
|
+
'oracle-se1(li)_multiaz'.freeze => 'oracle_se1_multiaz'.freeze,
|
153
|
+
'oracle-se1(byol)'.freeze => 'oracle_se1_byol'.freeze,
|
154
|
+
'oracle-se1(byol)_multiaz'.freeze => 'oracle_se1_byol_multiaz'.freeze,
|
155
|
+
'oracle-se2(li)'.freeze => 'oracle_se2_standard'.freeze,
|
156
|
+
'oracle-se2(li)_multiaz'.freeze => 'oracle_se2_multiaz'.freeze,
|
157
|
+
'oracle-se2(byol)'.freeze => 'oracle_se2_byol'.freeze,
|
158
|
+
'oracle-se2(byol)_multiaz'.freeze => 'oracle_se2_byol_multiaz'.freeze,
|
159
|
+
'sqlserver-ee(byol)'.freeze => 'sqlserver_ee_byol'.freeze,
|
160
|
+
'sqlserver-ee(byol)_multiaz'.freeze => 'sqlserver_ee_byol_multiaz'.freeze,
|
161
|
+
'sqlserver-ee(li)'.freeze => 'sqlserver_ee_standard'.freeze,
|
162
|
+
'sqlserver-ee(li)_multiaz'.freeze => 'sqlserver_ee_multiaz'.freeze,
|
163
|
+
'sqlserver-ex(li)'.freeze => 'sqlserver_ex'.freeze,
|
164
|
+
'sqlserver-se(byol)'.freeze => 'sqlserver_se_byol'.freeze,
|
165
|
+
'sqlserver-se(byol)_multiaz'.freeze => 'sqlserver_se_byol_multiaz'.freeze,
|
166
|
+
'sqlserver-se(li)'.freeze => 'sqlserver_se_standard'.freeze,
|
167
|
+
'sqlserver-se(li)_multiaz'.freeze => 'sqlserver_se_multiaz'.freeze,
|
168
|
+
'sqlserver-web(li)'.freeze => 'sqlserver_web'.freeze,
|
169
|
+
'aurora'.freeze => 'aurora_standard'.freeze,
|
170
|
+
'aurora-postgresql'.freeze => 'aurora_postgresql_standard'.freeze,
|
171
|
+
'mariadb'.freeze => 'mariadb_standard'.freeze,
|
172
|
+
'mariadb_multiaz'.freeze => 'mariadb_multiaz'.freeze,
|
85
173
|
}
|
86
174
|
|
87
175
|
@@DB_Deploy_Types = {
|
@@ -93,7 +181,8 @@ module AwsPricing
|
|
93
181
|
:oracle_ee => [:byol, :byol_multiaz],
|
94
182
|
:sqlserver_se => [:standard, :multiaz, :byol, :byol_multiaz],
|
95
183
|
:sqlserver_ee => [:byol, :byol_multiaz, :standard, :multiaz],
|
96
|
-
:aurora => [:standard],
|
184
|
+
:aurora => [:standard, :multiaz], # checking to see distinguished standard/multiaz
|
185
|
+
:aurora_postgresql => [:standard, :multiaz],
|
97
186
|
:mariadb => [:standard, :multiaz],
|
98
187
|
}
|
99
188
|
|
@@ -103,7 +192,7 @@ module AwsPricing
|
|
103
192
|
|
104
193
|
def self.get_database_name
|
105
194
|
[:mysql, :postgresql, :oracle_se1, :oracle_se, :oracle_ee, :sqlserver_ex, :sqlserver_web,
|
106
|
-
:sqlserver_se, :sqlserver_ee, :aurora, :mariadb,
|
195
|
+
:sqlserver_se, :sqlserver_ee, :aurora, :aurora_postgresql, :mariadb,
|
107
196
|
:oracle_se2 # oracle_se2 license included prices are collected, and BYOL prices are copied from oracle_se
|
108
197
|
]
|
109
198
|
end
|
@@ -143,7 +232,63 @@ module AwsPricing
|
|
143
232
|
database_name.include? 'byol'
|
144
233
|
end
|
145
234
|
|
146
|
-
|
235
|
+
# example: database_sf?('MySQL Community Edition (Multi-AZ)') returns true
|
236
|
+
# Returns BOOL if database string is RDS SF
|
237
|
+
# params:
|
238
|
+
# - display_name[String]: fully qualified database string
|
239
|
+
def self.database_sf?(display_name)
|
240
|
+
db = @@DB_ENGINE_MAP[display_name]
|
241
|
+
return false unless db # unknown db is presumed non sf
|
242
|
+
db[:sizeflex]
|
243
|
+
end
|
244
|
+
# example: operation_sf?('CreateDBInstance:0016',true) returns true
|
245
|
+
# Returns BOOL if operation string is RDS SF
|
246
|
+
# params:
|
247
|
+
# - operation_name[String]: fully qualified operation string
|
248
|
+
# - multiaz[bool]: if operation is multi-az (api for consistency purposes)
|
249
|
+
def self.operation_sf?(operation_name,multiaz=false)
|
250
|
+
display_name = @@DB_OPERATION_TO_DESCRIPTION[operation_name]
|
251
|
+
return false unless display_name # unknown operation is presumed non sf
|
252
|
+
self.database_sf?(display_name)
|
253
|
+
end
|
254
|
+
|
255
|
+
# example: database_multiaz?('MySQL Community Edition (Multi-AZ)') returns true
|
256
|
+
# Returns BOOL if database string is RDS SF
|
257
|
+
# params:
|
258
|
+
# - operation_name[String]: fully qualified operation string
|
259
|
+
def self.database_multiaz?(display_name)
|
260
|
+
db = @@DB_ENGINE_MAP[display_name]
|
261
|
+
return false unless db # unknown db is presumed non sf
|
262
|
+
db[:multiaz]
|
263
|
+
end
|
264
|
+
# self.operation_multiaz? not possible since az not encoded in `operation`
|
265
|
+
|
266
|
+
# example: database_nf('MySQL Community Edition (Multi-AZ)') returns 2
|
267
|
+
# Returns INT (nf factor) for given database string
|
268
|
+
# params:
|
269
|
+
# - operation_name[String]: fully qualified operation string
|
270
|
+
def self.database_nf(display_name)
|
271
|
+
db = @@DB_ENGINE_MAP[display_name]
|
272
|
+
return 1 unless db # unknown db is presumed non sf
|
273
|
+
return 2 if db[:sizeflex] && db[:multiaz]
|
274
|
+
|
275
|
+
1
|
276
|
+
end
|
277
|
+
# example: database_nf('MySQL Community Edition (Multi-AZ)',true) returns 2
|
278
|
+
# i.e. inst_nf = RDS_NF[inst_size] * operation_nf(operation_name,multiaz)
|
279
|
+
# Returns INT (nf factor) for given operation string and multiaz
|
280
|
+
# params:
|
281
|
+
# - operation_name[String]: fully qualified operation string
|
282
|
+
# - multiaz[bool]: if operation is multi-az
|
283
|
+
def self.operation_nf(operation_name, multiaz)
|
284
|
+
display_name = @@DB_OPERATION_TO_DESCRIPTION[operation_name]
|
285
|
+
return 1 unless display_name # unknown operation is presumed non sf
|
286
|
+
return 2 if self.operation_sf?(operation_name,multiaz) && multiaz
|
287
|
+
|
288
|
+
1
|
289
|
+
end
|
290
|
+
|
291
|
+
def display_name
|
147
292
|
self.class.display_name(name)
|
148
293
|
end
|
149
294
|
end
|
@@ -31,6 +31,68 @@ describe AwsPricing::RdsPriceList do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe 'rds_sf_database' do
|
35
|
+
it "verifies RDS SF api for database name" do
|
36
|
+
# tests database display_name APIs {database_sf?, database_multiaz?, database_nf},
|
37
|
+
# and also adds indirect testing of #db_mapping too
|
38
|
+
product_name = 'oracle-se2(byol)' # known RDS SF multiaz example: 'Oracle Database Standard Edition Two (BYOL Multi-AZ)'
|
39
|
+
multiaz = true
|
40
|
+
display_name = AwsPricing::DatabaseType.db_mapping(product_name, multiaz)
|
41
|
+
puts "rds_sf_database-1: display_name:#{display_name}"
|
42
|
+
#
|
43
|
+
expect(AwsPricing::DatabaseType.database_sf?(display_name)).to be true
|
44
|
+
expect(AwsPricing::DatabaseType.database_multiaz?(display_name)).to be true
|
45
|
+
expect(AwsPricing::DatabaseType.database_nf(display_name)).to eq(2)
|
46
|
+
|
47
|
+
product_name = 'sqlserver-se(byol)' # known NOT RDS SF example: 'Microsoft SQL Server Standard Edition (BYOL)'
|
48
|
+
multiaz = false
|
49
|
+
display_name = AwsPricing::DatabaseType.db_mapping(product_name, multiaz)
|
50
|
+
puts "rds_sf_database-2: display_name:#{display_name}"
|
51
|
+
#
|
52
|
+
expect(AwsPricing::DatabaseType.database_sf?(display_name)).to be false
|
53
|
+
expect(AwsPricing::DatabaseType.database_multiaz?(display_name)).to be false
|
54
|
+
expect(AwsPricing::DatabaseType.database_nf(display_name)).to eq(1)
|
55
|
+
|
56
|
+
display_name = 'NuoDB' # unknown db, returns default non RDS SF values
|
57
|
+
#
|
58
|
+
expect(AwsPricing::DatabaseType.database_sf?(display_name)).to be false
|
59
|
+
expect(AwsPricing::DatabaseType.database_multiaz?(display_name)).to be false
|
60
|
+
expect(AwsPricing::DatabaseType.database_nf(display_name)).to eq(1)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'rds_sf_operation' do
|
65
|
+
it "verifies RDS SF api for operation name" do
|
66
|
+
# tests operation name APIs {operation_sf?, operation_nf}
|
67
|
+
operation_name = 'CreateDBInstance:0002' # known RDS SF: 'MySQL Community Edition (Multi-AZ)'
|
68
|
+
multiaz = true
|
69
|
+
#
|
70
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be true
|
71
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name, multiaz)).to eq(2)
|
72
|
+
multiaz = false
|
73
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be true
|
74
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name, multiaz)).to eq(1) #multiaz *not* encoded in operation_name
|
75
|
+
|
76
|
+
operation_name = 'CreateDBInstance:0008' # known non RDS SF: 'Microsoft SQL Server Standard Edition (BYOL)'
|
77
|
+
multiaz = false
|
78
|
+
#
|
79
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be false
|
80
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name, multiaz)).to eq(1)
|
81
|
+
multiaz = true
|
82
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be false
|
83
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name, multiaz)).to eq(1) #multiaz *not* encoded in operation_name
|
84
|
+
|
85
|
+
operation_name = 'CreateDBInstance:9999' # unknown operation, returns default non RDS SF values
|
86
|
+
multiaz = false
|
87
|
+
#
|
88
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be false
|
89
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name,multiaz)).to eq(1)
|
90
|
+
multiaz = true
|
91
|
+
expect(AwsPricing::DatabaseType.operation_sf?(operation_name, multiaz)).to be false
|
92
|
+
expect(AwsPricing::DatabaseType.operation_nf(operation_name,multiaz)).to eq(1) #multiaz *not* encoded in operation_name
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
34
96
|
describe 'get_breakeven_months' do
|
35
97
|
it "test_fetch_all_breakeven_months" do
|
36
98
|
@pricing.regions.each do |region|
|
@@ -63,4 +125,4 @@ describe AwsPricing::RdsPriceList do
|
|
63
125
|
end
|
64
126
|
end
|
65
127
|
end
|
66
|
-
end
|
128
|
+
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.99
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Kinsella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
14
14
|
email:
|