Validate Amazon SAM template files - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Validate Amazon SAM template files

Validate your templates with sam validate. Currently, this command validates that the template provided is valid JSON / YAML. As with most Amazon SAM CLI commands, it looks for a template.[yaml|yml] file in your current working directory by default. You can specify a different template file/location with the -t or --template option.

Example:

$ sam validate <path-to-template>/template.yaml is a valid SAM Template
Note

The sam validate command requires Amazon credentials to be configured. For more information, see Configuring the Amazon SAM CLI.