-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::ElegantReplaceSystemDiskInSLBDefaultServerGroup.json
169 lines (169 loc) · 4.03 KB
/
ACS::ECS::ElegantReplaceSystemDiskInSLBDefaultServerGroup.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
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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::ECS::ElegantReplaceSystemDiskInSLBDefaultServerGroup",
"name-zh-cn": "更换SLB默认服务器组中实例的系统盘",
"en": "Replaces the system disk in the instance of the SLB default service group",
"zh-cn": "更换SLB默认服务器组中实例的系统盘"
},
"Parameters": {
"regionId": {
"Description": {
"en": "The ID of region",
"zh-cn": "地域ID"
},
"Type": "String",
"Default": "{{ ACS::RegionId }}"
},
"imageId": {
"Description": {
"en": "The ID of image",
"zh-cn": "镜像ID"
},
"Type": "String"
},
"loadBalancerId": {
"Description": {
"en": "The ID of the SLB instance",
"zh-cn": "SLB实例的ID"
},
"Type": "String"
},
"serverId": {
"Description": {
"en": "The ID of ECS instance",
"zh-cn": "ECS实例ID"
},
"Type": "String"
},
"weight": {
"Description": {
"en": "The weight of server",
"zh-cn": "后端服务器的权重"
},
"Type": "Number"
},
"type": {
"Description": {
"en": "The type of server",
"zh-cn": "后端服务器类型"
},
"Type": "String"
},
"port": {
"Description": {
"en": "The port of server",
"zh-cn": "后端服务器端口"
},
"Type": "Number"
}
},
"Tasks": [
{
"Name": "setServerWeightToZero",
"Action": "ACS::ExecuteApi",
"Description": {
"en": "Sets server weight to zero",
"zh-cn": "设置服务器权重为0"
},
"OnError": "recoverServerWeight",
"Properties": {
"Service": "SLB",
"API": "SetBackendServers",
"Parameters": {
"RegionId": "{{ regionId }}",
"BackendServers": {
"Fn::MergeMapToList": [
{
"ServerId": [
"{{ serverId }}"
]
},
{
"Weight": [
0
]
},
{
"Type": [
"{{ type }}"
]
},
{
"Port": [
"{{ port }}"
]
}
]
},
"LoadBalancerId": "{{ loadBalancerId }}"
}
}
},
{
"Name": "replaceSystemDisk",
"Action": "ACS::ECS::ReplaceSystemDisk",
"Description": {
"en": "Replaces the system disk of ECS instances",
"zh-cn": "替换ECS实例的系统盘"
},
"Properties": {
"regionId": "{{ regionId }}",
"instanceId": "{{ serverId }}",
"imageId": "{{ imageId }}"
},
"Outputs": {
"newSystemDiskId": {
"Type": "String",
"ValueSelector": "newSystemDiskId"
}
}
},
{
"Name": "recoverServerWeight",
"Action": "ACS::ExecuteApi",
"Description": {
"en": "Sets the server weight to the original value",
"zh-cn": "将服务器权重设置为原始值"
},
"Properties": {
"Service": "SLB",
"API": "SetBackendServers",
"Parameters": {
"RegionId": "{{ regionId }}",
"BackendServers": {
"Fn::MergeMapToList": [
{
"ServerId": [
"{{ serverId }}"
]
},
{
"Weight": [
"{{ weight }}"
]
},
{
"Type": [
"{{ type }}"
]
},
{
"Port": [
"{{ port }}"
]
}
]
},
"LoadBalancerId": "{{ loadBalancerId }}"
}
}
}
],
"Outputs": {
"newSystemDiskId": {
"Type": "String",
"Value": "{{ replaceSystemDisk.newSystemDiskId }}"
}
}
}