Google cloud platform googleapi:错误400:先决条件检查失败,通过Terraform创建云编写器环境时先决条件失败

Google cloud platform googleapi:错误400:先决条件检查失败,通过Terraform创建云编写器环境时先决条件失败,google-cloud-platform,terraform,google-cloud-composer,Google Cloud Platform,Terraform,Google Cloud Composer,我正试图通过Terraform创建Cloud Composer环境,但出现了这个错误 googleapi:错误400:先决条件检查失败,通过Terraform创建云编写器环境时先决条件失败 我试图从中创建composer的VM的服务帐户在GCP项目中具有所有者权限 我从GCP控制台尝试了相同的composer配置,创建的环境没有任何问题 我尝试过禁用CloudComposer API并再次启用它,但没有解决方案 最终,terraform apply第一次尝试创建composer环境,但最终出现版

我正试图通过Terraform创建Cloud Composer环境,但出现了这个错误

googleapi:错误400:先决条件检查失败,通过Terraform创建云编写器环境时先决条件失败

我试图从中创建composer的VM的服务帐户在GCP项目中具有所有者权限

我从GCP控制台尝试了相同的composer配置,创建的环境没有任何问题

我尝试过禁用CloudComposer API并再次启用它,但没有解决方案

最终,terraform apply第一次尝试创建composer环境,但最终出现版本错误,我更改了composer的图像版本。现在我面临这个问题。有人能帮忙吗

composer/main.tf

    resource "google_composer_environment" "etl_env" {
    provider = google-beta
    name     = var.env_name
    region   = var.region
    config {
    node_count = 3

    node_config {
      zone         = var.zone
      machine_type = var.node_machine_type

      network    = var.network
      subnetwork = var.app_subnet_selflink

      ip_allocation_policy {
      use_ip_aliases = true
    }
   }

   software_config {
      image_version  = var.software_image_version
      python_version = 3
   }

   private_environment_config {
      enable_private_endpoint = false
   }

   database_config {
      machine_type = var.database_machine_type
   }

   web_server_config {
      machine_type = var.web_machine_type
   }
  }
 }
composer/variables.tf

  variable "app_subnet_selflink" {
    type        = string
    description = "App Subnet Selflink"
  }

  variable "region" {
    type        = string
    description = "Region"
    default     = "us-east4"
  }

  variable "zone" {
    type        = string
    description = "Availability Zone"
    default     = "us-east4-c"
  }

  variable "network" {
    type        = string
    description = "Name of the network"
  }

  variable "env_name" {
    type        = string
    default     = "composer-etl"
    description = "The name of the composer environment"
  }

  variable "node_machine_type" {
    type        = string
    default     = "n1-standard-1"
    description = "The machine type of the worker nodes"
  }

  variable "software_image_version" {
    type        = string
    default     = "composer-1.15.2-airflow-1.10.14"
    description = "The image version used in the software configurations of composer"
  }

  variable "database_machine_type" {
    type        = string
    default     = "db-n1-standard-2"
    description = "The machine type of the database instance"
  }

  variable "web_machine_type" {
    type        = string
    default     = "composer-n1-webserver-2"
    description = "The machine type of the web server instance"
  }

网络和子网络是从另一个模块引用的,它们是正确的。

问题将出现在主ipv4\cidr\U块的范围内。如果留空,则使用默认值“172.16.0.0/28”。由于您已经手动创建了该范围,该范围已在使用中,请使用其他一些范围


请按照链接获取更多信息,并且

您能显示导致错误的TF代码吗?@Marcin我添加了我尝试为master_ipv4_cidr_块创建的不同范围的TF代码,并且成功了。非常感谢。你能给答案打分吗:)