@@ -165,6 +165,34 @@ func ResourceTencentCloudKubernetesClusterAttachment() *schema.Resource {
165
165
ForceNew : true ,
166
166
Description : "Base64-encoded user script, executed before initializing the node, currently only effective for adding existing nodes." ,
167
167
},
168
+ "taints" : {
169
+ Type : schema .TypeList ,
170
+ Optional : true ,
171
+ ForceNew : true ,
172
+ Description : "Node taint." ,
173
+ Elem : & schema.Resource {
174
+ Schema : map [string ]* schema.Schema {
175
+ "key" : {
176
+ Type : schema .TypeString ,
177
+ Optional : true ,
178
+ ForceNew : true ,
179
+ Description : "Key of the taint." ,
180
+ },
181
+ "value" : {
182
+ Type : schema .TypeString ,
183
+ Optional : true ,
184
+ ForceNew : true ,
185
+ Description : "Value of the taint." ,
186
+ },
187
+ "effect" : {
188
+ Type : schema .TypeString ,
189
+ Optional : true ,
190
+ ForceNew : true ,
191
+ Description : "Effect of the taint." ,
192
+ },
193
+ },
194
+ },
195
+ },
168
196
"is_schedule" : {
169
197
Type : schema .TypeBool ,
170
198
Optional : true ,
@@ -490,6 +518,22 @@ func resourceTencentCloudKubernetesClusterAttachmentCreate(d *schema.ResourceDat
490
518
if v , ok := instanceAdvancedSettingsMap ["pre_start_user_script" ]; ok {
491
519
instanceAdvancedSettings .PreStartUserScript = helper .String (v .(string ))
492
520
}
521
+ if v , ok := instanceAdvancedSettingsMap ["taints" ]; ok {
522
+ for _ , item := range v .([]interface {}) {
523
+ taintsMap := item .(map [string ]interface {})
524
+ taint := tke.Taint {}
525
+ if v , ok := taintsMap ["key" ]; ok {
526
+ taint .Key = helper .String (v .(string ))
527
+ }
528
+ if v , ok := taintsMap ["value" ]; ok {
529
+ taint .Value = helper .String (v .(string ))
530
+ }
531
+ if v , ok := taintsMap ["effect" ]; ok {
532
+ taint .Effect = helper .String (v .(string ))
533
+ }
534
+ instanceAdvancedSettings .Taints = append (instanceAdvancedSettings .Taints , & taint )
535
+ }
536
+ }
493
537
if v , ok := instanceAdvancedSettingsMap ["docker_graph_path" ]; ok {
494
538
instanceAdvancedSettings .DockerGraphPath = helper .String (v .(string ))
495
539
}
0 commit comments