forked from aliyun/oos-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACS-ECS-BulkyDeleteInstances.json
93 lines (93 loc) · 2.52 KB
/
ACS-ECS-BulkyDeleteInstances.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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"en": "Bulky delete ECS postpaid instances.",
"zh-cn": "\u6279\u91cf\u5220\u9664ECS\u6309\u91cf\u4ed8\u8d39\u5b9e\u4f8b\u3002",
"name-en": "ACS-ECS-BulkyDeleteInstances",
"name-zh-cn": "\u6279\u91cf\u5220\u9664ECS\u5b9e\u4f8b",
"categories": [
"instance_manage"
]
},
"Parameters": {
"targets": {
"Type": "Json",
"AssociationProperty": "Targets",
"AssociationPropertyMetadata": {
"ResourceType": "ALIYUN::ECS::Instance"
}
},
"force": {
"Description": {
"en": "Whether to force the release of a running instance.",
"zh-cn": "\u662f\u5426\u5f3a\u5236\u91ca\u653e\u6b63\u5728\u8fd0\u884c\u7684\u5b9e\u4f8b\u3002"
},
"Type": "Boolean",
"Default": false
},
"rateControl": {
"Description": {
"en": "Concurrency ratio of task execution.",
"zh-cn": "\u4efb\u52a1\u6267\u884c\u7684\u5e76\u53d1\u6bd4\u7387\u3002"
},
"Type": "Json",
"AssociationProperty": "RateControl",
"Default": {
"Mode": "Concurrency",
"MaxErrors": 0,
"Concurrency": 10
}
},
"OOSAssumeRole": {
"Description": {
"en": "The RAM role to be assumed by OOS.",
"zh-cn": "OOS\u626e\u6f14\u7684RAM\u89d2\u8272\u3002"
},
"Type": "String",
"Default": "OOSServiceRole"
}
},
"RamRole": "{{ OOSAssumeRole }}",
"Tasks": [
{
"Name": "getInstance",
"Description": {
"en": "Views the ECS instances.",
"zh-cn": "\u83b7\u53d6ECS\u5b9e\u4f8b\u3002"
},
"Action": "ACS::SelectTargets",
"Properties": {
"ResourceType": "ALIYUN::ECS::Instance",
"Filters": [
"{{ targets }}"
]
},
"Outputs": {
"instanceIds": {
"Type": "List",
"ValueSelector": "Instances.Instance[].InstanceId"
}
}
},
{
"Name": "deleteInstance",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Deletes ECS instance with the specified instance ID.",
"zh-cn": "\u901a\u8fc7\u6307\u5b9a\u5b9e\u4f8bID\u5220\u9664\u5b9e\u4f8b\u3002"
},
"Properties": {
"Service": "ECS",
"API": "DeleteInstance",
"Parameters": {
"InstanceId": "{{ ACS::TaskLoopItem }}",
"Force": "{{ force }}"
}
},
"Loop": {
"RateControl": "{{ rateControl }}",
"Items": "{{ getInstance.instanceIds }}"
}
}
]
}