Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a google cloud function communicate with google compute engine instance?

I have an instance of NSQ running within a zone in google compute engine as part of a larger application.

As part of an automated testing effort, I'd like the ability to push events to this queue in our test environments. I would rather not expose this instance to the internet, and instead, create a google cloud function that acts as a facade. The cloud function can be installed at the project level, which is great since I don't want production to have this capability.

It seems that cloud functions are created at the region level and do not have access to zone local IP addresses. As a result, I can't figure out a way to post events to NSQ without exposing it to the public internet.

Is it possible to have a google cloud function communicate down to an instance running on gce without exposing that instance to the public internet?

like image 633
spalumbo Avatar asked Apr 11 '17 21:04

spalumbo


People also ask

Which command do you use to connect to a running compute engine instance with SSH?

To connect to an instance without an external IP address, use the gcloud compute ssh command with the --internal-ip flag. In the Google Cloud console, go to the VM Instances page and find the internal IP address for the instance that you want to connect to.

What is the difference between Google App Engine and Google Compute Engine?

Compute Engine delivers configurable virtual machines running in Google's data centers with access to high-performance networking infrastructure and block storage solutions. App Engine is a fully managed, serverless platform for developing and hosting web applications at scale.


1 Answers

Investigating the matter I've found that this is not possible yet. Google Cloud Functions internal connectivity to Google Compute Engine has been already requested some months ago.1

In the public bug/issues database of Google it has been already said that it has been taken into consideration by google and that the Google engineering team is working on it 2. There is no ETA for the functionality though.

Sources: Google Groups question Public google issue/bug tracker

like image 87
Ggrimaldo Avatar answered Oct 06 '22 03:10

Ggrimaldo