Tencent-SCF - Deploying
The Serverless Framework was designed to provision your Serverless Cloud Functions, Events and infrastructure Resources safely and quickly. It does this via a couple of methods designed for different types of deployments.
This is the main method for doing deployments with the Serverless Framework:
Use this method when you have updated your Function, Event or Resource configuration in
serverless.yml and you want to deploy that change (or multiple changes at the same time) to Tencent Cloud.
Note: You can always enforce a deployment using the
--force option, or specify a different configuration file name with the the
Use this in your CI/CD systems, as it is the safest method of deployment.
You can print the progress during the deployment if you use
verbosemode, like this: serverless deploy --verbose
This method defaults to
ap-guangzhouregion. You can change the default stage and region in your
serverless.ymlfile by setting the
regionproperties inside a
providerobject as the following example shows:
# serverless.yml service: service-name provider: name: tencent stage: production region: ap-beijing
You can also deploy to different stages and regions by passing in flags to the command:
serverless deploy --stage production --region ap-beijing
You can specify your own COS bucket which should be used to store all the deployment artifacts. The
cosBucketconfig which is nested under
providerlets you e.g. set the
namefor this bucket. If you don't provide your own bucket, Serverless will create a bucket which by default.
This deployment method simply overwrites the zip file of the current function on Tencent Cloud.
serverless deploy function --function myFunction
- Use this when you are developing and want to test because it's much faster.
- During development, people will often run this command several times, as opposed to
serverless deploywhich is only run when larger infrastructure provisioning is required.
Check out the deploy command docs for all details and options.