Closed Sysa closed 1 year ago
Thanks @Sysa for this great issue explanation. I think you're right, region with only "2" chars are mostly regions we don't use for our customers.
Your suggestion about having at least 3 chars to apply TLA logic seems good.
About the module itself, I think it's not big deal having a breaking change along with a new major module version, people using old one can still pin an older version to avoid those changes.
Do you think you can challenge the list and open a Pull-Request?
Thanks @Shr3ps for prompt response!
I'll try to set up a development environment and raise a PR for this. might take a while.
Let's then agree on the definition of a potential feature/fix: -it would completely change the short name naming convention and not have any additional like "short2" or "short_old" to have backwards compatibility. old style short name can be achieved by pinning the right version of the module for it. -it will have a requirement of minimum chars for short-name of a region (let's say 3)
From my side, I'll do additional research about shorting geo names in public/private clouds to make the solution as generic as possible and explore potential edge cases.
Any suggestions are welcome.
Community Note
Hello there, First of all thank you for this module and contributions to it. It is not really a bug but was discovered during usage of the module and caused some problems. So this bug report will contain an explanation of the case, question and possible workarounds. Might be the place to bring up a discussion about possible solutions too.
Default azure sdk/cli does not contain a short region notation (like 3-4 chars) for its locations.
This command gives a brief view on what it has under the hood:
az account list-locations -o table
The
name
field is kind of short name notation but not really short. At this point everyone is up to use their own logic of combination of country+region to make a short name for a location. I believe it is where this terraform module was born initially, to cover such gap in implementation.According to the list of mapping azure regions in this module: https://github.com/claranet/terraform-azurerm-regions/blob/master/REGIONS.md#azure-regions-mapping-list - there is a "Short notation" and it feels all right for most of the popular regions until you start using more regions.
There is also a comprehensive (and boring) list of country codes which can be used as an international reference: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
What is the issue then? Let me pick few regions to highlight my concerns:
List below is from this terraform module ("azure-regions-mapping-list"):
My question is what is the logic behind such naming notation for short region names? I don't see any, please point me to it. I thought it might be something like "at least 3 chars" should represent the region to improve unambiguously of short naming.
I started using this module from EU regions and then spread more to others and found such a misleading logic (in my opinion) which does not give any consistency to what I usually see in different projects/companies. But I might be biased and make only assumptions which also can be wrong. But what I certain know is that I never see the US shortcut as just "U" (except for US Gov-specific regions which usually a 'UG' but in this module for US Gov I see just 'gov' - what?! Because plain 'u' is already in use to reflect regular US regions...)
I don't see any neat solution to that because it will either break already existing naming notations people have (who have been using this module from day 0) or just have another mapping field like
.location_short2
. but what if a person would need a mix of those? I don't know but would like to hear your opinion or suggestion.So far I have dumb workarounds like that to have your own re-mapping in particular places/regions where you need it:
Thank you for your time and again, thank you for this module and contributions to it! Sincerely, Alex
Terraform Version
v1.5.6
AzureRM Provider Version
6.1.0
Affected Resource(s)/Data Source(s)
azurerm_*
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
I expect some straightforward logic for naming convention or written explanation why certain names for regions were picked up.
Actual Behaviour
Misleading short names for regions
Steps to Reproduce
No response
Important Factoids
No response
References
No response