-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::RunInstancesFromTemplate.json
102 lines (102 loc) · 2.6 KB
/
ACS::ECS::RunInstancesFromTemplate.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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::ECS::RunInstancesFromTemplate",
"name-zh-cn": "通过启动模板创建ECS实例",
"en": "Creates one or more ECS instances by specifying launch template",
"zh-cn": "通过指定启动模板创建一个或多个ECS实例"
},
"Parameters": {
"regionId": {
"Description": {
"en": "The ID of region",
"zh-cn": "地域ID"
},
"Type": "String",
"Default": "{{ ACS::RegionId }}"
},
"launchTemplateId": {
"Description": {
"en": "The ID of the instance launch template",
"zh-cn": "实例启动模板的ID"
},
"Type": "String",
"Default": ""
},
"launchTemplateName": {
"Description": {
"en": "The name of the instance launch template",
"zh-cn": "实例启动模板的名称"
},
"Type": "String",
"Default": ""
},
"amount": {
"Description": {
"en": "The specified number of instances you want to create",
"zh-cn": "要创建的指定实例数量"
},
"Type": "Number",
"Default": 1
}
},
"Tasks": [
{
"Name": "runInstances",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Runs ECS instances",
"zh-cn": "创建ECS实例"
},
"Properties": {
"Service": "ECS",
"API": "RunInstances",
"Parameters": {
"RegionId": "{{ regionId }}",
"LaunchTemplateId": "{{ launchTemplateId }}",
"LaunchTemplateName": "{{ launchTemplateName }}",
"Amount": "{{ amount }}"
}
},
"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": "等待创建的实例到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 }}"
}
}
}