dynatrace-oss / terraform-provider-dynatrace

Apache License 2.0
70 stars 35 forks source link

FIPS Country and Region Codes Are Not Standard! #601

Open o6uoq opened 4 days ago

o6uoq commented 4 days ago

Dynatrace states that they use FIPS 10-4 codes, but the API responses and API working logic says otherwise.

Where it says FIPS 10-4 is used:

That should imply that countries like Australia are AS, but AU is actually the correct country code respected by Dynatrace.

There's some use of FIPS e.g. region codes:

❯ curl -s http://efele.net/maps/fips-10/data/fips-414.txt | grep ^AS   
AS00_414_414_country____AUSTRALIA__
AS01_414_414_territory____Australian Capital Territory__
AS02_414_414_state____New South Wales__
AS03_414_414_territory____Northern Territory__
AS04_414_414_state____Queensland__
AS05_414_414_state____South Australia__
AS06_414_414_state____Tasmania__
AS07_414_414_state____Victoria__
AS08_414_414_state____Western Australia__

..but the same does not apply for all countries e.g:

❯ curl -s http://efele.net/maps/fips-10/data/fips-414.txt | grep ^AS   
AS00_414_414_country____AUSTRALIA__
AS01_414_414_territory____Australian Capital Territory__
AS02_414_414_state____New South Wales__
AS03_414_414_territory____Northern Territory__
AS04_414_414_state____Queensland__
AS05_414_414_state____South Australia__
AS06_414_414_state____Tasmania__
AS07_414_414_state____Victoria__
AS08_414_414_state____Western Australia__

Another example is London aka City of London, where they have come up with LND I have NFI.

The drift between Dynatrace documentation, Dynatrace APIs and reality is embarrassing. It circumvents standards, standards in which you proclaim to use, yet no documentation to validate the cross-breeding, hybrid mixmash that is how they currently define country + region codes.

Reinhard-Pilz-Dynatrace commented 3 days ago

Hello @o6uoq

If the documentation of our REST APIs differs from the actual behavior, we need to apologize for the confusion.

The documentation of the Terraform Provider is essentially a mirror of the documentation of the API docs. The same thing applies to the documentation of the Pulumi Provider, which is at its core utilizing the Terraform Provider. Both Providers are pretty much parrotting what the API Docs are stating.

Reading through your comment it appears that there exists a bit of misunderstanding about the country code, though. According to the documentation country code is the Alpha 2 code of the ISO 3166-2 standard. For Australia that is indeed AU. The FIPS 10-4 country code AS for Australia doesn't apply here.

Where I am with you is when it comes to the region code attribute. I've tested out manually what region code is getting generated when creating a couple of Private Synthetic Locations using the WebUI. Specifically for anything in London it appears that the region code ENG is being used here - which doesn't seem to relate in any way to FIPS. Similarly, when trying to create a Synthetic Location via API using the FIPS entry UKH9_407_414_city corporation____London, City of__ and following the documentation, the region code H9 is getting thrown back.

I've reached out to Dynatrace R&D about clarification here. Like you've written, there seems to exist some overlap with the FIPS 10-4 code but it is not clear to what extent.