Support the Google Serverless platform https://cloud.google.com/functions/ similar to AWS Lambda #1005.
A Kong plugin allows to invoke and manage GCfunctions directly from the gateway.
alright sounds good. where should i start? wanna start helping.
@jeremylorino this would be a good place: https://getkong.org/docs/0.9.x/plugin-development/
Has anyone started working on this? I'm considering it for project, and would be glad to work on it if no one else has already.
As far as I know, not yet @dustinblackman
Turns out a full blown integration for Google Functions may not be needed. The fact that Google Functions automaticially provides an http URL, you can just proxy to it easy. The following works just fine following the helloGET tutorial.
curl -i -X POST http://localhost:8001/apis/ \
-d 'name=helloGET' \
-d 'upstream_url=https://us-central1-project-id.cloudfunctions.net/helloGET' \
-d 'hosts=host.local' \
-d 'methods=GET' \
-d 'https_only=true'
curl -v -k https://localhost:8443/ -H 'Host: host.local'
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: localhost
> GET / HTTP/1.1
> Host: host.local
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< Content-Length: 12
< Connection: keep-alive
< ETag: W/"c-1c291ca3"
< function-execution-id: s8iddffdepesya
< x-powered-by: Express
< x-cloud-trace-context: 7be346fgfb2c19c122892b903d4dbb552
< x-cloud-trace-context: 7be346gfgb2c19c122892b903d4dbb552
< Date: Sat, 19 Aug 2017 13:02:41 GMT
< Server: Google Frontend
< X-Kong-Upstream-Latency: 176
< X-Kong-Proxy-Latency: 0
< Via: kong/0.11.0
<
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
Hello World!
Any updates on this?
@dustinblackman's example only works for unauthenticated functions. Is there any update on a real Google Cloud Functions plugin? I.e. calling an _authenticated_ Cloud Function via its HTTP trigger while providing the proper authentication token e.g. acquired from the Compute metadata endpoint.
+1 for this request, especially for authentication.
Most helpful comment
Turns out a full blown integration for Google Functions may not be needed. The fact that Google Functions automaticially provides an http URL, you can just proxy to it easy. The following works just fine following the helloGET tutorial.