Hello, need help about this topic , i was trying to run the pipeline i created in AzureDevOps, and at the end it gave this error, any tips to solve it ? Thanks
│ Error: Invalid resource type
│
│ on mysql.tf line 1, in resource “azurerm_mysql_flexible_server” “mysqlserver”:
│ 1: resource “azurerm_mysql_flexible_server” “mysqlserver” {
│
│ The provider hashicorp/azurerm does not support resource type
│ “azurerm_mysql_flexible_server”.
╵
@sdwfrost
The above problem will have been caused by the provider version (2.46.1 in the above example) not supporting the azurerm_mysql_flexible_server as per the error message.
The azurerm_mysql_flexible_server resource was available from azurerm provider version 2.81.0 and later.
Check your azurerm provider version constraint and ensure that it is allowing a later version and that such a version is what is being downloaded during terraform init. If the version constraint is higher but an earlier version is still being downloaded this is likely to due to the Dependency Lock File (.terraform.lock.hcl) so you may need to issue a terraform init -upgrade command to cause terraform to download a newer provider version and update the dependency lock file.
Please be careful - providers versions often have different support for different resources and breaking changes. If you really are using an azurerm provider version earlier than 2.81.0 and jump to a much later version you may see unintended consequences - so ensure to test fully and read the release notes to understand breaking changes. You may need to refactor code!
If this (an old provider version) is not the issue then please open a separate topic so that people can respond without cluttering this old topic with things that may be unrelated to the original poster’s issue.