forked from aliyun/oos-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACS::ECS::RunInstances.json
135 lines (135 loc) · 3.7 KB
/
ACS::ECS::RunInstances.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
126
127
128
129
130
131
132
133
134
135
{
"FormatVersion": "OOS-2019-06-01",
"Description": "Creates one or more ECS instances.",
"Parameters": {
"regionId": {
"Description": "The ID of region.",
"Type": "String",
"Default": "{{ ACS::RegionId }}"
},
"imageId": {
"Description": "The ID of the image resource that you specify when you create the instance.",
"Type": "String",
"AllowedPattern": "[A-Za-z0-9_\\-\\.]*",
"MinLength": 1,
"MaxLength": 100
},
"instanceType": {
"Description": "The type of the instance.",
"Type": "String",
"AllowedPattern": "ecs\\.[A-Za-z0-9\\.\\-]*",
"MaxLength": 30,
"MinLength": 1
},
"instanceName": {
"Description": "The name of new instance.",
"Type": "String",
"Default": ""
},
"ramRoleName": {
"Description": "The ram role for the ECS instances.",
"Type": "String",
"Default": ""
},
"securityGroupId": {
"Description": "The ID of the security group to which the instance belongs.",
"Type": "String",
"AllowedPattern": "sg-[A-Za-z0-9]*",
"MaxLength": 30,
"MinLength": 1
},
"vSwitchId": {
"Description": "The ID of the VSwitch.",
"Type": "String",
"AllowedPattern": "vsw-[A-Za-z0-9]*",
"MaxLength": 30,
"MinLength": 1
},
"amount": {
"Description": "The specified number of instances you want to create.",
"Type": "Number",
"Default": 1
},
"internetMaxBandwidthIn": {
"Description": "The maximum inbound public bandwidth.",
"Type": "Number",
"Default": 200
},
"internetMaxBandwidthOut": {
"Description": "The maximum outbound public bandwidth.",
"Type": "Number",
"Default": 0
},
"systemDiskCategory": {
"Description": "The category of the system disk.",
"Type": "String",
"AllowedValues": [
"cloud_efficiency",
"cloud_ssd",
"cloud_essd",
"cloud"
],
"Default": "cloud_efficiency"
}
},
"Tasks": [
{
"Name": "runInstances",
"Action": "ACS::ExecuteAPI",
"Description": "Creates one or more instances.",
"Properties": {
"Service": "ECS",
"API": "RunInstances",
"Parameters": {
"RegionId": "{{ regionId }}",
"Amount": "{{ amount }}",
"ImageId": "{{ imageId }}",
"InstanceType": "{{ instanceType }}",
"InstanceName": "{{ instanceName }}",
"RamRoleName": "{{ ramRoleName }}",
"SecurityGroupId": "{{ securityGroupId }}",
"VSwitchId": "{{ vSwitchId }}",
"InternetMaxBandwidthIn": "{{ internetMaxBandwidthIn }}",
"InternetMaxBandwidthOut": "{{ internetMaxBandwidthOut }}",
"SystemDiskCategory": "{{ systemDiskCategory }}"
}
},
"Outputs": {
"instanceIds": {
"Type": "List",
"ValueSelector": "InstanceIdSets.InstanceIdSet[]"
}
}
},
{
"Name": "untilInstanceReady",
"Action": "ACS::WaitFor",
"Description": "Waits for the created instances to be Running.",
"Properties": {
"Service": "ECS",
"API": "DescribeInstances",
"Parameters": {
"RegionId": "{{ regionId }}",
"InstanceIds": [
"{{ ACS::TaskLoopItem }}"
]
},
"DesiredValues": [
"Running"
],
"PropertySelector": "Instances.Instance[].Status"
},
"Loop": {
"MaxErrors": 0,
"Concurrency": 1,
"Items": "{{ runInstances.instanceIds }}"
}
}
],
"Outputs": {
"instanceIds": {
"Type": "List",
"Value": "{{ runInstances.instanceIds }}"
}
}
}