-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmachine.json
104 lines (104 loc) · 2.54 KB
/
machine.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
"Comment": "An example of the Amazon States Language for reading messages from a DynamoDB table and sending them to SQS",
"StartAt": "Seed the DynamoDB Table",
"TimeoutSeconds": 3600,
"States": {
"Seed the DynamoDB Table": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-2:111111111111:function:seed-dynamodb-blog-function",
"ResultPath": "$.List",
"Next": "Get All Users"
},
"Get All Users": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-2:111111111111:function:get_all_users",
"Next": "Pass"
},
"Pass": {
"InputPath": "$.users[1:]",
"Type": "Pass",
"Next": "CheckUser",
"ResultPath": "$.users"
},
"CheckUser":{
"Type": "Choice",
"Choices": [
{
"Variable": "$.users[0]",
"StringEquals": "DONE",
"Next": "Success"
}
],
"Default": "ValidateUser"
},
"ValidateUser": {
"Type": "Parallel",
"Next": "CheckValid",
"ResultPath": "$.isValid",
"Branches": [{
"StartAt": "ValidateName",
"States": {
"ValidateName": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-2:111111111111:function:validate_name",
"End": true
}
}
},
{
"StartAt": "ValidateSS",
"States": {
"ValidateSS": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-2:111111111111:function:validate_social_security",
"End": true
}
}
}
]
},
"CheckValid": {
"Type": "Choice",
"Choices": [
{
"And":[
{
"Variable": "$.isValid[0]",
"BooleanEquals": true
},
{
"Variable": "$.isValid[1]",
"BooleanEquals": true
}
],
"Next": "CheckRating"
}
],
"Default": "Pass"
},
"CheckRating": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.users[0].rating.S",
"StringLessThanEquals": "3",
"Next": "SendEmail"
},
{
"Variable": "$.users[0].rating.S",
"StringGreaterThanEquals": "3",
"Next": "Pass"
}
]
},
"SendEmail": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-2:111111111111:function:send_email",
"Next": "Pass",
"ResultPath": "$.mail"
},
"Success": {
"Type": "Succeed"
}
}
}