Skip to content

Commit 83f55e2

Browse files
committed
docs: introduce action option for event.http to README.md
1 parent a5507dc commit 83f55e2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This is the Serverless Framework plugin for AWS Step Functions.
1717
- [Events](#events)
1818
- [API Gateway](#api-gateway)
1919
- [Simple HTTP endpoint](#simple-http-endpoint)
20+
- [Custom Step Functions Action](#custom-step-functions-action)
2021
- [HTTP Endpoint with custom IAM Role](#http-endpoint-with-custom-iam-role)
2122
- [Share API Gateway and API Resources](#share-api-gateway-and-api-resources)
2223
- [Enabling CORS](#enabling-cors)
@@ -375,6 +376,40 @@ stepFunctions:
375376
definition:
376377
```
377378

379+
#### Custom Step Functions Action
380+
381+
Step Functions have custom actions like DescribeExecution or StopExecution to fetch and control them. You can use custom actions like this:
382+
383+
```yml
384+
stepFunctions:
385+
stateMachines:
386+
start:
387+
events:
388+
- http:
389+
path: action/start
390+
method: POST
391+
definition:
392+
...
393+
status:
394+
events:
395+
- http:
396+
path: action/status
397+
method: POST
398+
action: DescribeExecution
399+
definition:
400+
...
401+
stop:
402+
events:
403+
- http:
404+
path: action/stop
405+
method: POST
406+
action: StopExecution
407+
definition:
408+
...
409+
```
410+
411+
Request template is not used when action is set because there're a bunch of actions. However if you want to use request template you can use [Customizing request body mapping templates](#customizing-request-body-mapping-templates).
412+
378413
#### HTTP Endpoint with custom IAM Role
379414

380415
The plugin would generate an IAM Role for you by default. However, if you wish to use an IAM role that you have provisioned separately, then you can override the IAM Role like this:

0 commit comments

Comments
 (0)