sam local start-lambda

Starts a local endpoint you can use to invoke your local Lambda functions

Options

NameDescription
--config-env <environment>The environment name specifying the default parameter values in the configuration file to use
--config-file <config file>The path and file name of the configuration file containing default parameter values to use
--container-env-vars <path>JSON file containing environment variables to be set within the container environment
--container-host-interface <text>IP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces
--container-host <text>Host of locally emulated Lambda container
--debug-function <text>Specifies the Lambda Function logicalId to apply debug options to when --warm-containers is specified. This parameter applies to --debug-port, --debugger-path, and --debug-args
--debugger-args <text>Additional arguments to be passed to the debugger
--debugger-path <text>Host path to a debugger to mount into the Lambda container
--debugTurn on debug logging to print debug message generated by SAM CLI and display timestamps
-d, --debug-port <port number>
  • Repeatable ♾
--docker-network <network name>Specifies the name or id of an existing docker network to lambda docker containers should connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.
-v, --docker-volume-basedir <text>Location basedir where the SAM file exists
-n, --env-vars <path>JSON file containing values for Lambda function environment variables
--force-image-buildWhether the image should be rebuilt
--help, -hShow help for sam
--host <text>Local hostname or IP address to bind to
-ii, --invoke-image <text>Container image URIs for invoking functions or starting api and function
--layer-cache-basedir <directory>Location where Layers your template uses will be downloaded to
-l, --log-file <text>Log file to send runtime logs to
--parameter-overrides <override string>A string that contains AWS CloudFormation parameter overrides encoded as key=value pairs
-p, --port <port number>Local port to listen on
--profile <profile name>Select a specific profile from your credential file to get AWS credentials
--region <region>Set the AWS Region of the service
--shutdownIf set, will emulate a shutdown event after the invoke completes, in order to test extension handling of shutdown behavior
--skip-pull-imageSpecify whether CLI should skip pulling down the latest Docker image for Lambda runtime
-t, --template-file, --template <path>AWS SAM template file
--warm-containers <mode>Specific how SAM manages the containers for each function