pubsub/WARN/2023_004

Project should not have a subscription without a topic attached.

Product: Cloud Pub/Sub
Rule class: WARN - Something that is possibly wrong

Description

For a subscription whose topic is deleted, it cannot be reattached to a new topic and thus cannot receive new published messages. Messages in the subscription will expire after the message retention period if unacked, and discarded from Pub/Sub which may lead to data loss. The subscription is then counting as quota consumed for an unusable resource.

Remediation

Delete a subscription whose topic is deleted to free up the quota for new subscriptions.

Further information

You can also set expiration policy for subscriptions to delete inactive subscriptions past their expiry period. By default this value is 31 days. However, subscriptions set to never expire will not be deleted even if they are inactive and count against the project’s quota usage.