Tutorials References Exercises Videos Menu
Paid Courses Website NEW Pro NEW

AWS SAM Deployment Demo


AWS SAM Deployment

Earlier, we have introduced you to AWS SAM Templates.

To refresh your memory, you can read about them here: AWS Serverless Developer Journey.

AWS SAM has a CLI that helps you deploy SAM Templates.

A CLI stands for Command Line Interface.


AWS SAM Deployment Demo Video

W3schools.com collaborates with Amazon Web Services to deliver digital training content to our students.


AWS SAM Packaging

You need to package a SAM template in a .zip file.

To package a SAM template, you can use a sam package command.

You also need to provide the S3 bucket.

Your .zip file will be stored in that S3 bucket.

To specify the S3 bucket, you can use this variation of a package command: sam package —s3-bucket my-bucket-name

The .zip file containing your template will be deployed from the S3 bucket.


AWS SAM CLI Deployment

A single command can install your serverless app.

A single command to deploy your application is sam deploy.

The SAM CLI generates and manages S3 buckets for you with sam deploy.


AWS SAM Deployment Interactive Mode

The sam deploy has an interactive mode.

The interactive mode is called with sam deploy —guided command.

This mode:

  • Guides you through the deployment settings
  • Gives you default selections
  • Remembers your input

The command output can show application changes that will be deployed.

The command can be configured to ask for confirmation before deployment.

The images below show an example of the sam deploy --guided command process.

Sam deploy guided overview Sam deploy guided overview

Image created by Amazon Web Services


AWS Serverless Exercises

Test Yourself With Exercises

Exercise:

What is the CLI command for SAM Deployment Interactive Mode?

sam deploy —

Start the Exercise