-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstep-function-template.json
More file actions
78 lines (77 loc) · 2.45 KB
/
step-function-template.json
File metadata and controls
78 lines (77 loc) · 2.45 KB
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
{
"Comment": "Demo a step function for QC parallel processing using lambda functions",
"StartAt": "Start QC",
"States": {
"Start QC": {
"Comment": "The start-qc function seeds a new row in the QC Summary table.",
"Type": "Task",
"Resource": "arn:aws:lambda:MY-REGION:MY-ACCOUNT-ID:function:start-qc",
"Next": "Parallel Processing"
},
"Parallel Processing": {
"Comment": "The Parallel state invokes 3 lambda functions in parallel.",
"Type": "Parallel",
"Next": "Wait State",
"Branches": [
{
"StartAt": "QC Process 1",
"States": {
"QC Process 1": {
"Type": "Task",
"Resource": "arn:aws:lambda:MY-REGION:MY-ACCOUNT-ID:function:qc-process1",
"End": true
}
}
},
{
"StartAt": "QC Process 2",
"States": {
"QC Process 2": {
"Type": "Task",
"Resource": "arn:aws:lambda:MY-REGION:MY-ACCOUNT-ID:function:qc-process2",
"End": true
}
}
},
{
"StartAt": "QC Process 3",
"States": {
"QC Process 3": {
"Type": "Task",
"Resource": "arn:aws:lambda:MY-REGION:MY-ACCOUNT-ID:function:qc-process3",
"End": true
}
}
}
]
},
"Wait State": {
"Comment": "Allow time for eventual consistency in DynamoDB table.",
"Type": "Wait",
"Seconds": 2,
"Next": "End QC Processing"
},
"End QC Processing": {
"Comment": "Read the row in the summary table and check if stream passes all processes.",
"Type": "Task",
"Resource": "arn:aws:lambda:MY-REGION:MY-ACCOUNT-ID:function:end-qc",
"Next": "Send Summary"
},
"Send Summary": {
"Comment": "Send a pass/fail message to an SNS topic.",
"Type": "Task",
"Resource": "arn:aws:states:::sns:publish",
"Parameters": {
"TopicArn": "arn:aws:sns:MY-REGION:MY-ACCOUNT-ID:qc-results-group1",
"Message": {
"GroupID.$": "$.GroupID",
"StreamID.$": "$.StreamID",
"TotalPass.$": "$.TotalPass",
"StartTime.$": "$.StartTime",
"QCPID.$": "$.QCPID"
}
},
"End": true
}
}
}