Google Cloud Pub/Sub topic inventory

Record topics and their publishing and subscription relationships.

Description

This entry lists a Pub/Sub topic declared in Terraform.

Potential impact

A missed subscription can keep delivering events to a retired service.

Remediation

Record the topic owner, publishers and subscriptions. Check who can publish to the topic, who can consume each subscription, the retention settings and the encryption key.

Examples

The example adds the events and prod labels to events-topic. Manage publishing and subscription access through IAM.

Before

hcl
resource "google_pubsub_topic" "events" {
  name = "events-topic"
}

After

hcl
resource "google_pubsub_topic" "events" {
  name = "events-topic"

  labels = {
    service = "events"
    env     = "prod"
  }
}

References