微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Terraform MySQL提供程序“错误:无法安装提供程序”

如何解决Terraform MySQL提供程序“错误:无法安装提供程序”

开始“ 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"
  }
}

解决方法

根据提示,尝试运行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"
    }
  }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。