Log in to the SCF console and select Function Service on the left sidebar.
At the top of the Function Service page, select the Beijing region and click Create to enter the function creating page and configure the function as shown below:
Creation method: select Template.
Fuzzy search: enter "map_function", search, and select the "map_function" template. Click Learn More in the template to view relevant information in the Template Details pop-up window, which can be downloaded.
Click Next. The function name is automatically generated by default and can be modified as needed. Follow the prompts to configure the execution role:
Execution Role: check Enable. Configure and use SCF template role is selected here as an example as shown below:
Configure and use SCF template role: select this option and the system will automatically create and select an SCF template execution role associated with full access permissions of COS.
Use the existing role: you need to select an existing role that contains the above permissions in the drop-down list.
Note:
During execution, the function will use the execution role to get a temporary key to manipulate relevant Tencent Cloud resources.
Click to expand the Function Code tab, where you can browse the code information. If you want to modify the parameter values such as variables, you can modify and save them online.
Configuring COS trigger
In the Trigger Configurations section, select Custom and enter relevant information according to the displayed parameters as shown below:
Main parameters are as follows:
Trigger Method: select COS trigger.
COS Bucket: select srcmr.
Event Type: select All Creation Events.
Click Complete.
Creating Reducer Function
Creating in console through template function
Log in to the SCF console and select Function Service on the left sidebar.
At the top of the Function Service page, select the Beijing region and click Create to enter the function creating page and configure the function as shown below:
Creation method: select Template.
Fuzzy search: enter "reduce_function", search, and select the "reduce_function" template. Click Learn More in the template to view relevant information in the Template Details pop-up window, which can be downloaded.
Click Next. The function name is automatically generated by default and can be modified as needed. Follow the prompts to configure the execution role:
Execution Role: check Enable. Configure and use SCF template role is selected here as an example as shown below:
Configure and use SCF template role: select this option and the system will automatically create and select an SCF template execution role associated with full access permissions of COS.
Use the existing role: you need to select an existing role that contains the above permissions in the drop-down list.
Click to expand the Function Code tab, where you can browse the code information. If you want to modify the parameter values such as variables, you can modify and save them online.
Configuring COS trigger
In the Trigger Configurations section, select Custom and enter relevant information according to the displayed parameters as shown below:
Was this page helpful?