- The
template.yaml
file specifies the configuration for the Lambda function and its triggering API Gateway (if any) - Running
sam build
builds the Lambda function. This basically just copies the code files as specified in package.json'sfiles
field and thenode_modules
folder into a.aws-sam
folder - Running
sam deploy --guided
for the first time walks you through the deployment setup. Thesamconfig.toml
file is created and contains the configuration for the deployment. - Subsequent deployments using the
sam deploy
command will update the existing CloudFormation stack, composed of the lambda function itself as an application, an S3 bucket dedicated to SAM which contains the source code in a template format, and an API that triggers the lambda function (if any).
Note: Subsequent deployments upload a new source code template as an s3 bucket object every time.