开始“ terrain init”序列时遇到此错误。 不确定如何解决。
我尝试过的事情:
terraform 0.13升级。
尝试过更改mysql的固定版本
搜索文档,但找不到类似的问题。
运行“ terraform init”后输出错误
- Finding hashicorp/mysql versions matching ">= 1.5.*"...
Error: Failed to install providers
Could not find required providers, but found possible alternatives:
hashicorp/mysql -> terraform-providers/mysql
If these suggestions look correct, upgrade your configuration with the
following commands:
terraform 0.13upgrade .
terraform 0.13upgrade ..\mysql-module-test\mysql_server
main.tf
provider "mysql" {
alias = "create_users"
endpoint = format("%s:3306", module.mysql_server.primary_fqdn)
username = var.administrator_login
password = var.administrator_password
}
versions.tf
# Configure terraform and azure provider
terraform {
required_version = ">= 0.13.0"
required_providers {
azurerm = ">= 2.25.0"
random = ">= 2.2.0"
mysql = ">= 1.5"
}
}
答案 0 :(得分:0)
根据提示,尝试运行terraform 0.13upgrade
来升级您的配置。版本控制应如下所示,
# Configure terraform and azure provider
terraform {
required_version = ">= 0.13.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 2.25.0"
}
random = {
source = "hashicorp/random"
version = ">= 2.2.0"
}
mysql = {
source = "terraform-providers/mysql"
version = ">= 1.5"
}
}
}