Using Console
Using CLI
[PROJECT_ID]
and [REGION]
with the appropriate values.
[SUBSCRIPTION_NAME]
with the name of the subscription identified in Step 4. Replace [DEAD_LETTER_TOPIC]
and [DEAD_LETTER_TOPIC_PROJECT]
with the name of the dead-letter topic and the project ID where the dead-letter topic is located, respectively.[SUBSCRIPTION_NAME]
with the name of the subscription identified in Step 4.Using Python
gcloud functions list
to list all the Cloud Functions in your project.
gcloud functions event-types list
to list all the event types for a Cloud Function. If the event type is google.pubsub.topic.publish
, then the Cloud Function is using Pub/Sub subscription.
gcloud functions describe <function-name>
to get the details of a Cloud Function. Look for the deadLetterPolicy
field in the output. If it is not present or is empty, then the Cloud Function does not have a Dead Letter Queue configured.
gcloud functions deploy <function-name> --update-labels dead-letter-topic=<dead-letter-topic>
. Replace <function-name>
with the name of the Cloud Function and <dead-letter-topic>
with the name of the Pub/Sub topic where you want to send the dead-letter messages.
gcloud functions describe <function-name>
to verify that the deadLetterPolicy
field is set correctly.