We have two different survey tools (Alice and Bob). Each tool is integrated as a data source with BigQuery and the data syncs into their own tables (surveys_by_alice
and surveys_by_bob
).
We want to update our current thinking in a special table based on the latest survey results (current_thinking
).
What I have built so far:
- an on-demand scheduled query that reads from
surveys_by_alice
andsurveys_by_bob
and updatescurrent_thinking
- a service account for this task with
BigQuery Admin
andCloud Run Invoker
permissions - I went to Cloud Logging and created a sink based on when data gets inserted into the first survey table (called
sink.surveys_by_alice
) and a Pub/Sub topic (calledtopic.surveys_by_alice
) - I created a new cloud function with an Eventarc trigger based on the
topic.surveys_by_alice
Pub/Sub topic - I deployed the code and it successfully triggers the on-demand scheduled query whenever the
surveys_by_alice
table is updated
Now, I also want the same cloud function to launch the same scheduled query whenever surveys_by_bob
gets updated.
I am not sure what to do because I started by creating a second sink (sink.surveys_by_bob
) and Pub/Sub topic (topic.surveys_by_bob
), but I realize that there does not appear to be a way to edit my existing cloud function to also be triggered by topic.surveys_by_bob
).
Am I missing something?
One solution is to simply have any updates to surveys_by_alice
and surveys_by_bob
point to the same Pub/Sub topic topic.surveys
, but that seems like a problem if I want to differentiate the two for other downstream events.