To start building SAM-based applications, we must first install the SAM CLI, install the AWS credentials, and initialize a simple SAM application.
brew tap aws/tap
brew install aws-sam-cli
sam --version
pip install aws-sam-cli
sam --version
sam --version
You can refer to: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
AdminSAMUser
aws configure
#Step 1 - Download a sample application
sam init
Which template source would you like to use?
1 - AWS Quick Start Templates
2 - Custom Template Location
Choice: 1
Choose an AWS Quick Start application template
1 - Hello World Example
2 - Multi-step workflow
3 - Serverless API
4 - Scheduled task
5 - Standalone function
6 - Data processing
7 - Infrastructure event management
8 - Machine Learning
Template: 1
Use the most popular runtime and package type? (Python and zip) [y/N]: y
Would you like to enable X-Ray tracing on the function(s) in your application? [y/N]: n
Project name [sam-app]: fcj-book-store
You have created a sample SAM project. Next , we will edit that project according to our application architecture.