Eliran Ben-Zikri
Eliran Ben-Zikri

Reputation: 33

Is it possible to connect between AppEngine and Computer engine's virtual machine?

I want my AppEngine site to connect to one of my instances (Google Compute Engine ) in order to get some data from a local redis server.

How can I do that?

It seems there's no way to get a connection between AppEngine and Compute Engine within the same account/project...

Thanks!

Upvotes: 1

Views: 322

Answers (1)

David
David

Reputation: 5511

The answer depends on what protocol your Compute Engine instance accepts :

  • If it accepts HTTP(S) requests, then you can use the URLFetch service to perform HTTP calls as usual. But your instance must be exposed on the internet (public IP address).

  • If it does not accept HTTP(S) calls, like Redis, then you will need to use the Sockets API to make outbound calls from App Engine to Compute Engine. Note that this API is in Beta.

    Then there's the question of how to secure the Compute Engine instance. You cannot use an IP filter because Google won't tell you what IP your App Engine instances have.

    For HTTP(S) calls, one option is to use OAuth2. App Engine instances have an OAuth2 identity embedded in the Identity service, so it is easy to generate OAuth tokens that reliably identity the App Engine instance.

    For other types of protocol (MySQL, Redis, others) you will need to rely on the security provided by whatever you're running on the Compute Engine instance. For example in Redis you can require a password to access your server.

Upvotes: 3

Related Questions