This repository was archived by the owner on Oct 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstep-function.json
More file actions
80 lines (80 loc) · 1.95 KB
/
step-function.json
File metadata and controls
80 lines (80 loc) · 1.95 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
// -copy image
// -wait for copy to finish
// -split image
// -wait for split to finish
// -return AMI
{
"Comment": "A state machine that copies a usually shared image and splits it into a root AMI tagged with its snapshots and attachment information",
"StartAt": "Copy Image",
"States": {
"Copy Image": {
"Type": "Task",
"Resource": "arn:<PARTITION>:lambda:::function:SubmitJob",
"ResultPath": "$.copy_ami",
"Next": "Wait X Seconds",
"Retry": [
{
"ErrorEquals": ["States.ALL"],
"IntervalSeconds": 1,
"MaxAttempts": 3,
"BackoffRate": 2
}
]
},
"Wait X Seconds": {
"Type": "Wait",
"SecondsPath": "$.wait_time",
"Next": "Get Job Status"
},
"Get Copy Status": {
"Type": "Task",
"Resource": "arn:<PARTITION>:lambda:::function:GetCopyStatus",
"Next": "Copy Complete?",
"InputPath": "$.guid",
"ResultPath": "$.status",
"Retry": [
{
"ErrorEquals": ["States.ALL"],
"IntervalSeconds": 1,
"MaxAttempts": 3,
"BackoffRate": 2
}
]
},
"Job Complete?": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.status",
"StringEquals": "FAILED",
"Next": "Job Failed"
},
{
"Variable": "$.status",
"StringEquals": "SUCCEEDED",
"Next": "Split Image"
}
],
"Default": "Wait X Seconds"
},
"Job Failed": {
"Type": "Fail",
"Cause": "AWS Batch Job Failed",
"Error": "DescribeJob returned FAILED"
},
"Split Image": {
"Type": "Task",
"Resource": "arn:<PARTITION>:lambda:::function:SplitImage",
"InputPath": "$.copy_ami",
"End": true,
"Retry": [
{
"ErrorEquals": ["States.ALL"],
"IntervalSeconds": 1,
"MaxAttempts": 3,
"BackoffRate": 2
}
]
}
}
}