The AWS SAMÂ CLI
The AWS Serverless Application Model Command Line Interface (AWS SAMÂ CLI) is the tool you use to run commands on your AWS SAM application project directory and eventually turn it into your serverless application. More specifically, the AWS SAMÂ CLI allows you, build, transform, deploy, debug, package, initialize, and sync your AWS SAM application project directory.
The AWS SAMÂ CLI and AWS SAM templates come with supported third-party integrations to build and run your serverless applications.
Topics
How AWS SAMÂ CLI commands are documented
AWS SAMÂ CLI commands are documented using the following format:
-
Prompt – The Linux prompt is documented by default and is displayed as (
$). For commands that are Windows specific, (>) is used as the prompt. Do not include the prompt when you type commands. -
Directory – When commands must be executed from a specific directory, the directory name is shown before the prompt symbol.
-
User input – Command text that you enter at the command line is formatted as
user input. -
Replaceable text – Variable text, such as file names and parameters are formatted as
replaceable text. In multiple-line commands or commands where specific keyboard input is required, keyboard input can also be shown as replaceable text. For example,ENTER. -
Output – Output returned as a response to the command is formatted as
computer output.
The following sam deploy command and output is an example:
$sam deploy --guided --templateConfiguring SAM deploy ====================== Looking for config file [samconfig.toml] : Found Reading default arguments : Success Setting default arguments for 'sam deploy' ========================================= Stack Name [sam-app]:template.yamlENTERAWS Region [us-west-2]:ENTER#Shows you resources changes to be deployed and require a 'Y' to initiate deploy Confirm changes before deploy [y/N]:ENTER#SAM needs permission to be able to create roles to connect to the resources in your template Allow SAM CLI IAM role creation [Y/n]:ENTER#Preserves the state of previously provisioned resources when an operation fails Disable rollback [y/N]:ENTERHelloWorldFunction may not have authorization defined, Is this okay? [y/N]:ySave arguments to configuration file [Y/n]:ENTERSAM configuration file [samconfig.toml]:ENTERSAM configuration environment [default]:ENTER
-
sam deploy --guided --template template.yamlis the command you enter at the command line. -
sam deploy --guided --templateshould be provided as is. -
template.yamlcan be replaced with your specific file name. -
The output starts at
Configuring SAM deploy. -
In the output,
ENTERandyindicate replaceable values that you provide.

