I'm trying to connect App Engine application to MongoDB Cloud over a peering connection.
All services in my GCP are using non-default network called "main". I've setup peering connection with terraform:
resource "google_compute_network_peering" "mongodb_peering" {
name = "mongodb-peering"
network = google_compute_network.main.self_link
peer_network = "projects/${mongo-cloud-project}/global/networks/${mongo-cloud-network}"
}
It works as expected.
Presumably App Engine uses default VPC network.
When I'm trying to create second connection on the default network I'm getting error because of overlapping ranges. So, I've just deleted the peering with main network and set up a new one with the default network.
Still the App Engine application cannot connect to mongodb over the peering connection.
App.yaml:
runtime: nodejs12
instance_class: F4
handlers:
- url: /.*
secure: always
redirect_http_response_code: 301
script: auto
automatic_scaling:
max_instances: 2
max_concurrent_requests: 80
inbound_services:
- warmup