Skip to content

Commit 06654df

Browse files
author
ljacobsson
committed
new feature 🎉 - invoke Lambda and StateMachines
1 parent b387c11 commit 06654df

File tree

5 files changed

+11602
-6036
lines changed

5 files changed

+11602
-6036
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,32 @@ Options:
4444
```
4545
![Demo](images/demo.gif)
4646

47+
48+
### sam-patterns invoke
49+
Invokes a Lambda function or StepFunctions state machine in your CloudFormation stack. If a samconfig.toml file is present, it will use the stack name and region from that file. Otherwise you will have to specify them using the `--stack-name` and `--region` flags.
50+
51+
You can pass a variety of inputs to the function / state machine:
52+
* A path to a local JSON file
53+
* JSON string
54+
* [Shared Lambda test event](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html#:~:text=test%20event.-,Shareable%20test%20events,-Shareable%20test%20events). These test events become available for other developers with access to the same AWS account. This command also introduces the same sharable test events for StepFunctions.
55+
* For StepFunctions, you can select to re-run the input from a recent execution from the state machine.
56+
57+
```
58+
Usage: sampat invoke|in [options]
59+
60+
Invokes a Lambda function or a StepFunctions state machine
61+
62+
Options:
63+
-s, --stack-name [stackName] The name of the deployed stack. Optional if a samconfig.toml file is present
64+
-pl, --payload [payload] The payload to send to the function. Could be stringified JSON,
65+
a file path to a JSON file or the name of a shared test event. Optional
66+
-p, --profile [profile] AWS profile to use. Optional (default: "default")
67+
--region [region] The AWS region to use. Falls back on AWS_REGION environment
68+
variable if not specified
69+
-h, --help display help for command
70+
```
71+
72+
4773
### sam-patterns explore
4874
Lets you browse and explore your serverless patterns repositories.
4975

0 commit comments

Comments
 (0)