Skip to content

Commit 1cf2ced

Browse files
committed
add doc
1 parent aa291fb commit 1cf2ced

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,56 @@ You can input an value as json in request body, the value is passed as the input
160160
```
161161
$ curl -XPOST https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev/posts/create -d '{"foo":"bar"}'
162162
```
163+
### Schedule
164+
The following config will attach a schedule event and causes the stateMachine `crawl` to be called every 2 hours. The configuration allows you to attach multiple schedules to the same stateMachine. You can either use the `rate` or `cron` syntax. Take a look at the [AWS schedule syntax documentation](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) for more details.
165+
166+
```yaml
167+
stepFunctions:
168+
stateMachines:
169+
crawl:
170+
events:
171+
- schedule: rate(2 hours)
172+
- schedule: cron(0 12 * * ? *)
173+
definition:
174+
```
175+
176+
## Enabling / Disabling
177+
178+
**Note:** `schedule` events are enabled by default.
179+
180+
This will create and attach a schedule event for the `aggregate` stateMachine which is disabled. If enabled it will call
181+
the `aggregate` stateMachine every 10 minutes.
182+
183+
```yaml
184+
stepFunctions:
185+
stateMachines:
186+
aggregate:
187+
events:
188+
- schedule:
189+
rate: rate(10 minutes)
190+
enabled: false
191+
input:
192+
key1: value1
193+
key2: value2
194+
stageParams:
195+
stage: dev
196+
- schedule:
197+
rate: cron(0 12 * * ? *)
198+
enabled: false
199+
inputPath: '$.stageVariables'
200+
```
201+
202+
## Specify Name and Description
203+
204+
Name and Description can be specified for a schedule event. These are not required properties.
205+
206+
```yaml
207+
events:
208+
- schedule:
209+
name: your-scheduled-rate-event-name
210+
description: 'your scheduled rate event description'
211+
rate: rate(2 hours)
212+
```
163213
164214
## Command
165215
### deploy

0 commit comments

Comments
 (0)