I have a test Cloud Function (CF) to trigger on update to an object in Cloud Storage.
exports.test_cf = (event, callback) => {
console.log("Test CF executed successfully");
callback();
}
Deployed above function using:
gcloud functions deploy --runtime nodejs6 --trigger-resource [BUCKET-NAME] --trigger-event google.storage.object.archive --timeout=540s --verbosity=info
After setting the versioning on the bucket, I copy a file to the bucket using gsutil as follows:
gsutil cp <file> gs://[BUCKET-NAME]/
Above command triggered CF. Why is that? As per GCP documentation, google.storage.archive triggers CF only on updates.
Another question: How to update objects in buckets using gsutil? I see gsutil rewrite but it is not same as update.