1

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?

1 Answer 1

1

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.

1
  • 1
    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. Commented Jan 20, 2022 at 15:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .