6
votes

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?

2
Have you found a solution to this? - Samik R

2 Answers

1
votes

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

0
votes

Here is my workaround since there is no way to do this via cloud functions.

I am using the gcloud cli tool to connect to the GCE zone and issue curl commands via ssh to the NSQ instance. It is not great but it gets the job done.

https://cloud.google.com/sdk/gcloud/