stackery local invoke
stackery local invoke
Execute a function locally
Synopsis
Run local function code using the cloud-side environment
stackery local invoke --stack-name=<name> --env-name=<name> --function-id=<function-logical-id> [flags]
Examples
Given that the stack "my-stack" is deployed to the "development" environment, run a local
instance of the stack's function "Function2" with the SAM CLI. Assuming the stack has a template.yaml at the
root of the project repo, the command should be run with the root of the repo as current working directory.
stackery local invoke -n my-stack -e development --function-id Function2
```asciidoc
### Options
```asciidoc
--access-key-id string AWS access key ID
--aws-profile string AWS profile name
--build Build before invoking
--debug Show debug output; leave temp files
--debug-args string Additional debugger args, passed through to sam cli
-d, --debug-port string Debug port, passed through to sam cli
--debugger-path string Host path to debugger, passed through to sam cli
--docker-network string Specifies the name or id of an existing docker network
-e, --env-name string The environment name
--function-arn string The ARN of the function to be invoked
-f, --function-id string The logical ID of the function to be invoked
-h, --help help for invoke
--input string A JSON string to be given as function input
--input-file string A file containing function input JSON
--no-assume-role Do not assume the function role; instead execute using the user's own role
--secret-access-key string AWS secret access key
--session-token string AWS session token
--source-dir string Path to the function's source directory [Only used with function-arn]
-n, --stack-name string The stack name
--stdin Function input should be read from standard input as JSON
-t, --template-path string Path to stack template relative to CWD, if not the default
-u, --use-container Run 'sam build' with the '--use-container- flag to build your function inside an AWS Lambda-like Docker container
--watch Monitor the filesystem tree for changes
Options inherited from parent commands
--non-interactive Skip user inputs
SEE ALSO
- stackery local - Perform local function execution