[Live Webinar] Next-Level O11y: Why Every DevOps Team Needs a RUM Strategy Register today!

Back to All Integrations

GCP Pub/Sub Terraform Module GCP Pub/Sub Terraform Module

Last Updated: Oct. 22, 2023

Terraform simplifies the way we deploy our infrastructure and allows us to maintain it as code.

Using our Terraform Modules, you can easily install and manage Coralogix integrations with GCP services as modules in your infrastructure code.

Our modules are open source and available on our GitHub and in the Terraform Registry.


This module will be installing our function app that gets messages from your Pub/Sub topic and sends logs to Coralogix.

For more information about the Function itself, dynamic applicationName and subsystemName and multiline support visit our Pub/Sub guide.

To use the module, first, add the provider configure block to your Terraform project:

terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = ">= 4.31.0"

provider "google" {
  project = "your-project-id"
  region  = "your-region"

Then simply add this declaration to your Terraform project:

module "pubsub" {
  source = "coralogix/google/coralogix//modules/pubsub"

  coralogix_region = "Europe"
  private_key      = "2f55c873-c0cf-4523-82d4-c3b68ee6cb46"
  application_name = "Pub/Sub"
  subsystem_name   = "logs"
  topic           = "test-topic-name"

Important variables to change:

On this page

Live Webinar
Next-Level O11y: Why Every DevOps Team Needs a RUM Strategy
April 30th at 12pm ET | 6pm CET
Save my Seat