mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
240 stars 168 forks source link

Bug VPC Peering between GCP and Atlas #29

Closed aliciaalcalde closed 4 years ago

aliciaalcalde commented 4 years ago

Good morning,

I try to create peering between MongoDB Atlas Project and my VPC in GCP.

resource "mongodbatlas_network_peering" "main_peering" {
  project_id        = mongodbatlas_project.project.id
  container_id      = mongodbatlas_network_container.container.container_id
  provider_name     = "GCP"
  gcp_project_id    = var.gcp_project_id
  network_name      = var.gcp_main_network_name
  depends_on       = ["mongodbatlas_network_container.container"]
}

resource "google_compute_network_peering" "gcp_main_atlas_peering" {
  name = "atlas-gcp-main"
  network = var.gcp_main_network_link
 peer_network="projects/${mongodbatlas_network_peering.main_peering.project_id}/global/networks/${mongodbatlas_network_peering.main_peering.network_name}"
}

But It never finish. I try it several times but it always finished with the same error:

module.atlas.mongodbatlas_network_peering.main_peering: Still creating... [45m3s elapsed]

Error: rpc error: code = Unavailable desc = transport is closing

In the Atlas website appear this message: Create a reciprocal connection from GCP to Atlas to complete this connection. Show me how

Thank you,

PacoDw commented 4 years ago

Hello @aliciaalcalde thanks for your review, we will check this to resolve it.

PacoDw commented 4 years ago

Hello @aliciaalcalde we have made the fix on the PR #43, could you check the example configuration on there and test on the Network peering branch?

If you have another comment plz let us know, thanks!