-
Notifications
You must be signed in to change notification settings - Fork 58
/
regions.tf
372 lines (363 loc) · 16.2 KB
/
regions.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
locals {
location_slug = lookup(zipmap(values(local.regions), keys(local.regions)), var.azure_region, lookup(zipmap(values(local.cli_names), keys(local.cli_names)), var.azure_region, var.azure_region))
# Azure region mapping between slug and standard format.
# Markdown doc generated by: > join("\n", [for slug, region in local.regions: format("| %s | %s | %s | %s | %s | %s |", region, local.cli_names[slug], local.short_names[slug], slug, try(local.paired[slug], "N/A"), try(local.data[slug], "N/A"))])
regions = {
asia-east = "East Asia"
asia-south-east = "Southeast Asia"
aus-central-2 = "Australia Central 2"
aus-central = "Australia Central"
aus-east = "Australia East"
aus-south-east = "Australia Southeast"
bra-south = "Brazil South"
bra-south-east = "Brazil Southeast"
can-central = "Canada Central"
can-east = "Canada East"
cn-east-2 = "China East 2"
cn-east-3 = "China East 3"
cn-east = "China East"
cn-north-2 = "China North 2"
cn-north-3 = "China North 3"
cn-north = "China North"
eu-north = "North Europe"
eu-west = "West Europe"
fr-central = "France Central"
fr-south = "France South"
ger-central = "Germany Central"
ger-north-east = "Germany Northeast"
ger-north = "Germany North"
ger-west-central = "Germany West Central"
ind-central = "Central India"
ind-south = "South India"
ind-west = "West India"
isr-central = "Israel Central"
ita-north = "Italy North"
jap-east = "Japan East"
jap-west = "Japan West"
kor-central = "Korea Central"
kor-south = "Korea South"
norw-east = "Norway East"
norw-west = "Norway West"
pol-central = "Poland Central"
qat-central = "Qatar Central"
saf-north = "South Africa North"
saf-west = "South Africa West"
swe-central = "Sweden Central"
swe-south = "Sweden South"
swz-north = "Switzerland North"
swz-west = "Switzerland West"
uae-central = "UAE Central" # United Arab Emirates
uae-north = "UAE North" # United Arab Emirates
uk-south = "UK South"
uk-west = "UK West"
us-central = "Central US"
us-east-2 = "East US 2"
us-east = "East US"
us-north-central = "North Central US"
us-south-central = "South Central US"
us-west-2 = "West US 2"
us-west-3 = "West US 3"
us-west-central = "West Central US"
us-west = "West US"
# Global/continental zones
"asia" = "Asia"
"asia-pa" = "Asia Pacific"
"aus" = "Australia"
"bra" = "Brazil"
"can" = "Canada"
"eu" = "Europe"
"global" = "Global"
"ind" = "India"
"jap" = "Japan"
"kor" = "Korea"
"nor" = "Norway"
"sgp" = "Singapore"
"swe" = "Sweden"
"uk" = "United Kingdom"
"us" = "United States"
}
/* Short names based on the following rules (where possible) to have better clarity:
- contains at least 3 chars, where 2 chars represent global part (continent)
- use ISO 3166 code of country concatenation
*/
short_names = {
"asia-east" = "asea"
"asia-south-east" = "asse"
"aus-central-2" = "auc2"
"aus-central" = "auc"
"aus-east" = "aue"
"aus-south-east" = "ause"
"bra-south" = "brs"
"bra-south-east" = "brse" # Brazil Southeast
"can-central" = "cac"
"can-east" = "cae"
"cn-east-2" = "cne2"
"cn-east-3" = "cne3"
"cn-east" = "cne"
"cn-north-2" = "cnn2"
"cn-north-3" = "cnn3"
"cn-north" = "cnn"
"eu-north" = "eun"
"eu-west" = "euw"
"fr-central" = "frc"
"fr-south" = "frs"
"ger-central" = "gce"
"ger-north-east" = "gne"
"ger-north" = "gno"
"ger-west-central" = "gwc"
"ind-central" = "inc"
"ind-south" = "ins"
"ind-west" = "inw"
"isr-central" = "ilc"
"ita-north" = "itn"
"jap-east" = "jpe"
"jap-west" = "jpw"
"kor-central" = "krc"
"kor-south" = "krs"
"norw-east" = "noe"
"norw-west" = "now"
"pol-central" = "polc"
"qat-central" = "qatc"
"saf-north" = "san"
"saf-west" = "saw"
"swe-central" = "swec"
"swe-south" = "swes"
"swz-north" = "swn"
"swz-west" = "sww"
"uae-central" = "uaec"
"uae-north" = "uaen"
"uk-south" = "uks"
"uk-west" = "ukw"
"us-central" = "usc"
"us-east-2" = "use2"
"us-east" = "use"
"us-north-central" = "usnc"
"us-south-central" = "ussc"
"us-west-2" = "usw2"
"us-west-3" = "usw3"
"us-west-central" = "uswc"
"us-west" = "usw"
# Global/continental zones
"asia" = "asia" # Asia
"asia-pa" = "apac" # Asia Pacific
"aus" = "aus" # Australia
"bra" = "bra" # Brazil
"can" = "can" # Canada
"eu" = "eu" # Europe
"global" = "glob" # Global
"ind" = "ind" # India
"jap" = "jap" # Japan
"kor" = "kor" # Korea
"nor" = "nor" # Norway
"sgp" = "sgp" # Singapore
"swe" = "swe" # Sweden
"uk" = "uk" # United Kingdom
"us" = "us" # United States
}
# Thoses region CLI name where partially generated via
# `az account list-locations --output json | jq -r '.[] | "\"\" = \"" + .name + "\" # " + .displayName'`
# Markdown doc generated by: > join("\n", [for slug, region in local.regions: format("| %s | %s | %s |", slug, local.cli_names[slug], region)])
cli_names = {
"asia" = "asia" # Asia
"asia-east" = "eastasia" # East Asia
"asia-pa" = "asiapacific" # Asia Pacific
"asia-south-east" = "southeastasia" # Southeast Asia
"aus" = "australia" # Australia
"aus-central-2" = "australiacentral2" # Australia Central 2
"aus-central" = "australiacentral" # Australia Central
"aus-east" = "australiaeast" # Australia East
"aus-south-east" = "australiasoutheast" # Australia Southeast
"bra" = "brazil" # Brazil
"bra-south" = "brazilsouth" # Brazil South
"bra-south-east" = "brazilsoutheast" # Brazil Southeast
"can" = "canada" # Canada
"can-central" = "canadacentral" # Canada Central
"can-east" = "canadaeast" # Canada East
"cn-east-2" = "chinaeast2" # "China East 2"
"cn-east-3" = "chinaeast3" # "China East 3"
"cn-east" = "chinaeast" # "China East"
"cn-north-2" = "chinanorth2" # "China North 2"
"cn-north-3" = "chinanorth3" # "China North 3"
"cn-north" = "chinanorth" # "China North"
"eu" = "europe" # Europe
"eu-north" = "northeurope" # North Europe
"eu-west" = "westeurope" # West Europe
"fr-central" = "francecentral" # France Central
"fr-south" = "francesouth" # France South
"ger-central" = "germanycentral" # Germany Central
"ger-north-east" = "germanynortheast" # Germany Northeast
"ger-north" = "germanynorth" # Germany North
"ger-west-central" = "germanywestcentral" # Germany West Central
"global" = "global" # Global
"ind-central" = "centralindia" # Central India
"ind" = "india" # India
"ind-south" = "southindia" # South India
"ind-west" = "westindia" # West India
"isr-central" = "israelcentral" # Israel Central
"ita-north" = "italynorth" # Italy North
"jap-east" = "japaneast" # Japan East
"jap" = "japan" # Japan
"jap-west" = "japanwest" # Japan West
"kor" = "korea" # Korea
"kor-central" = "koreacentral" # Korea Central
"kor-south" = "koreasouth" # Korea South
"nor" = "norway" # Norway
"norw-east" = "norwayeast" # Norway East
"norw-west" = "norwaywest" # Norway West
"pol-central" = "polandcentral" # Poland Central
"qat-central" = "qatarcentral" # Qatar Central
"saf-north" = "southafricanorth" # South Africa North
"saf-west" = "southafricawest" # South Africa West
"sgp" = "singapore" # Singapore
"swe" = "sweden" # Sweden
"swe-central" = "swedencentral" # Sweden Central
"swe-south" = "swedensouth" # Sweden South
"swz-north" = "switzerlandnorth" # Switzerland North
"swz-west" = "switzerlandwest" # Switzerland West
"uae-central" = "uaecentral" # UAE Central
"uae-north" = "uaenorth" # UAE North
"uk-south" = "uksouth" # UK South
"uk" = "uk" # United Kingdom
"uk-west" = "ukwest" # UK West
"us-central" = "centralus" # Central US
"us-east-2" = "eastus2" # East US 2
"us-east" = "eastus" # East US
"us-north-central" = "northcentralus" # North Central US
"us-south-central" = "southcentralus" # South Central US
"us" = "unitedstates" # United States
"us-west-2" = "westus2" # West US 2
"us-west-3" = "westus3" # West US 3
"us-west-central" = "westcentralus" # West Central US
"us-west" = "westus" # West US
}
# Based on https://docs.microsoft.com/en-us/azure/availability-zones/cross-region-replication-azure
# Can be retrieved by cli too:
# `az account list-locations -o table --query '[].[displayName, name, metadata.pairedRegion[0].name]'`
paired = {
asia-east = "asia-south-east"
asia-south-east = "asia-east"
aus-central-2 = "aus-central"
aus-central = "aus-central-2"
aus-east = "aus-south-east"
aus-south-east = "aus-east"
bra-south-east = "bra-south"
bra-south = "us-south-central"
can-central = "can-east"
can-east = "can-central"
cn-east-2 = "cn-north-2"
cn-east-3 = "cn-north-3"
cn-east = "cn-north"
cn-north-2 = "cn-east-2"
cn-north-3 = "cn-east-3"
cn-north = "cn-east"
eu-north = "eu-west"
eu-west = "eu-north"
fr-central = "fr-south"
fr-south = "fr-central"
ger-north = "ger-west-central"
ger-west-central = "ger-north"
ind-central = "ind-south"
ind-south = "ind-central"
ind-west = "ind-south"
jap-east = "jap-west"
jap-west = "jap-east"
kor-central = "kor-south"
kor-south = "kor-central"
norw-east = "norw-west"
norw-west = "norw-east"
saf-north = "saf-west"
saf-west = "saf-north"
swe-central = "swe-south"
swe-south = "swe-central"
swz-north = "swz-west"
swz-west = "swz-north"
uae-central = "uae-north" # United Arab Emirates
uae-north = "uae-central" # United Arab Emirates
uk-south = "uk-west"
uk-west = "uk-south"
us-central = "us-east-2"
us-east-2 = "us-central"
us-east = "us-west"
us-north-central = "us-south-central"
us-south-central = "us-north-central"
us-west-2 = "us-west-central"
us-west-3 = "us-east"
us-west-central = "us-west-2"
us-west = "us-east"
}
paired_region = try(local.paired[local.location_slug], null)
# Based on https://learn.microsoft.com/en-us/azure/communication-services/concepts/privacy#data-residency
data = {
"asia" = "Asia Pacific" # Asia
"asia-east" = "Asia Pacific" # East Asia
"asia-pa" = "Asia Pacific" # Asia Pacific
"asia-south-east" = "Asia Pacific" # Southeast Asia
"aus" = "Australia" # Australia
"aus-central-2" = "Australia" # Australia Central 2
"aus-central" = "Australia" # Australia Central
"aus-east" = "Australia" # Australia East
"aus-south-east" = "Australia" # Australia Southeast
"bra" = "Brazil" # Brazil
"bra-south" = "Brazil" # Brazil South
"bra-south-east" = "Brazil" # Brazil Southeast
"can" = "Canada" # Canada
"can-central" = "Canada" # Canada Central
"can-east" = "Canada" # Canada East
"cn-east-2" = "Asia Pacific" # "China East 2"
"cn-east-3" = "Asia Pacific" # "China East 3"
"cn-east" = "Asia Pacific" # "China East"
"cn-north-2" = "Asia Pacific" # "China North 2"
"cn-north-3" = "Asia Pacific" # "China North 3"
"cn-north" = "Asia Pacific" # "China North"
"eu" = "Europe" # Europe
"eu-north" = "Europe" # North Europe
"eu-west" = "Europe" # West Europe
"fr-central" = "France" # France Central
"fr-south" = "France" # France South
"ger-central" = "Germany" # Germany Central
"ger-north-east" = "Germany" # Germany Northeast
"ger-north" = "Germany" # Germany North
"ger-west-central" = "Germany" # Germany West Central
"ind-central" = "India" # Central India
"ind" = "India" # India
"ind-south" = "India" # South India
"ind-west" = "India" # West India
"isr-central" = "Asia Pacific" # Israel Central
"ita-north" = "Europe" # Italy North
"jap-east" = "Japan" # Japan East
"jap" = "Japan" # Japan
"jap-west" = "Japan" # Japan West
"kor" = "Korea" # Korea
"kor-central" = "Korea" # Korea Central
"kor-south" = "Korea" # Korea South
"nor" = "Norway" # Norway
"norw-east" = "Norway" # Norway East
"norw-west" = "Norway" # Norway West
"pol-central" = "Europe" # Poland Central
"qat-central" = "UAE" # Qatar Central
"saf-north" = "Africa" # South Africa North
"saf-west" = "Africa" # South Africa West
"sgp" = "Asia Pacific" # Singapore
"swe" = "Europe" # Sweden
"swe-central" = "Europe" # Sweden Central
"swe-south" = "Europe" # Sweden South
"swz-north" = "Switzerland" # Switzerland North
"swz-west" = "Switzerland" # Switzerland West
"uae-central" = "UAE" # UAE Central
"uae-north" = "UAE" # UAE North
"uk-south" = "UAE" # UK South
"uk" = "UK" # United Kingdom
"uk-west" = "UK" # UK West
"us-central" = "United States" # Central US
"us-east-2" = "United States" # East US 2
"us-east" = "United States" # East US
"us-north-central" = "United States" # North Central US
"us-south-central" = "United States" # South Central US
"us" = "United States" # United States
"us-west-2" = "United States" # West US 2
"us-west-3" = "United States" # West US 3
"us-west-central" = "United States" # West Central US
"us-west" = "United States" # West US
}
data_location = try(local.data[local.location_slug], null)
}