-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS-BssOpenApi-SetRenewal.yml
251 lines (250 loc) · 7.15 KB
/
ACS-BssOpenApi-SetRenewal.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
FormatVersion: OOS-2019-06-01
Description:
en: Modify resource auto renew attribute
zh-cn: 修改资源自动续费属性
name-en: ACS-BssOpenApi-SetRenewal
name-zh-cn: 修改资源自动续费属性
Parameters:
regionId:
Label:
en: RegionId
zh-cn: 地域ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
resourceIds:
Label:
en: ResourceIds
zh-cn: 资源ID
Type: List
renewalPeriodUnit:
Label:
en: RenewalPeriodUnit
zh-cn: 续费时间单位
Type: String
AllowedValues:
- M
- Y
renewalPeriod:
Label:
en: RenewalPeriod
zh-cn: 续费时长
Type: Number
AllowedValues:
- 1
- 2
- 3
- 6
- 12
renewalStatus:
Label:
en: RenewalStatus
zh-cn: 续费状态
Description:
en: 'Valid values: AutoRenewal: Auto-renewal is enabled for the instance. Normal: Auto-renewal is disabled for the instance.'
zh-cn: 取值范围:AutoRenewal:设置为自动续费。 ManualRenewal:手动续费。 NotRenewal:不再续费。
Type: String
AllowedValues:
- AutoRenewal
- ManualRenewal
- NotRenewal
productCode:
Label:
en: Product code
zh-cn: 产品代码
Type: String
AllowedValues:
- ACS::Bastionhost::Instance
- ACS::CBWP::CommonBandwidthPackage
- ACS::ECS::Instance
- ACS::EIP::EipAddress
- ACS::MongoDB::DBInstance
- ACS::Redis::DBInstance
- ACS::ADB::DBCluster
- ACS::RDS::DBInstance
- ACS::PolarDB::DBCluster
- ACS::SLB::LoadBalancer
- ACS::DdosCoo::Instance
- ACS::CEN::CenBandwidthPackage
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: RenewECSInstance
Action: 'ACS::ExecuteAPI'
When:
Fn::Equals:
- 'ACS::ECS::Instance'
- '{{ productCode }}'
Description:
en: Renew ECS instance
zh-cn: 续费ECS实例
Properties:
Service: ECS
API: RenewInstance
Parameters:
RegionId: '{{regionId}}'
InstanceId: '{{ ACS::TaskLoopItem }}'
Period: '{{ renewalPeriod }}'
PeriodUnit: 'Month'
Loop:
Items: '{{ resourceIds }}'
- Name: RenewRDSInstance
Action: 'ACS::ExecuteAPI'
When:
Fn::Equals:
- 'ACS::RDS::DBInstance'
- '{{ productCode }}'
Description:
en: Renew RDS instance
zh-cn: 续费RDS实例
Properties:
Service: RDS
API: RenewInstance
Parameters:
RegionId: '{{regionId}}'
DBInstanceId: '{{ ACS::TaskLoopItem }}'
Period: '{{ renewalPeriod }}'
Loop:
Items: '{{ resourceIds }}'
- Name: RenewREDISSInstance
Action: 'ACS::ExecuteAPI'
When:
Fn::Equals:
- 'ACS::Redis::DBInstance'
- '{{ productCode }}'
Description:
en: Renew REDIS instance
zh-cn: 续费REDIS实例
Properties:
Service: R-KVSTORE
API: RenewInstance
Parameters:
RegionId: '{{regionId}}'
InstanceId: '{{ ACS::TaskLoopItem }}'
Period: '{{ renewalPeriod }}'
Loop:
Items: '{{ resourceIds }}'
- Name: RenewInstance
Action: ACS::ExecuteAPI
When:
Fn::Not:
Fn::Jq:
- First
- 'contains(["{{productCode}}"])'
- [ "ACS::ECS::Instance", "ACS::RDS::DBInstance", "ACS::Redis::DBInstance" ]
Description:
en: Renew instance
zh-cn: 续费实例
Properties:
Service: BssOpenApi
API: RenewInstance
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ ACS::TaskLoopItem }}'
RenewPeriod: '{{ renewalPeriod }}'
ProductCode:
Fn::Select:
- '{{ productCode }}'
- ACS::CBWP::CommonBandwidthPackage: cbwp
ACS::Bastionhost::Instance: bastionhost
ACS::EIP::EipAddress: eip
ACS::MongoDB::DBInstance: dds
ACS::ADB::DBCluster: ads
ACS::PolarDB::DBCluster: polardb
ACS::SLB::LoadBalancer: slb
ACS::DdosCoo::Instance: ddos
ACS::CEN::CenBandwidthPackage: cbn
ProductType:
Fn::Select:
- '{{ productCode }}'
- ACS::CBWP::CommonBandwidthPackage: ''
ACS::Bastionhost::Instance: bastionhost
ACS::ECS::Instance: ''
ACS::EIP::EipAddress: ''
ACS::MongoDB::DBInstance: ''
ACS::Redis::DBInstance: ''
ACS::ADB::DBCluster: ''
ACS::RDS::DBInstance: rds
ACS::PolarDB::DBCluster: online
ACS::SLB::LoadBalancer: ''
ACS::DdosCoo::Instance: 'ddoscoo'
ACS::CEN::CenBandwidthPackage: 'cbn_bwp_pre'
Loop:
Items: '{{ resourceIds }}'
- Name: ModifyInstanceRenewAttribute
Action: ACS::ExecuteAPI
Description:
en: Modify renew attribute of instance
zh-cn: 修改实例自动续费属性
Properties:
Service: BssOpenApi
API: SetRenewal
Parameters:
RegionId: '{{ regionId }}'
InstanceIDs:
Fn::Join:
- ','
- '{{ resourceIds }}'
RenewalStatus: '{{ renewalStatus }}'
RenewalPeriod: '{{ renewalPeriod }}'
RenewalPeriodUnit: '{{ renewalPeriodUnit }}'
ProductCode:
Fn::Select:
- '{{ productCode }}'
- ACS::CBWP::CommonBandwidthPackage: cbwp
ACS::Bastionhost::Instance: bastionhost
ACS::ECS::Instance: ecs
ACS::EIP::EipAddress: eip
ACS::MongoDB::DBInstance: dds
ACS::Redis::DBInstance: redisa
ACS::ADB::DBCluster: ads
ACS::RDS::DBInstance: rds
ACS::PolarDB::DBCluster: polardb
ACS::SLB::LoadBalancer: slb
ACS::DdosCoo::Instance: ddos
ACS::CEN::CenBandwidthPackage: cbn
ProductType:
Fn::Select:
- '{{ productCode }}'
- ACS::CBWP::CommonBandwidthPackage: ''
ACS::Bastionhost::Instance: bastionhost
ACS::ECS::Instance: ''
ACS::EIP::EipAddress: ''
ACS::MongoDB::DBInstance: ''
ACS::Redis::DBInstance: ''
ACS::ADB::DBCluster: ''
ACS::RDS::DBInstance: rds
ACS::PolarDB::DBCluster: online
ACS::SLB::LoadBalancer: ''
ACS::DdosCoo::Instance: 'ddoscoo'
ACS::CEN::CenBandwidthPackage: 'cbn_bwp_pre'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- productCode
- resourceIds
Label:
default:
zh-cn: 选择资源
en: Select Resource
- Parameters:
- renewalPeriodUnit
- renewalPeriod
- renewalStatus
Label:
default:
zh-cn: 设置续费参数
en: Configure Parameters
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: 高级选项
en: Control Options