This topic describes how to manage layers of functions in the Function Compute console.

Background information

Overview

Create and use layers

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, click Layer Management.
  4. In the upper-left corner of the Layer Management page, click Create Layer.
    create-layer
  5. On the Create Layer page, enter the layer name, select the upload method and runtime environment of the code package, and then click Create.
    configure-layer
    Note Only Python and Node.js are supported.
    After a layer is created, the layer version is automatically generated. The version number starts from 1.
  6. Optional:Create a version.
    1. Click Create Version in the upper-right corner of the Layer Management page.
    2. On the Create Layer page, upload new layer code, select the runtime environment, and then click Create to create a version for the layer.
  7. Select the layer and version to be loaded when you create or update a function. For more information, see Function operations.
    In this example, a layer is loaded when you create a function.choose-layer
    Notice You can select a maximum of five layers for a function.

Delete a layer

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, click Layer Management.
  4. On the Layer Management page, find the layer that you want to delete and click Delete in the Actions column.
    delete-layer
    Notice Before you delete a layer, make sure that the layer is not referenced by a function. Otherwise, function exceptions may occur.