google_pubsub_lite_subscription

A named resource representing the stream of messages from a single, specific topic, to be delivered to the subscribing application.

To get more information about Subscription, see:

Open in Cloud Shell

Example Usage - Pubsub Lite Subscription Basic

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
  }
}

resource "google_pubsub_lite_subscription" "example" {
  name  = "example-subscription"
  topic = google_pubsub_lite_topic.example.name
  delivery_config {
    delivery_requirement = "DELIVER_AFTER_STORED"
  }
}

data "google_project" "project" {
}

Argument Reference

The following arguments are supported:


The delivery_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

Subscription can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/locations/{{zone}}/subscriptions/{{name}}"
  to = google_pubsub_lite_subscription.default
}

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

$ terraform import google_pubsub_lite_subscription.default projects/{{project}}/locations/{{zone}}/subscriptions/{{name}}
$ terraform import google_pubsub_lite_subscription.default {{project}}/{{zone}}/{{name}}
$ terraform import google_pubsub_lite_subscription.default {{zone}}/{{name}}
$ terraform import google_pubsub_lite_subscription.default {{name}}

User Project Overrides

This resource supports User Project Overrides.