Using the Amazon SAM CLI with Serverless.tf for local debugging and testing - 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).

Using the Amazon SAM CLI with Serverless.tf for local debugging and testing

The Amazon Serverless Application Model Command Line Interface (Amazon SAM CLI) can be used with Serverless.tf modules for local debugging and testing of your Amazon Lambda functions and layers. The following Amazon SAM CLI commands are supported:

  • sam build

  • sam local invoke

  • sam local start-api

  • sam local start-lambda

Note

Serverless.tf version 4.6.0 and newer supports Amazon SAM CLI integration.

To begin using the Amazon SAM CLI with your Serverless.tf modules, update to the latest version Serverless.tf and the Amazon SAM CLI.

Starting from serverless.tf version 6.0.0, you must set the create_sam_metadata parameter as true. This generates the metadata resources that the Amazon SAM CLI sam build command requires.

To learn more about Serverless.tf, see the terraform-aws-lambda-module.