-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstepfunction.json
More file actions
98 lines (98 loc) · 2.86 KB
/
Copy pathstepfunction.json
File metadata and controls
98 lines (98 loc) · 2.86 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
"Comment" : "Machine learning execution with spot instance",
"StartAt" : "CreateS3Bucket",
"States" : {
"CreateS3Bucket": {
"Type" : "Task",
"Resource" : "arn:aws:lambda:ap-northeast-1:517180089186:function:create_s3_bucket",
"Next" : "RequestSpotInstance"
},
"RequestSpotInstance": {
"Type" : "Task",
"Resource" : "arn:aws:lambda:ap-northeast-1:517180089186:function:request_spot_instance",
"Next" : "WaitBidding"
},
"WaitBidding": {
"Type" : "Wait",
"Seconds" : 30,
"Next" : "CheckBiddingResult"
},
"CheckBiddingResult": {
"Type" : "Task",
"Resource" : "arn:aws:lambda:ap-northeast-1:517180089186:function:check_bidding_result",
"Next": "ChoiceBiddingResult"
},
"ChoiceBiddingResult": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$.request_result",
"BooleanEquals": true,
"Next": "NotifyRequestSuccess"
},
{
"Variable": "$.request_result",
"BooleanEquals": false,
"Next": "NotifyRequestFailed"
}
],
"Default": "NotifyRequestFailed"
},
"NotifyRequestFailed": {
"Type" : "Task",
"Resource": "arn:aws:lambda:ap-northeast-1:517180089186:function:send_sms_message",
"Next": "SpotRequestFailed"
},
"SpotRequestFailed": {
"Type": "Fail",
"Error": "SpotRequestError",
"Cause": "Spot price bidding too low"
},
"NotifyRequestSuccess": {
"Type" : "Task",
"Resource": "arn:aws:lambda:ap-northeast-1:517180089186:function:send_sms_message",
"Next": "WaitTaskComplete"
},
"WaitTaskComplete": {
"Type" : "Wait",
"Seconds" : 10,
"Next" : "CheckTaskCompleted"
},
"CheckTaskCompleted": {
"Type" : "Task",
"Resource": "arn:aws:lambda:ap-northeast-1:517180089186:function:check_task_completed",
"Next": "ChoiceTaskCompleted"
},
"ChoiceTaskCompleted": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$.task_completed",
"BooleanEquals": true,
"Next": "NotifyTaskCompleted"
},
{
"Variable": "$.task_completed",
"BooleanEquals": false,
"Next": "WaitTaskComplete"
}
],
"Default": "WaitTaskComplete"
},
"NotifyTaskCompleted":{
"Type": "Task",
"Resource": "arn:aws:lambda:ap-northeast-1:517180089186:function:send_sms_message",
"Next": "WaitInstanceDelete"
},
"WaitInstanceDelete": {
"Type" : "Wait",
"Seconds" : 1800,
"Next" : "DeleteSpotInstance"
},
"DeleteSpotInstance": {
"Type": "Task",
"Resource": "arn:aws:lambda:ap-northeast-1:517180089186:function:delete_ec2_instance",
"End": true
}
}
}