-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::RunInstances.yml
298 lines (298 loc) · 7.48 KB
/
ACS::ECS::RunInstances.yml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::RunInstances
name-zh-cn: 创建实例(ECS)
en: Creates one or more ECS instances
zh-cn: 创建一个或多个ECS实例
Parameters:
regionId:
Label:
en: RegionId
zh-cn: 地域ID
Type: String
AssociationProperty: ALIYUN::ECS::RegionId
Default: '{{ ACS::RegionId }}'
instanceChargeType:
Label:
en: InstanceChargeType
zh-cn: 实例的付费方式
Type: String
AssociationProperty: ChargeType
AllowedValues:
- PrePaid
- PostPaid
Default: PostPaid
periodUnit:
Label:
en: The unit of the subscription period
zh-cn: 包年包月计费方式的时长单位
Type: String
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Not':
'Fn::Equals':
- '${instanceChargeType}'
- PostPaid
AllowedValues:
- Week
- Month
Default: Month
period:
Label:
en: TargetPeriod
zh-cn: 购买包年包月资源的时长
Description:
en: "Valid values:
Valid values when PeriodUnit is set to Week: 1, 2, 3, and 4.
Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60."
zh-cn: 取值范围:
PeriodUnit=Week时,Period取值:{“1”, “2”, “3”, “4”}。
PeriodUnit=Month时,Period取值:{“1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “12”, “24”, “36”, ”48”, ”60”}。
Type: Number
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Not':
'Fn::Equals':
- '${instanceChargeType}'
- PostPaid
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
- 48
- 60
Default: 1
vSwitchId:
Label:
en: The ID of the VSwitch
zh-cn: 交换机ID
Type: String
AllowedPattern: vsw-[A-Za-z0-9]*
MaxLength: 30
MinLength: 1
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
RegionId: regionId
instanceType:
Label:
en: InstanceType
zh-cn: 实例类型
Type: String
AllowedPattern: ecs\.[A-Za-z0-9\.\-]*
MaxLength: 30
MinLength: 1
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
RegionId: regionId
InstanceChargeType: instanceChargeType
imageId:
Label:
en: ImageId
zh-cn: 镜像ID
Type: String
AllowedPattern: '[A-Za-z0-9_\-\.]*'
MinLength: 1
MaxLength: 100
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
AssociationPropertyMetadata:
RegionId: regionId
systemDiskCategory:
Label:
en: SystemDiskCategory
zh-cn: 系统盘的云盘种类
Type: String
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
RegionId: regionId
InstanceType: instanceType
InstanceChargeType: instanceChargeType
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud_essd
- cloud
Default: cloud_efficiency
systemDiskSize:
Label:
en: SystemDiskSize
zh-cn: 系统盘大小
Type: String
Default: ''
internetMaxBandwidthIn:
Label:
en: InternetMaxBandwidthIn
zh-cn: 公网入带宽
Type: Number
Default: 200
internetMaxBandwidthOut:
Label:
en: InternetMaxBandwidthOut
zh-cn: 公网出带宽
Type: Number
Default: 0
securityGroupId:
Label:
en: SecurityGroupId
zh-cn: 安全组ID
Type: String
AllowedPattern: sg-[A-Za-z0-9]*
MaxLength: 30
MinLength: 1
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
RegionId: regionId
amount:
Label:
en: InstanceAmount
zh-cn: 实例数量
Type: Number
Default: 1
instanceName:
Label:
en: InstanceName
zh-cn: 实例名称
Type: String
Default: ''
ramRoleName:
Label:
en: RAMRoleName
zh-cn: RAM角色名称
Type: String
Default: ''
tags:
Label:
en: Tags
zh-cn: 标签
Description:
en: 'The tags of new ECS instance to add on, e.g.[{"Key":"oos","Value":"test"}]'
zh-cn: ECS实例的标签,例如:[{"Key":"oos","Value":"test"}]
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
Default: []
Tasks:
- Name: runInstances
Action: ACS::ExecuteAPI
Description:
en: Creates one or more ECS instances
zh-cn: 创建一个或多个ECS实例
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 }}'
SystemDiskSize: '{{ systemDiskSize }}'
Tags: '{{ tags }}'
InstanceChargeType: '{{ instanceChargeType }}'
PeriodUnit:
'Fn::If':
- 'Fn::Equals':
- PrePaid
- '{{ instanceChargeType }}'
- '{{ periodUnit }}'
- ''
Period:
'Fn::If':
- 'Fn::Equals':
- PrePaid
- '{{ instanceChargeType }}'
- '{{ period }}'
- ''
Outputs:
instanceIds:
Type: List
ValueSelector: InstanceIdSets.InstanceIdSet[]
- Name: untilInstanceReady
Action: ACS::WaitFor
Description:
en: Waits for the created instances to be Running status
zh-cn: 等待创建的实例进入运行中状态
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 }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
Label:
default:
en: Select Region
zh-cn: 选择地域
- Parameters:
- imageId
Label:
default:
en: Select Image
zh-cn: 选择镜像
- Parameters:
- instanceChargeType
- periodUnit
- period
Label:
default:
en: Config Charge Type
zh-cn: 配置计费方式
- Parameters:
- instanceType
- vSwitchId
- securityGroupId
- systemDiskCategory
- systemDiskSize
- internetMaxBandwidthIn
- internetMaxBandwidthOut
- instanceName
- ramRoleName
Label:
default:
en: Configure Parameters
zh-cn: 配置参数
- Parameters:
- amount
Label:
default:
en: Instance Count
zh-cn: 实例数量
- Parameters:
- tags
Label:
default:
en: Instance Tags
zh-cn: 实例标签