Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the PubSub Lite Delivery Requirement misconfiguration in GCP, you can follow these steps:
  1. Log in to the GCP console and navigate to the Pub/Sub Lite section.
  2. Select the topic for which you want to set the delivery requirement.
  3. Click on the “Delivery Requirement” tab.
  4. In the “Delivery Requirement” section, select the desired delivery requirement from the dropdown menu.
  5. Click “Save” to apply the changes.
Note: The available delivery requirements are “At least once” and “Exactly once”. Selecting “At least once” means that messages will be delivered at least once, but may be duplicated. Selecting “Exactly once” means that messages will be delivered exactly once, but may require additional configuration and may result in higher latency.

The PubSub Lite Delivery Requirement should be set to ensure that messages are delivered to at least two independent zones within a region. Here are the steps to remediate this misconfiguration for GCP using GCP CLI:
  1. Open the Google Cloud Console and navigate to the Pub/Sub Lite topic that needs to be remediated.
  2. Click on the “Edit” button to edit the topic configuration.
  3. In the “Delivery” section, select “At least two zones” from the drop-down menu.
  4. Click on the “Save” button to save the changes.
Alternatively, you can use the following GCP CLI command to set the delivery requirement for a Pub/Sub Lite topic:
Replace [TOPIC_NAME] with the name of the Pub/Sub Lite topic that needs to be remediated. This command sets the delivery requirement to at least two zones within the region.
The Pub/Sub Lite delivery requirement should be set to ensure that messages are delivered at least once. To remediate this issue in GCP using Python, follow these steps:
  1. Install the Google Cloud Pub/Sub Lite client library for Python by running the following command in your terminal or command prompt:
  1. Import the necessary libraries and create a client object for Pub/Sub Lite:
  1. Get the current subscription configuration:
  1. Set the delivery requirement to DeliveryRequirement.DELIVER_AFTER_STORED:
  1. Update the subscription with the new configuration:
After completing these steps, your Pub/Sub Lite subscription will have the correct delivery requirement set.
Replace:
  • PROJECT_ID with your GCP project ID.
  • ZONE with the Pub/Sub Lite location/zone.
  • SUBSCRIPTION_ID with the subscription name.
  • TOPIC_ID with the Pub/Sub Lite topic name.
  • DELIVER_AFTER_STORED with DELIVER_IMMEDIATELY if that is your required threshold.
This change is an in-place update for existing Pub/Sub Lite subscriptions (no forced replacement expected).Verification: terraform plan should show a single in-place update on google_pubsub_lite_subscription.PUBSUB_LITE_SUBSCRIPTION_NAME changing delivery_config.0.delivery_requirement from null (or the old value) to the configured value.