The Layer component is one of the basic components in the
serverless-tencent component library. Through this component, you can create, configure, and manage SCF layer resources with speed and ease.
You have installed Node.js (v8.6 or above; v10.0 or above is recommended).
Install Serverless through npm:
npm install -g serverless
If you have already installed Serverless Framework, you can run the following command to upgrade it to the latest version:
npm update -g serverless
serverless.yml file locally and configure it as follows:
# serverless.yml component: layer name: layerDemo org: orgDemo app: appDemo stage: dev inputs: region: ap-guangzhou name: layerDemo src: ./layer-folder runtimes: - Nodejs10.15
Run the following command to deploy by scanning code:
To grant persistent permission, please see Account Configuration.
You can run the following command to remove the deployed service:
Currently, you can scan a QR code to log in to the CLI by default. If you want to configure persistent environment variables/key information, you can also create a local
touch .env # Tencent Cloud configuration information
Configure Tencent Cloud's
SecretKey information in the
.env file and save it:
# .env TENCENT_SECRET_ID=123 TENCENT_SECRET_KEY=123