google_pubsub_lite_topic

A named resource to which messages are sent by publishers.

To get more information about Topic, see:

Open in Cloud Shell

Example Usage - Pubsub Lite Topic Basic

resource "google_pubsub_lite_reservation" "example" {
  name = "example-reservation"
  project = data.google_project.project.number
  throughput_capacity = 2
}

resource "google_pubsub_lite_topic" "example" {
  name = "example-topic"
  project = data.google_project.project.number

  partition_config {
    count = 1
    capacity {
      publish_mib_per_sec = 4
      subscribe_mib_per_sec = 8
    }
  }

  retention_config {
    per_partition_bytes = 32212254720
  }

  reservation_config {
    throughput_reservation = google_pubsub_lite_reservation.example.name
  }
}

data "google_project" "project" {
}

Argument Reference

The following arguments are supported:


The partition_config block supports:

The capacity block supports:

The retention_config block supports:

The reservation_config block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Topic can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Topic using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{zone}}/topics/{{name}}"
  to = google_pubsub_lite_topic.default
}

When using the terraform import command, Topic can be imported using one of the formats above. For example:

$ terraform import google_pubsub_lite_topic.default projects/{{project}}/locations/{{zone}}/topics/{{name}}
$ terraform import google_pubsub_lite_topic.default {{project}}/{{zone}}/{{name}}
$ terraform import google_pubsub_lite_topic.default {{zone}}/{{name}}
$ terraform import google_pubsub_lite_topic.default {{name}}

User Project Overrides

This resource supports User Project Overrides.