-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTVLK-ami-sans-bdm.json
125 lines (125 loc) · 3.21 KB
/
TVLK-ami-sans-bdm.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
"schemaVersion": "0.3",
"description": "Rebake Linux AMI. By default this will remove blocke device mappings from source AMI.",
"assumeRole": "{{AutomationAssumeRole}}",
"parameters": {
"SourceAmiId": {
"type": "String",
"description": "(Required) The source Amazon Machine Image ID."
},
"AutomationAssumeRole": {
"type": "String",
"description": "(Required) Role under which to execute this automation."
},
"TargetAmiName": {
"type": "String",
"description": "(Optional) The name of the new AMI that will be created.",
"default": "hvm-ssd/ubuntu-trusty-14.04-x86_64-server-{{global:DATE_TIME}}"
},
"InstanceType": {
"type": "String",
"description": "(Optional) Type of instance to launch as the workspace host. Instance types vary by region. Default is t2.micro.",
"default": "t2.micro"
},
"SubnetId": {
"type": "String",
"description": "(Optional) The ID of subnet to launch the instance in."
}
},
"mainSteps": [
{
"name": "launchInstance",
"action": "aws:runInstances",
"maxAttempts": 3,
"timeoutSeconds": 1200,
"onFailure": "Abort",
"inputs": {
"ImageId": "{{SourceAmiId}}",
"InstanceType": "{{InstanceType}}",
"SubnetId": "{{SubnetId}}",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sdb",
"NoDevice": ""
},
{
"DeviceName": "/dev/sdc",
"NoDevice": ""
},
{
"DeviceName": "/dev/sdd",
"NoDevice": ""
},
{
"DeviceName": "/dev/sde",
"NoDevice": ""
}
],
"MinInstanceCount": 1,
"MaxInstanceCount": 1
}
},
{
"name": "stopInstance",
"action": "aws:changeInstanceState",
"maxAttempts": 3,
"timeoutSeconds": 1200,
"onFailure": "Abort",
"inputs": {
"InstanceIds": [
"{{launchInstance.InstanceIds}}"
],
"DesiredState": "stopped"
}
},
{
"name": "createImage",
"action": "aws:createImage",
"maxAttempts": 3,
"onFailure": "Abort",
"inputs": {
"InstanceId": "{{launchInstance.InstanceIds}}",
"ImageName": "{{TargetAmiName}}",
"NoReboot": true,
"ImageDescription": "Ubuntu Trusty 14.04 x86_64 Server"
}
},
{
"name": "terminateInstance",
"action": "aws:changeInstanceState",
"maxAttempts": 3,
"onFailure": "Continue",
"inputs": {
"InstanceIds": [
"{{launchInstance.InstanceIds}}"
],
"DesiredState": "terminated"
}
},
{
"name": "createTags",
"action": "aws:createTags",
"maxAttempts": 3,
"onFailure": "Continue",
"inputs": {
"ResourceType": "EC2",
"ResourceIds": [
"{{createImage.ImageId}}"
],
"Tags": [
{
"Key": "SourceAMI",
"Value": "{{SourceAmiId}}"
},
{
"Key": "BuildRegion",
"Value": "{{global:REGION}}"
}
]
}
}
],
"outputs": [
"createImage.ImageId"
]
}