我使用下面的 Terraform 配置来尝试在 Google Cloud 平台上创建子网和 Cloud SQL MySQL 5.6 实例。
resource "google_compute_network" "default" {
name = "my-default-network"
auto_create_subnetworks = "true"
project = "${google_project.project.project_id}"
}
resource "google_sql_database_instance" "wordpress" {
region = "${var.region}"
database_version = "MYSQL_5_6"
project = "${google_project.project.project_id}"
settings {
tier = "db-n1-standard-1"
ip_configuration {
private_network = "${google_compute_network.default.self_link}"
}
}
}
但是应用这个计划给我带来了以下模糊的错误。我也尝试销毁整个项目并重新构建它,但是我得到了同样的错误。
google_sql_database_instance.wordpress: Still creating... (20s elapsed)
google_sql_database_instance.wordpress: Still creating... (30s elapsed)
google_sql_database_instance.wordpress: Still creating... (40s elapsed)
Error: Error applying plan:
1 error(s) occurred:
* google_sql_database_instance.wordpress: 1 error(s) occurred:
* google_sql_database_instance.wordpress: Error waiting for Create Instance:
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
有人能看出我在这里做错了什么吗?
编辑:
当我在terraform apply
运行时添加TF_LOG=debug
时,我收到以下错误。
"error": {
"kind": "sql#operationErrors",
"errors": [{
"kind": "sql#operationError",
"code": "INTERNAL_ERROR"
}]
}
编辑2:简化了网络设置,但是仍然出现完全相同的错误。