我正在尝试使用 terraform 在 azure 上使用一些默认配置创建 mysql,以下是我的代码。虽然“enforce_gtid_consistency”和“time_zone”正在工作并正在创建,但“gtid_mode”“ON”不起作用我收到以下错误。
resource "azurerm_mysql_server" "main" {
name = var.mysql_server_name != "" ? var.mysql_server_name : "mysql-01-${var.instancesuffix}"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
administrator_login = var.mysql_administrator_login
administrator_login_password = data.mykv.mysql.value
sku_name = var.mysql_sku_name
storage_mb = var.mysql_storage_mb
version = var.mysql_version
auto_grow_enabled = true
backup_retention_days = 7
geo_redundant_backup_enabled = false
infrastructure_encryption_enabled = true
public_network_access_enabled = true
ssl_enforcement_enabled = true
ssl_minimal_tls_version_enforced = "TLS1_2"
lifecycle {
ignore_changes = [tags]
}
threat_detection_policy {
disabled_alerts = []
email_account_admins = false
email_addresses = []
enabled = true
retention_days = 0
}
}
resource "azurerm_mysql_configuration" "time_zone" {
name = "time_zone"
resource_group_name = azurerm_resource_group.main.name
server_name = azurerm_mysql_server.main.name
value = "+00:00"
}
resource "azurerm_mysql_configuration" "enforce_gtid_consistency" {
name = "enforce_gtid_consistency"
resource_group_name = azurerm_resource_group.main.name
server_name = azurerm_mysql_server.main.name
value = "ON"
}
resource "azurerm_mysql_configuration" "gtid_mode" {
name = "gtid_mode"
resource_group_name = azurerm_resource_group.main.name
server_name = azurerm_mysql_server.main.name
value = "ON"
}
Error: waiting for creation of Configuration: (Name "gtid_mode" / Server Name "mysql-01" / Resource Group "myrg-01"): Code="InternalServerError" Message="An unexpected error occured while processing the request. Tracking ID: 'h59fr7f-18uo-90db-tb20-5y65d34btb04'"
on resources.tf line 164, in resource "azurerm_mysql_configuration" "gtid_mode":
164: resource "azurerm_mysql_configuration" "gtid_mode" {