Skip to content

This repository contains an example of integration between GCP and Stigg - forward events from Pub/Sub into Stigg for usage-metering.

Notifications You must be signed in to change notification settings

stiggio/gcp-events-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stigg events connector for GCP

This repository contains an example of integration between GCP and Stigg - forward events from Pub/Sub into Stigg for usage-metering.

It's implemented using a GCP Function listens to a Pub/Sub topic, buffer messages, and sends the events to Stigg every 1 second.

Pre-requisites

  • GCP account + project
  • Pub/Sub topic to consume messages from
  • Terraform installed

Preparations

  • Enable access for the required APIs on the GCP project - click here to enable them.
  • Clone this repository
  • Edit the EventParser.ts file to map between your event format and the Stigg format.

Deployment

  • Create terraform/terraform.tfvars file with the following content and fill in the values:
    gcp_project = ""
    pubsub_topic_id = ""
    stigg_api_key = ""
  • Change directory cd terraform/
  • Run terraform init to initialize the project
  • Run terraform apply -var-file=".tfvars" to deploy the Cloud Function

About

This repository contains an example of integration between GCP and Stigg - forward events from Pub/Sub into Stigg for usage-metering.

Topics

Resources

Stars

Watchers

Forks