我正在尝试使用terraform创建一个CloudSQL实例,但它甚至没有尝试创建它出现:CloudSQL仪表板没有更改
google_sql_database_instance.db-instance: Still creating... [9m41s elapsed]
google_sql_database_instance.db-instance: Still creating... [9m51s elapsed]
google_sql_database_instance.db-instance: Still creating... [10m1s elapsed]
它最终超时。这是为什么?
resource "google_sql_database_instance" "db-instance" {
# depends_on = [google_service_networking_connection.private-vpc-connection]
name = "sonarqube"
database_version = "POSTGRES_9_6"
region = "asia-southeast1"
settings {
tier = "db-f1-micro"
# ip_configuration {
# private_network = google_compute_network.private-network.self_link
# }
}
}
我什至删除了专用网络部分
答案 0 :(得分:2)
好,所以我设置TF_LOG = DEBUG并看到
2019-11-23T22:04:41.365+0800 [DEBUG] plugin.terraform-provider-google-beta_v3.0.0-beta.1_x4: 2019/11/23 22:04:41 [DEBUG] Dismissed an error as retryable. Waiting for other concurrent Cloud SQL operations to finish - googleapi: Error 409: The instance or operation is not in an appropriate state to handle the request., invalidState
经过一番谷歌搜索,我发现https://github.com/hashicorp/terraform/issues/20972
之所以会发生这种情况,是因为实例名称在删除后最多不能再使用一周。
所以我想问题是因为我正在尝试创建一个使用最近使用过的名称的实例...