sam local invoke

Invokes a local Lambda function once


--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 to bind to all interfaces
--container-host <text>Host of locally emulated Lambda container
--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
-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
--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
-e, --event <path>JSON file containing event data passed to the Lambda function