

# sam validate
<a name="sam-cli-command-reference-sam-validate"></a>

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?](what-is-sam-overview.md#what-is-sam-cli)

The `sam validate` command verifies whether an AWS SAM template file is valid.

## Usage
<a name="sam-cli-command-reference-sam-validate-usage"></a>

```
$ sam validate <options>
```

## Options
<a name="sam-cli-command-reference-sam-validate-options"></a>

`--config-env TEXT`  <a name="sam-cli-command-reference-sam-validate-options-config-env"></a>
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](serverless-sam-cli-config.md).

`--config-file PATH`  <a name="sam-cli-command-reference-sam-validate-options-config-file"></a>
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](serverless-sam-cli-config.md).

`--debug`  <a name="sam-cli-command-reference-sam-validate-options-debug"></a>
Turns on debug logging to print debug message generated by the AWS SAM CLI and display timestamps.

`--lint`  <a name="sam-cli-command-reference-sam-validate-options-lint"></a>
 Run linting validation on template through **cfn-lint**. Create a `cfnlintrc` config file to specify additional parameters. For more information, see [cfn-lint](https://github.com/aws-cloudformation/cfn-lint) in the *CloudFormation GitHub repository*. 

`--profile TEXT`  <a name="sam-cli-command-reference-sam-validate-options-profile"></a>
The specific profile from your credential file that gets AWS credentials.

`--region TEXT`  <a name="sam-cli-command-reference-sam-validate-options-region"></a>
The AWS Region to deploy to. For example, us-east-1.

`--save-params`  <a name="sam-cli-command-reference-sam-validate-options-save-params"></a>
Save the parameters that you provide at the command line to the AWS SAM configuration file.

`--template-file, --template, -t PATH`  <a name="sam-cli-command-reference-sam-validate-options-template-file"></a>
 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
<a name="sam-cli-command-reference-sam-validate-examples"></a>

For an example on using this command to validate a template, refer to [Validate AWS SAM template files](serverless-sam-cli-using-validate.md).

For an example on using this command with cfn-lint, refer to [Validate your AWS SAM applications with CloudFormation Linter](validate-cfn-lint.md).