Skip to content

Cloud function to synchronize changes in a GCP Cloud Storage bucket into Sesam.io node

Notifications You must be signed in to change notification settings

timurgen/sesam-gcp-storage-ingress-cloud-func

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCP Cloud Functions to propagate changes in a GCP cloud storage bucket into a Sesam.io node

This function will not synchronize files stored in the bucket before function was started

function-oncreated.go

Contains cloud function code to execute with trigger type Cloud storage and event type Finalise/Create. This function uses GCP Secret Manager to retrieve JWT token to access Sesam node. Check environment variables section for details.

Env vars

  • SESAM_PIPE_NAME - name of receiver pipe (see example in example-pipe.json)
  • SESAM_NODE_NAME - name of Sesam.io node
  • SESAM_TOKEN_SECRET - name of secret where JWT token to access the node is stored (cloud function service account must have permission to read it)

Pipe setup

To push data into Sesam an http_endpoint source pipe is needed. An example provided below.

{
    "_id": "example-pipe",
    "type": "pipe",
    "source": {
      "type": "http_endpoint"
    },
    "transform": [{
      "type": "dtl",
      "rules": {
        "default": [
          ["add", "_id", "_S.selfLink"],
          ["copy", "*"]
        ]
      }
    }]
  }

About

Cloud function to synchronize changes in a GCP Cloud Storage bucket into Sesam.io node

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages