gpt4 book ai didi

google-cloud-platform - 不正确的服务网络配置,例如 : xxxx:SERVICE_NETWORKING_NOT_ENABLED

转载 作者:行者123 更新时间:2023-12-04 02:27:19 36 4
gpt4 key购买 nike

我正在尝试通过 terraform 在 GCP 中复制 SQL 实例。事件实例具有公共(public) IP,但是来自辅助项目的子网与托管 SQL 实例的项目共享,并且 SQL 实例与辅助项目的网络相关联。
我添加了 private_networkip_configuration 中正确设置(我认为)部分,但是我收到以下错误:

Error: Error, failed to create instance xxxx: googleapi: Error 400: Invalid request: Incorrect Service Networking config for instance: xxxx:xxxxx:SERVICE_NETWORKING_NOT_ENABLED., invalid


当我用谷歌搜索该特定错误时,我找不到太多文档,而且我对 Terraform 还比较陌生,所以我希望有人能指出我在 Terraform 配置的这一部分或其他资源中缺少的东西.
resource "google_sql_database_instance" "cloudsql-instance-qa" {
depends_on = [google_project_service.project_apis]
database_version = "MYSQL_5_7"
name = "${var.env_shorthand}-${var.resource_name}"
project = var.project_id
region = var.region

settings {
activation_policy = "ALWAYS"
availability_type = "ZONAL"

backup_configuration {
binary_log_enabled = "true"
enabled = "true"
point_in_time_recovery_enabled = "false"
start_time = "15:00"
}

crash_safe_replication = "false"
disk_autoresize = "true"
disk_size = "5003"
disk_type = "PD_SSD"

ip_configuration {
ipv4_enabled = "true"
private_network = "projects/gcp-backend/global/networks/default"
require_ssl = "false"
}

location_preference {
zone = var.zone
}

maintenance_window {
day = "7"
hour = "4"
}

pricing_plan = "PER_USE"
replication_type = "SYNCHRONOUS"
tier = "db-n1-standard-1"
}
}

最佳答案

如果您看到以下错误:

Error: Error, failed to create instance xxxx: googleapi: Error 400:Invalid request: Incorrect Service Networking config for instance:xxxx:xxxxx:SERVICE_NETWORKING_NOT_ENABLED., invalid


启用服务网络 API:
gcloud services enable servicenetworking.googleapis.com --project=[PSM_PROJECT_NUMBER]
Getting Started with the Service Networking API

关于google-cloud-platform - 不正确的服务网络配置,例如 : xxxx:SERVICE_NETWORKING_NOT_ENABLED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66536427/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com