Mahmoud Sultan
Mahmoud Sultan

Reputation: 570

Can I use Google Cloud Endpoints with external services

I'm new to the GCP Services, and I'm trying to make an API Gateway to proxy two services, one is run on an App Engine and the other is actually a PaaS.

Can I configure Cloud Endpoints to redirect to that PaaS, and how? and if now what service in GCP suits this case?

Edit: An example of what I'm trying to do is if my domain is test.com then i'd like app.test.com to be redirected to my App Engine and ip.test.com would be directed for example to https://httpbin.org/ip.

Upvotes: 1

Views: 1619

Answers (2)

guillaume blaquiere
guillaume blaquiere

Reputation: 75775

I wrote an article on this for securing the endpoint. Set the value that you want in the x-google-backend.

I also provide some tips about the URL rewriting if you want.


EDIT 1

If you want to perform this routing

  • app.test.com -> App Engine
  • ip.test.com -> External service

You need to use a HTTPS Load Balancer and not API Gateway.

Then,

  • create a serverless NEG and configure it with App Engine
  • create an Internet NEG and configure it to reach your internet accessible PaaS service
  • Create a URL MAP with the correct routing

That's all (wait 3 - 5 minutes, the delay to dispatch your configuration around the globe.)

Upvotes: 2

Travis Webb
Travis Webb

Reputation: 15018

Yes, you can run an Extensible Service Proxy in front of your non-GCP backend service so that Cloud Endpoints can proxy requests to it.

Docs: https://cloud.google.com/endpoints/docs/openapi/running-esp-localdev

Upvotes: 1

Related Questions