hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

Document what API version is being used for Terraform resource #23995

Open inaun opened 11 months ago

inaun commented 11 months ago

Is there an existing issue for this?

Community Note

Description

Attempting to determine what back-end Azure API version is being used for a given resource based on selected provider version is an arduous task. In some cases, finding the API version is just about impossible since it may not be called out in azurerm version history. It should not be this hard!

New or Affected Resource(s)/Data Source(s)

azurerm_all

Potential Terraform Configuration

Include in resource documentation the back-end API version being used. Whenever this version is updated, update the documentation for the impacted version. Don't make us dig through version history notes in hope of finding this important information.

References

No response

tombuildsstuff commented 11 months ago

hey @inaun

Thanks for opening this issue.

Would you mind elaborating on the use-case for this/problem you're looking to solve with this information? From our side this is something we've talked about in the past, but given this would need to be maintained (by hand, at least initially) at this point, this'd be a non-trivial amount of work to document and keep-in-sync at this point in time.

Unfortunately the way that some Services are versioned in the Azure SDK for Go can make determining which API version is being used complicated in some cases (see for example SQL v5.0 which uses multiple API versions internally).

Since that's problematic for other reasons (i.e. determining exactly what's changed on our side), as a part of migrating onto hashicorp/go-azure-sdk we're now switching to use explicit API versions everywhere - as such it should be clearer which resource is using which API version in the future based on the imports for that resource - but I'd be curious to better understand the use-case for adding this to the documentation too.

Thanks!

acm-073 commented 10 months ago

Hi,

just stumbled across this issue while setting up an Azure Application Gateway with terraform. Turns out, depending on the Azure API version used by terraform, some defaults are set differently on the created resource, for example the default TLS policy (see here).

My AppGW has TLS 1.0, 1.1 and 1.2 enabled, which according to the linked documentation is the default for API version < 2023-02-01, whereas TLS 1.2 and 1.3 are enabled by default for API version >= 2023-02-01. So I'm assuming that terraform uses API < 2023-02-01, but this is not documented anywhere.

It would be magnificent if the terraform azurerm provider documentation would explicitly state which API version is used, so that in cases like this it is easier to figure out what is created and why.

(As a side note, it's probably a good idea not to rely on defaults and configure everything explicitly, but that may also be tedious work...)

Regards Albrecht

qfyra commented 4 months ago

Agreed, this is absolutely critical for troubleshooting and for reporting issues to Microsoft.

Use case: Microsoft currently has an outage with APIM deployments. According to the answer by Janani Ramesh MSFT, this occurs in the api-version 2023-03-01-preview. According to one user, it is also present in API version 2022-08-01.

We're using Terraform to deploy APIM instances, and we got the same issue today for several operations, most likely due to this very outage. I need to report that I also have this issue, but I am unable to provide Microsoft with relevant information because the information about which API version was used is not readily available.