Skip to content

googlePubsubLiteSubscription

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:

Example Usage - Pubsub Lite Subscription Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const dataGoogleProjectProject = new google.dataGoogleProject.DataGoogleProject(
  this,
  "project",
  {}
);
const googlePubsubLiteTopicExample = new google.pubsubLiteTopic.PubsubLiteTopic(
  this,
  "example",
  {
    name: "example-topic",
    partition_config: [
      {
        capacity: [
          {
            publish_mib_per_sec: 4,
            subscribe_mib_per_sec: 8,
          },
        ],
        count: 1,
      },
    ],
    project: dataGoogleProjectProject.number,
    retention_config: [
      {
        per_partition_bytes: 32212254720,
      },
    ],
  }
);
const googlePubsubLiteSubscriptionExample =
  new google.pubsubLiteSubscription.PubsubLiteSubscription(this, "example_2", {
    delivery_config: [
      {
        delivery_requirement: "DELIVER_AFTER_STORED",
      },
    ],
    name: "example-subscription",
    topic: googlePubsubLiteTopicExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googlePubsubLiteSubscriptionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • topic - (Required) A reference to a Topic resource.

  • name - (Required) Name of the subscription.


  • deliveryConfig - (Optional) The settings for this subscription's message delivery. Structure is documented below.

  • region - (Optional) The region of the pubsub lite topic.

  • zone - (Optional) The zone of the pubsub lite topic.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The deliveryConfig block supports:

  • deliveryRequirement - (Required) When this subscription should send messages to subscribers relative to messages persistence in storage. Possible values are deliverImmediately, deliverAfterStored, and deliveryRequirementUnspecified.

Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{zone}}/subscriptions/{{name}}

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

Subscription can be imported using any of these accepted formats:

$ 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.