Updated on 2023-10-19 GMT+08:00

remove function

remove function is used to delete a specified function. This will also delete all versions, aliases, and triggers of the function.

You can run remove function -h or remove function --help to view the documentation.

Parameter Parsing

Table 1 Parameter description

Parameter Name

Abbreviation

Required in YAML

Required in CLI

Description

region

-

No

Yes

Region

function-name

-

No

Yes

Function Name

assume-yes

y

No

Yes

During interaction, y is selected by default.

This command also supports some global parameters, such as -a/--access and --debug. For details, see Global Parameters of Serverless Devs.

Examples

  • If you have a resource description file (YAML), run s remove function to delete a specified function.
  • If you use CLI (without a YAML resource description file), specify the name and region of the service. For example, s cli fgs remove function --region cn-north-4 --function-name fgs-test.

    When using CLI, if the key is not default, add the access parameter. For example, s cli fgs remove function --region cn-north-4 --function-name fgs-test --access xxxx.

    Execution result of the preceding command:
    Function [fg-test] deleted.