Reputation: 506
I have an API.AI agent set up in my GCP project and I have a Compute Engine instance running a node server to be used as a webhook. This instance does not have a public-facing URL but it does have a fixed instance name and an internal IP address.
When communicating between Compute Engine instances, you can use the instance name or the internal IP address, is there a way to get this working with API.AI? I have tried using the internal IP address and the instance name (and the FQDN, as described here) but I just get one of the following errors:
Using Internal IP: Webhook call failed. Error: Request timeout.
Using Instance Name or FQDN: Webhook call failed. Error: Webhook response was empty.
How can I get an API.AI agent to communicate with a Compute Engine instance? They live in the same GCP project so they should be able to talk to each other...
Important note: we do not want to use the external IP or create a public-facing URL for security concerns, especially if customers will be entering their data into the chat system.
Upvotes: 1
Views: 151
Reputation: 3469
API.AI webhooks can't "talk to" internal GCP IPs or instance names, you'll need to create an static IP for your Compute Engine instance and either use that static IP in API.AI's webhook field or create use GCP to create a external DNS name using the static IP and use that in API.AI webhook field.
Or if you'd prefer here is a Medium post walking through how to add a custom domain to your Compute Engine instance: https://medium.com/@kevin_moses_ang/adding-custom-domain-to-your-google-compute-engine-713fb3fae4e8
Upvotes: 1