I have some GCP functions which use pub sub to run on a schedule. I would like to be able to also run them ad hoc. I am positive I was able to do this from the GCP console UI, but for the life of me can't find the button again. Does anyone know how to do this? Or failing that, is it possible to run functions ad hoc with the gcloud command line tool? I know I could deploy them as HTTP functions as well to enable me to hit the HTTP endpoint to trigger the functions, but I don't want to have to deploy all my functions as pub sub as well as HTTP.
You can use gcloud to send a message to a topic. I suggest reading the documentation.
gcloud pubsub topics publish your-topic --message=your-message
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With