I'm building some serverless apps and trying to use SAM. I've been going through some tutorials and some use sam build
, while others use sam package
.
What are the differences between these commands? It seems like sam package is more difficult to use.
You may see some older tutorials where they were using sam package
but the task that this command is/was performing is now built into sam deploy
command so you don't need to perform it manually anymore.
The common order of calls today is init
-> build
-> deploy
.
As for the differences between those 2, build
preprocesses your project files locally while package
used to zip your project, push it to S3 bucket and returned a processed template (replacing code references) that you would subsequently deploy (this zipping, pushing to s3 and deploying is now handled by deploy
command).