Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

sam local generate-event

Focus mode
sam local generate-event - AWS Serverless Application Model

This page provides reference information for the AWS Serverless Application Model Command Line Interface (AWS SAM CLI) sam local generate-event subcommand.

The sam local generate-event subcommand generates event payload samples for supported AWS services.

Usage

$ sam local generate-event <options> <service> <event> <event-options>

Options

--config-env TEXT

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-file PATH

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.

--help

Shows this message and exits.

Service

To see a list of supported services, run the following:

$ sam local generate-event

Event

To see a list of supported events that can be generated for each service, run the following:

$ sam local generate-event <service>

Event options

To see a list of supported event options that you can modify, run the following:

$ sam local generate-event <service> <event> --help

Examples

For examples on using the sam local generate-event subcommand, refer to Generate sample events.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.