Score:1

How to trigger an event after saving a chosen csv file in Google Cloud Storage bucket

mx flag

Trying to make a synchronous pipeline, I need to copy a csv file from Google Cloud Storage after it has been saved in Google Cloud Storage. The copy job does not have to be triggered right after the saving, it can also happen within some time frame at least. It just may not happen before the file has been saved. Therefore, either a trigger event or a cronjob are possible, or you may suggest something else.

How can I trigger copying a chosen csv file after it has been saved in Google Cloud Storage? Can I use a Cloud Function to do the copy job or are there other ways?

Score:1
it flag

You can use the google.storage.object.finalize trigger for your Cloud Function which is going to respond to object creation events (uploading files to a bucket).

To include a piece of code that would copy the file, refer to the Cloud Storage docs for examples.

questionto42standswithUkraine avatar
I could just take the menu of creating a function. At the first step, you can choose the "Trigger --> Cloud Storage --> Event type --> Finalize/Create". You could also use gcloud function to create it as in the link.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.