What is the difference between AWS sam deploy
and sam sync
and when should I use which one?
sam deploy
The sam deploy
command simply deploys your serverless application to the cloud. Use it to manually deploy the application.
sam sync
The sam sync
command provides options to quickly sync local application changes to the AWS Cloud. Use it to automate the deployment as you make changes in your development environment.
Use sam sync when developing your applications to:
Automatically detect and sync local changes to the AWS Cloud.
Customize what local changes are synced to the AWS Cloud.
Prepare your application in the cloud for testing and validation.
With sam sync
, you can create a rapid development workflow that shortens the time it takes to sync your local changes to the cloud for testing and validation.
It does the following:
sam build
command.sam deploy
command.Note: Since the sam sync
command automatically updates your application in the AWS Cloud, it is recommended for development environments only.