Upgrade Terraform version to latest stable version
Terraform 0.14.4 is the version which we are now using to create the infrastructure.
To upgrade terraform to latest version1.3.4
To upgrade golang version to1.18.8
To upgrade azurerm provider?- To upgrade azuread provider?
This initiative started to get advantage of some of the azurerm features such as the keyvault features, as well to have flexibility in the future to use newer resource attributes which may not be available in current provider version, and the terraform version upgrade it is the first step.
When we started to research destroy scenarios and greenfield scenarios, but noticed that are not available in our current azurerm provider version (2.98) only in azurerm 3.33 ():
key_vault { purge_soft_delete_on_destroy = true recover_soft_deleted_key_vaults = true }
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/features-block
This is affecting destroy scenario.
Motivation behind this (non functional requirements):
- Would recommend to take a look at this: https://www.hashicorp.com/blog/announcing-hashicorp-terraform-1-0-general-availability
- Greater performance, and terraform versions interoperability basically, new features for sensitive strings in state.
- Additionally, it is recommended by azurerm and azuread to upgrade terraform version prior to upgrade provider version.
- We would be able to upgrade provider version.
About golang upgrade:
- golang version is very old and we had seeing that time to time some library is not available anymore for go v1.12 for unit tests (2 years ago)
- Library outdate and compatibility with newer imports versions.
About providers upgrade (possibly would be nice to think about this for the near future):
- Current azurerm version: 2.98.0 / latest 3.33
- Current azuread version: 1.1.1 / latest 2.30 (2 years ago)
- Noticed some recent changes in the resources for azuread provider which are not updated in our modules and may have unexpected behavior in the future like application_ad (we already faced in the past), if you take a look at the resource for recent stable provider version it is not at all related to the module that it is being used in the community module version.
- Removed deprecated attributes in old providers
- Renamed attributes
- Superseded resources (here the resource can be deprecated or removed by the upgraded version)
Eventually, terraform community code will became obsolete if there are changes in the AzureARM api which are not compatible anymore with the azurerm/azuread providers.