Google Cloud CloudSQL实例无法使用带有错误的Terraform提供商创建“每个产品人为标题服务”帐户。

发布于 2025-02-13 23:09:28 字数 1798 浏览 0 评论 0原文

我们正在尝试使用具有私有IP的Google-Beta提供商来部署云SQL(MSSQL)实例,大约四到五分钟后,它失败并引发了错误 ”错误等待创建实例: - 未找到“ ”的人为项目的服务帐户,

我能够通过Cloud Shell CLI并在控制台中手动创建一个云SQL实例。

有人以前遇到过这个问题吗?

如果您查看控制台中错误的资源,它似乎主要创建,但显示了此错误。

resource "google_sql_database_instance" "cloud_sql_instance" {

  provider = google-beta

  name             = var.cloud_sql_instance_name
  region           = var.gcp_region
  database_version = var.cloud_sql_version
  root_password    = "wearenothardcodingplaceholdertest"
  deletion_protection = var.delete_protection_enabled
  project         = var.gcp_project


  settings {
    tier = var.cloud_sql_compute_tier
    availability_type = var.cloud_sql_availibility_type
    collation = var.cloud_sql_collation
    disk_autoresize = var.cloud_sql_auto_disk_resize
    disk_type = var.cloud_sql_disk_type

    active_directory_config {
      domain = var.active_directory_domain
    }

    backup_configuration {
      enabled = var.cloud_sql_backup_enabled
      start_time = var.cloud_sql_backup_starttime
      point_in_time_recovery_enabled = var.cloud_sql_pitr_enabled
      transaction_log_retention_days = var.cloud_sql_log_retention_days

      backup_retention_settings {
        retained_backups = var.cloud_sql_backup_retention_number
        retention_unit = var.cloud_sql_backup_retention_unit
      }

    }

    ip_configuration {
      ipv4_enabled    = var.cloud_sql_backup_public_ip
      private_network = data.google_compute_network.vpc_connection.self_link
      require_ssl = var.cloud_sql_backup_require_ssl
      allocated_ip_range = var.cloud_sql_ip_range_name
    }

    maintenance_window {
      day = var.cloud_sql_patch_day
      hour = var.cloud_sql_patch_hour
      update_track = "stable"
    }

  }
}

We're trying to deploy a Cloud SQL (MSSQL) instance using the google-beta provider with a private IP and after roughly four to five minutes it fails and throws the error "Error waiting for Create Instance: Per-Product Per-Project Service Account is not found"

I am able to create a Cloud SQL instance using the service account via the Cloud Shell CLI and manually in Console.

Has anyone encountered this before and can they provide any insights as to what may be going wrong?

If you look at the errored out resource in console, it appears to have mostly created but this error is shown.

resource "google_sql_database_instance" "cloud_sql_instance" {

  provider = google-beta

  name             = var.cloud_sql_instance_name
  region           = var.gcp_region
  database_version = var.cloud_sql_version
  root_password    = "wearenothardcodingplaceholdertest"
  deletion_protection = var.delete_protection_enabled
  project         = var.gcp_project


  settings {
    tier = var.cloud_sql_compute_tier
    availability_type = var.cloud_sql_availibility_type
    collation = var.cloud_sql_collation
    disk_autoresize = var.cloud_sql_auto_disk_resize
    disk_type = var.cloud_sql_disk_type

    active_directory_config {
      domain = var.active_directory_domain
    }

    backup_configuration {
      enabled = var.cloud_sql_backup_enabled
      start_time = var.cloud_sql_backup_starttime
      point_in_time_recovery_enabled = var.cloud_sql_pitr_enabled
      transaction_log_retention_days = var.cloud_sql_log_retention_days

      backup_retention_settings {
        retained_backups = var.cloud_sql_backup_retention_number
        retention_unit = var.cloud_sql_backup_retention_unit
      }

    }

    ip_configuration {
      ipv4_enabled    = var.cloud_sql_backup_public_ip
      private_network = data.google_compute_network.vpc_connection.self_link
      require_ssl = var.cloud_sql_backup_require_ssl
      allocated_ip_range = var.cloud_sql_ip_range_name
    }

    maintenance_window {
      day = var.cloud_sql_patch_day
      hour = var.cloud_sql_patch_hour
      update_track = "stable"
    }

  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦欢 2025-02-20 23:09:28

我只是遇到了这个问题。您需要为sqladmin.googleapis.com创建服务身份。

resource "google_project_service_identity" "cloudsql_sa" {
  provider = google-beta

  project = "cool-project"
  service = "sqladmin.googleapis.com"
}

I just ran into this issue. You need to create a Service Identity for sqladmin.googleapis.com.

resource "google_project_service_identity" "cloudsql_sa" {
  provider = google-beta

  project = "cool-project"
  service = "sqladmin.googleapis.com"
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文