Clone a function

Updated at:

This topic describes how to clone a function by using Serverless Devs.

Prerequisites

Procedure

  1. Run the following command to clone the sync-test test function.

    sudo s cli fc3 sync --region cn-hangzhou --function-name sync-test -a default

    After the clone is complete, you can see that the function is cloned to the current local directory.

    image
  2. In the cn-hangzhou_sync-test.yaml file in the working directory, change the function name to sync-clone. Then, run the following command in the code directory to deploy the function.

    sudo s deploy -t cn-hangzhou_sync-test.yaml

    After the command completes, log on to the Function Compute console to view the cloned function.

    clone-func-result