jelhub / scimgateway

Using SCIM protocol as a gateway for user provisioning to other endpoints
MIT License
176 stars 57 forks source link

Info: Do you know if scimgateway can be run in a Google cloud function? #83

Closed sundeepdev closed 1 year ago

sundeepdev commented 1 year ago

Hi @jelhub, We have a backend completely on Google cloud function, and as that is nodejs based, I was wondering if you know if it is feasible to run scimgateway as a cloud function. I checked online and looks Koa based app can be run, however, what we need to do is instead of listening on a port, the app.callback() is passed to the Google function handler.

jelhub commented 1 year ago

Hi,

Probably with some tweaks.

But why not use Google App Engine, it will be out-of-the-box

Using B-class the gateway will be idle when no traffic (idle_timeout) and starts up on incoming requests - same as Google Cloud Functions

app.yaml example:

env: standard
# B-class (basic_scaling) have idle_timeout and scales to 0, F-class (automatic_scaling) minimum 1 instance running
# note, plugin config log.loglevel.file="off"
instance_class: B1
# first app deployed must use service=default which is "default"
service: default
runtime: nodejs18
# note, using default port 8080
entrypoint: node ./index.js
# note, plugin config password=process.env.PASSWORD
env_variables:
  PASSWORD: "password"
# B-class
basic_scaling:
  max_instances: 1
  idle_timeout: 120s
# F-class
# automatic_scaling:
#  min_idle_instances: 1
#  max_idle_instances: 1

Regards, Jarle