-
Notifications
You must be signed in to change notification settings - Fork 11
/
step-functions-workflow.json
95 lines (82 loc) · 2.37 KB
/
step-functions-workflow.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
{
"StartAt": "random-number-generator-lambda-config",
"States": {
"random-number-generator-lambda-config": {
"Comment": "To configure the random-number-generator-lambda.",
"Type": "Pass",
"Result": {
"min": 1,
"max": 10
},
"ResultPath": "$",
"Next": "random-number-generator-lambda"
},
"random-number-generator-lambda": {
"Comment": "Generate a number based on input.",
"Type": "Task",
"Resource": "${random-number-generator-lambda-aws-arn}",
"Next": "send-notification-if-less-than-5"
},
"send-notification-if-less-than-5": {
"Comment": "A choice state to decide to send out notification for <5 or trigger power of three lambda for >5.",
"Type": "Choice",
"Choices": [
{
"Variable": "$",
"NumericGreaterThanEquals": 5,
"Next": "power-of-three-lambda"
},
{
"Variable": "$",
"NumericLessThan": 5,
"Next": "send-multiple-notification"
}
]
},
"power-of-three-lambda": {
"Comment": "Increase the input to power of 3 with customized input.",
"Type": "Task",
"Parameters" : {
"base.$": "$",
"exponent": 3
},
"Resource": "${power-of-number-lambda-aws-arn}",
"End": true
},
"send-multiple-notification": {
"Comment": "Trigger multiple notification using AWS SNS",
"Type": "Parallel",
"End": true,
"Branches": [
{
"StartAt": "send-sms-notification",
"States": {
"send-sms-notification": {
"Type": "Task",
"Resource": "arn:aws:states:::sns:publish",
"Parameters": {
"Message": "SMS: Random number is less than 5 $",
"PhoneNumber": "${valid-handphone-number}"
},
"End": true
}
}
},
{
"StartAt": "send-sns-topic",
"States": {
"send-sns-topic": {
"Type": "Task",
"Resource": "arn:aws:states:::sns:publish",
"Parameters": {
"Message": "Email: Random number is less than 5: $",
"TopicArn": "${aws-sns-topic-to-send-out-email}"
},
"End": true
}
}
}
]
}
}
}