-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_common.tf
380 lines (373 loc) · 18.5 KB
/
_common.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
locals {
common_tags = {
managed-by = "Terraform"
}
records = {
for record in var.records :
# Keys should be name_<TYPE>/<set_identifier>
# check to see if there is a set_identifier, if so, attach to the record key
record.set_identifier != null ? "${record.name}_${record.type}/${record.set_identifier}" : "${record.name}_${record.type}" =>
{
name = record.name
type = record.type
values = record.values
health_check_id = record.health_check_id
ttl = record.ttl
set_identifier = record.set_identifier
alias = record.alias
failover_routing_policy = record.failover_routing_policy
geolocation_routing_policy = record.geolocation_routing_policy
geoproximity_routing_policy = record.geoproximity_routing_policy
latency_routing_policy = record.latency_routing_policy
multivalue_answer_routing_policy = record.multivalue_answer_routing_policy
weighted_routing_policy = record.weighted_routing_policy
health_check = record.health_check
}
}
# replace . to - in the domain name so it can be used to prefix other resources if needed
prefix = replace(var.domain_name, ".", "-")
continents = {
"Africa" = "AF"
"Antarctica" = "AN"
"Asia" = "AS"
"Europe" = "EU"
"Oceania" = "OC"
"North America" = "NA"
"South America" = "SA"
}
countries = {
"Default" = "*"
"Andorra" = "AD"
"United Arab Emirates" = "AE"
"Afghanistan" = "AF"
"Antigua And Barbuda" = "AG"
"Anguilla" = "AI"
"Albania" = "AL"
"Armenia" = "AM"
"Angola" = "AO"
"Antarctica" = "AQ"
"Argentina" = "AR"
"American Samoa" = "AS"
"Austria" = "AT"
"Australia" = "AU"
"Aruba" = "AW"
"Aland" = "AX"
"Azerbaijan" = "AZ"
"Bosnia And Herzegovina" = "BA"
"Barbados" = "BB"
"Bangladesh" = "BD"
"Belgium" = "BE"
"Burkina Faso" = "BF"
"Bulgaria" = "BG"
"Bahrain" = "BH"
"Burundi" = "BI"
"Benin" = "BJ"
"Saint Barthelemy" = "BL"
"Bermuda" = "BM"
"Brunei" = "BN"
"Bolivia" = "BO"
"Bonaire" = "BQ"
"Brazil" = "BR"
"Bahamas" = "BS"
"Bhutan" = "BT"
"Botswana" = "BW"
"Belarus" = "BY"
"Belize" = "BZ"
"Canada" = "CA"
"Cocos [Keeling] Islands" = "CC"
"Congo" = "CG"
"Central African Republic" = "CF"
"Republic Of The Congo" = "CD"
"Switzerland" = "CH"
"Ivory Coast" = "CI"
"Cook Islands" = "CK"
"Chile" = "CL"
"Cameroon" = "CM"
"China" = "CN"
"Colombia" = "CO"
"Costa Rica" = "CR"
"Cuba" = "CU"
"Cape Verde" = "CV"
"Curacao" = "CW"
"Cyprus" = "CY"
"Czech Republic" = "CZ"
"Germany" = "DE"
"Djibouti" = "DJ"
"Denmark" = "DK"
"Dominica" = "DM"
"Dominican Republic" = "DO"
"Algeria" = "DZ"
"Ecuador" = "EC"
"Estonia" = "EE"
"Egypt" = "EG"
"Eritrea" = "ER"
"Spain" = "ES"
"Ethiopia" = "ET"
"Finland" = "FI"
"Fiji" = "FJ"
"Falkland Islands" = "FK"
"Federated States Of Micronesia" = "FM"
"Faroe Islands" = "FO"
"France" = "FR"
"Gabon" = "GA"
"United Kingdom" = "GB"
"Grenada" = "GD"
"Georgia" = "GE"
"French Guiana" = "GF"
"Guernsey" = "GG"
"Ghana" = "GH"
"Gibraltar" = "GI"
"Greenland" = "GL"
"Gambia" = "GM"
"Guinea" = "GN"
"Guadeloupe" = "GP"
"Equatorial Guinea" = "GQ"
"Greece" = "GR"
"South Georgia And The South Sandwich Islands" = "GS"
"Guatemala" = "GT"
"Guam" = "GU"
"Guinea-Bissau" = "GW"
"Guyana" = "GY"
"Hong Kong" = "HK"
"Honduras" = "HN"
"Croatia" = "HR"
"Haiti" = "HT"
"Hungary" = "HU"
"Indonesia" = "ID"
"Ireland" = "IE"
"Israel" = "IL"
"Isle Of Man" = "IM"
"India" = "IN"
"British Indian Ocean Territory" = "IO"
"Iraq" = "IQ"
"Iran" = "IR"
"Iceland" = "IS"
"Italy" = "IT"
"Jersey" = "JE"
"Jamaica" = "JM"
"Hashemite Kingdom Of Jordan" = "JO"
"Japan" = "JP"
"Kenya" = "KE"
"Kyrgyzstan" = "KG"
"Cambodia" = "KH"
"Kiribati" = "KI"
"Comoros" = "KM"
"Saint Kitts And Nevis" = "KN"
"North Korea" = "KP"
"Republic Of Korea" = "KR"
"Kuwait" = "KW"
"Cayman Islands" = "KY"
"Kazakhstan" = "KZ"
"Laos" = "LA"
"Lebanon" = "LB"
"Saint Lucia" = "LC"
"Liechtenstein" = "LI"
"Sri Lanka" = "LK"
"Liberia" = "LR"
"Lesotho" = "LS"
"Lithuania" = "LT"
"Luxembourg" = "LU"
"Latvia" = "LV"
"Libya" = "LY"
"Morocco" = "MA"
"Monaco" = "MC"
"Republic Of Moldova" = "MD"
"Montenegro" = "ME"
"Saint Martin" = "MF"
"Madagascar" = "MG"
"Marshall Islands" = "MH"
"Macedonia" = "MK"
"Mali" = "ML"
"Myanmar [Burma]" = "MM"
"Mongolia" = "MN"
"Macao" = "MO"
"Northern Mariana Islands" = "MP"
"Martinique" = "MQ"
"Mauritania" = "MR"
"Montserrat" = "MS"
"Malta" = "MT"
"Mauritius" = "MU"
"Maldives" = "MV"
"Malawi" = "MW"
"Mexico" = "MX"
"Malaysia" = "MY"
"Mozambique" = "MZ"
"Namibia" = "NA"
"New Caledonia" = "NC"
"Niger" = "NE"
"Norfolk Island" = "NF"
"Nigeria" = "NG"
"Nicaragua" = "NI"
"Netherlands" = "NL"
"Norway" = "NO"
"Nepal" = "NP"
"Nauru" = "NR"
"Niue" = "NU"
"New Zealand" = "NZ"
"Oman" = "OM"
"Panama" = "PA"
"Peru" = "PE"
"French Polynesia" = "PF"
"Papua New Guinea" = "PG"
"Philippines" = "PH"
"Pakistan" = "PK"
"Poland" = "PL"
"Saint Pierre And Miquelon" = "PM"
"Pitcairn Islands" = "PN"
"Puerto Rico" = "PR"
"Palestine" = "PS"
"Portugal" = "PT"
"Palau" = "PW"
"Paraguay" = "PY"
"Qatar" = "QA"
"Reunion" = "RE"
"Romania" = "RO"
"Serbia" = "RS"
"Russian" = "RU"
"Rwanda" = "RW"
"Saudi Arabia" = "SA"
"Solomon Islands" = "SB"
"Seychelles" = "SC"
"Sudan" = "SD"
"Sweden" = "SE"
"Singapore" = "SG"
"Saint Helena" = "SH"
"Slovenia" = "SI"
"Svalbard And Jan Mayen" = "SJ"
"Slovakia" = "SK"
"Sierra Leone" = "SL"
"San Marino" = "SM"
"Senegal" = "SN"
"Somalia" = "SO"
"Suriname" = "SR"
"South Sudan" = "SS"
"Sao Tome And Principe" = "ST"
"El Salvador" = "SV"
"Sint Maarten" = "SX"
"Syria" = "SY"
"Swaziland" = "SZ"
"Turks And Caicos Islands" = "TC"
"Chad" = "TD"
"French Southern Territories" = "TF"
"Togo" = "TG"
"Thailand" = "TH"
"Tajikistan" = "TJ"
"Tokelau" = "TK"
"East Timor" = "TL"
"Turkmenistan" = "TM"
"Tunisia" = "TN"
"Tonga" = "TO"
"Turkey" = "TR"
"Trinidad And Tobago" = "TT"
"Tuvalu" = "TV"
"Taiwan" = "TW"
"Tanzania" = "TZ"
"Ukraine" = "UA"
"Uganda" = "UG"
"U.S. Minor Outlying Islands" = "UM"
"United States" = "US"
"Uruguay" = "UY"
"Uzbekistan" = "UZ"
"Vatican City" = "VA"
"Saint Vincent And The Grenadines" = "VC"
"Venezuela" = "VE"
"British Virgin Islands" = "VG"
"U.S. Virgin Islands" = "VI"
"Vietnam" = "VN"
"Vanuatu" = "VU"
"Wallis And Futuna" = "WF"
"Samoa" = "WS"
"Kosovo" = "XK"
"Yemen" = "YE"
"Mayotte" = "YT"
"South Africa" = "ZA"
"Zambia" = "ZM"
"Zimbabwe" = "ZW"
}
# CountryCode = "US"
united_states_subdivisions = {
"Alabama" = "AL"
"Alaska" = "AK"
"Arizona" = "AZ"
"Arkansas" = "AR"
"California" = "CA"
"Colorado" = "CO"
"Connecticut" = "CT"
"Delaware" = "DE"
"District Of Columbia" = "DC"
"Florida" = "FL"
"Georgia" = "GA"
"Hawaii" = "HI"
"Idaho" = "ID"
"Illinois" = "IL"
"Indiana" = "IN"
"Iowa" = "IA"
"Kansas" = "KS"
"Kentucky" = "KY"
"Louisiana" = "LA"
"Maine" = "ME"
"Maryland" = "MD"
"Massachusetts" = "MA"
"Michigan" = "MI"
"Minnesota" = "MN"
"Mississippi" = "MS"
"Missouri" = "MO"
"Montana" = "MT"
"Nebraska" = "NE"
"Nevada" = "NV"
"New Hampshire" = "NH"
"New Jersey" = "NJ"
"New Mexico" = "NM"
"New York" = "NY"
"North Carolina" = "NC"
"North Dakota" = "ND"
"Ohio" = "OH"
"Oklahoma" = "OK"
"Oregon" = "OR"
"Pennsylvania" = "PA"
"Rhode Island" = "RI"
"South Carolina" = "SC"
"South Dakota" = "SD"
"Tennessee" = "TN"
"Texas" = "TX"
"Utah" = "UT"
"Vermont" = "VT"
"Virginia" = "VA"
"Washington" = "WA"
"West Virginia" = "WV"
"Wisconsin" = "WI"
"Wyoming" = "WY"
}
# CountryCode = "UA"
ukraine_subdivisions = {
"Vinnytska Oblast" = "05"
"Volynska Oblast" = "07"
"Luhanska Oblast" = "09"
"Crimea" = "43"
"Dnipropetrovska Oblast" = "12"
"Donetska Oblast" = "14"
"Zhytomyrska Oblast" = "18"
"Sevastopol" = "40"
"Zakarpatska Oblast" = "21"
"Zaporizka Oblast" = "23"
"Ivano-Frankivska Oblast" = "26"
"Kyiv" = "30"
"Kyivska Oblast" = "32"
"Kirovohradska Oblast" = "35"
"Lvivska Oblast" = "46"
"Mykolaivska Oblast" = "48"
"Odeska Oblast" = "51"
"Poltavska Oblast" = "53"
"Rivnenska Oblast" = "56"
"Sumska Oblast" = "59"
"Ternopilska Oblast" = "61"
"Kharkivska Oblast" = "63"
"Khersonska Oblast" = "65"
"Khmelnytska Oblast" = "68"
"Cherkaska Oblast" = "71"
"Chernihivska Oblast" = "74"
"Chernivetska Oblast" = "77"
}
}