简体中文 | English
Tencent Cloud Vpc serverless component.
Install the Serverless Framework globally:
$ npm install -g serverless
In project root, create the following simple boilerplate:
$ touch serverless.yml
$ touch .env # your Tencent api keys
Add the access keys of a Tencent CAM Role with AdministratorAccess
in the .env
file, using this format:
# .env
TENCENT_SECRET_ID=XXX
TENCENT_SECRET_KEY=XXX
- If you don't have a Tencent Cloud account, you could sign up first.
# serverless.yml
org: orgDemo # (optional) serverless dashboard org. default is the first org you created during signup.
app: appDemo # (optional) serverless dashboard app. default is the same as the name property.
stage: dev # (optional) serverless dashboard stage. default is dev.
component: vpc # (required) name of the component. In that case, it's vpc.
name: vpcDemo # (required) name of your vpc component instance.
inputs:
region: ap-guangzhou
zone: ap-guangzhou-2
vpcName: serverless
subnetName: serverless
$ sls deploy
Notice:
sls
is short forserverless
command.
$ sls remove
Checkout the Serverless Components repo for more information.