Clone a function
This topic describes how to clone a function by using Serverless Devs.
Prerequisites
-
Serverless Devs is installed and configured. For more information, see Install Serverless Devs and Configure Serverless Devs.
-
A function is created. The function is named
sync-testand resides in the China (Hangzhou) region. For more information, see Create a function.
Procedure
-
Run the following command to clone the
sync-testtest function.sudo s cli fc3 sync --region cn-hangzhou --function-name sync-test -a defaultAfter the clone is complete, you can see that the function is cloned to the current local directory.
-
In the
cn-hangzhou_sync-test.yamlfile in the working directory, change the function name tosync-clone. Then, run the following command in the code directory to deploy the function.sudo s deploy -t cn-hangzhou_sync-test.yamlAfter the command completes, log on to the Function Compute console to view the cloned function.