mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
1.7 KiB
1.7 KiB
Read this on the main serverless docs site
AWS - Deploy Function
The sls deploy function command deploys an individual function without AWS CloudFormation. This command simply swaps out the zip file that your CloudFormation stack is pointing toward. This is a much faster way of deploying changes in code.
serverless deploy function -f functionName
Note: Because this command is only deploying the function code, function properties such as environment variables and events will not be deployed. Those properties are deployed via CloudFormation, which does not execute with this command.
Options
--functionor-fThe name of the function which should be deployed--stageor-sThe stage in your service that you want to deploy to.--regionor-rThe region in that stage that you want to deploy to.--update-configor-uPushes Lambda-level configuration changes e.g. timeout or memorySize
Examples
Deployment without stage and region options
serverless deploy function --function helloWorld
Deployment with stage and region options
serverless deploy function --function helloWorld --stage dev --region us-east-1
Deployment with configuration change
serverless deploy function --function helloWorld --update-config