In this tutorial, suppose that:
The implementation process of this function is as follows:
cos:ObjectCreated:\*
event to the function.wordcount
implemented in the code to count the words, and saves the word count in the target bucket.Note:
- Three COS buckets are used in this example. If you use the same bucket as both source and target buckets, each file uploaded to the source bucket may trigger another object creation event that will invoke the function again and thus cause an infinite loop.
- Make sure that the function and the COS buckets are in the same region.
Note: after going through this tutorial, your account will have the following resources:
srcmr
for triggering, the Reducer function will be bound to middlestagebucket
for triggering, and destmr
will be used to receive the final statistics.
Was this page helpful?