File tree Expand file tree Collapse file tree 1 file changed +48
-8
lines changed Expand file tree Collapse file tree 1 file changed +48
-8
lines changed Original file line number Diff line number Diff line change @@ -19,21 +19,23 @@ plugins:
1919## Setup
2020Write definitions yaml using Amazon States Language in a ` stepFunctions` statement in serverless.yml.
2121` Resource` statements refer to `functions` statements. Therefore, you do not need to write a function arn directly.
22+ Of course, you can also specify arn directly.
2223
2324` ` ` yml
2425functions:
2526 hellofunc:
2627 handler: handler.hello
2728
2829stepFunctions:
29- hellostepfunc:
30- Comment: "A Hello World example of the Amazon States Language using an AWS Lambda Function"
31- StartAt: HelloWorld
32- States:
33- HelloWorld:
34- Type: Task
35- Resource: hellofunc
36- End: true
30+ stateMachine:
31+ hellostepfunc:
32+ Comment: "A Hello World example of the Amazon States Language using an AWS Lambda Function"
33+ StartAt: HelloWorld
34+ States:
35+ HelloWorld:
36+ Type: Task
37+ Resource: hellofunc
38+ End: true
3739` ` `
3840
3941# # Command
@@ -85,3 +87,41 @@ $ sls remove stepf --state <stepfunctionname>
8587- --stage or -s The stage in your service you want to invoke your step remove.
8688- --region or -r The region in your stage that you want to invoke your step remove.
8789
90+ ## Sample statemachines setting in serverless.yml
91+ ### Waite State
92+ ```yml
93+ functions:
94+ hellofunc:
95+ handler: handler.hello
96+
97+ stepFunctions:
98+ stateMachine:
99+ yourWateMachine:
100+ Comment: "An example of the Amazon States Language using wait states"
101+ StartAt: FirstState
102+ States:
103+ FirstState:
104+ Type: Task
105+ Resource: hellofunc
106+ Next: wait_using_seconds
107+ wait_using_seconds:
108+ Type: Wait
109+ Seconds: 10
110+ Next: wait_using_timestamp
111+ wait_using_timestamp:
112+ Type: Wait
113+ Timestamp: '2015-09-04T01:59:00Z'
114+ Next: wait_using_timestamp_path
115+ wait_using_timestamp_path:
116+ Type: Wait
117+ TimestampPath: "$.expirydate"
118+ Next: wait_using_seconds_path
119+ wait_using_seconds_path:
120+ Type: Wait
121+ SecondsPath: "$.expiryseconds"
122+ Next: FinalState
123+ FinalState:
124+ Type: Task
125+ Resource: hellofunc
126+ End: true
127+ ```
You can’t perform that action at this time.
0 commit comments