I have a simple script to deploy a pubsub application.
This script will run on every deploy of my Cloud Run service and I have a line with:
gcloud pubsub topics create some-topic
I want to improve my script if the topic already exist, currently if I run my script, the output will be:
ERROR: Failed to create topic [projects/project-id/topics/some-topic]: Resource already exists in the project (resource=some-topic).
ERROR: (gcloud.pubsub.topics.create) Failed to create the following: [some-topic].
I tried the flag --no-user-output-enabled
but no success.
Is there a way to ignore if the resource already exists, or a way to check before create?