Errors creating Filestore via terraform using shared VPC [Basic Instance Type]

170 Views Asked by At

I am trying to create a "BASIC" type Filestore using shared VPC from other host project. Here is my sample code. The same code working (with small modification) fine when use a VPC on the same project.

provider "google" {
  project     = var.project
  region      = var.region
}

resource "google_filestore_instance" "filestore_instance" {
  project = var.project
  name   = var.name
  zone   = var.zone
  tier   = var.tier
  labels = var.labels

  file_shares {
    capacity_gb = var.capacity
    name        = var.fileshare_name
  }

  networks {
    network = "projects/shared-vpc-host-project-id/global/networks/shared-vpc-network-name"
    modes   = var.modes
  }
}

error : Error 400: network project , mismatch with instance project with project_id and project_number

Looking for some help in fixing this errorsyour text

0

There are 0 best solutions below