Prerequisites
- A project in a GCP account
- A pub/sub topic to consume messages from
- Terraform installed
Getting started
- Enable access for the required APIs on the GCP project
- Clone Stigg’s GCP connector repository
- Edit the EventParser.ts file to map between your event format and the Stigg format.
Deployment
- Create a
terraform/terraform.tfvarsfile with the following content and fill in the values: - Change the directory
cd terraform/ - Run
terraform initto initialize the project - Run
terraform apply -var-file=".tfvars"to deploy the Cloud Function
Connecting to a metered feature in Stigg
To allow Stigg to meter feature usage based on reported events, an event-based metered feature must exist in Stigg. If you haven’t defined a meter for these events in Stigg yet, click here to learn how to do so.Example project
GCP Events Connector
Example integration of GCP Pub/Sub with Stigg for usage metering.