sam validate
This page provides reference information for the AWS Serverless Application Model Command Line Interface (AWS SAM CLI)
sam validate command.
For an introduction to the AWS SAM CLI, see What is the AWS SAM CLI?
The sam validate command verifies whether an AWS SAM template file is valid.
Usage
$sam validate<options>
Options
--config-envTEXT-
The environment name specifying the default parameter values in the configuration file to use. The default value is "default". For more information about configuration files, see AWS SAM CLI configuration file.
--config-filePATH-
The path and file name of the configuration file containing default parameter values to use. The default value is "samconfig.toml" in the root of the project directory. For more information about configuration files, see AWS SAM CLI configuration file.
--debug-
Turns on debug logging to print debug message generated by the AWS SAM CLI and display timestamps.
--lint-
Run linting validation on template through cfn-lint. Create a
cfnlintrcconfig file to specify additional parameters. For more information, see cfn-lintin the AWS CloudFormation GitHub repository. --profileTEXT-
The specific profile from your credential file that gets AWS credentials.
--regionTEXT-
The AWS Region to deploy to. For example, us-east-1.
--save-params-
Save the parameters that you provide at the command line to the AWS SAM configuration file.
--template-file, --template, -tPATH-
The AWS SAM template file. Default value is
template.[yaml|yml].If your template is in your current working directory and is named
template.[yaml|yml|json], this option is not required.If you just ran sam build, this option is not required.
Example
For an example on using this command to validate a template, refer to Validate AWS SAM template files.
For an example on using this command with cfn-lint, refer to Validate your AWS SAM applications with AWS CloudFormation Linter.