I found the following snippet on api gateway marketing page.
So I was setting up API gateway for my app running on compute engine. As I couldn't find any documentation on how to configure compute engine on API engine, I created the following configuration with the internal DNS.enter link description here
swagger: "2.0"
info:
title: API Endpoints
description: API Endpoints
version: 1.0.1
schemes:
- https
produces:
- application/json
paths:
/indexes:
get:
summary: Return Search Indexes
operationId: searchIndexes
x-google-backend:
address: http://my_internal_dns_for_compute_engine.c.myproject.internal/indexes
path_translation: APPEND_PATH_TO_ADDRESS
responses:
"200":
description: A successful response
schema:
type: string
"403":
description: Failed to authenticate
When I deployed the config using gcloud, I got the following error
Waiting for API Config [my-api-config-v6] to be created for API [my-api]...failed.
ERROR: (gcloud.beta.api-gateway.api-configs.create) Wait for Service Config creation: Backend URL "http://my_internal_dns_for_compute_engine.c.myproject.internal/indexes" is forbidden: cannot route requests to an internal address.
So looks like internal DNS is not supported(obviously).
My compute engine instance can only be accessed through a VPC network. How do I connect my api gateway with the VPC network and how do I access my compute engine through it ?