@@ -8,11 +8,11 @@ import (
88 "github.com/pkg/errors"
99 tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
1010
11+ clbintl "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/clb/v20180317"
1112 "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
1213
1314 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1415 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
15- clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317"
1616)
1717
1818func ResourceTencentCloudClbCustomizedConfigAttachment () * schema.Resource {
@@ -69,7 +69,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentCreate(d *schema.ResourceD
6969
7070 var (
7171 logId = tccommon .GetLogId (tccommon .ContextNil )
72- request = clb .NewAssociateCustomizedConfigRequest ()
72+ request = clbintl .NewAssociateCustomizedConfigRequest ()
7373 configId string
7474 )
7575
@@ -80,7 +80,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentCreate(d *schema.ResourceD
8080
8181 if v , ok := d .GetOk ("bind_list" ); ok {
8282 for _ , item := range v .(* schema.Set ).List () {
83- bindItem := clb .BindItem {}
83+ bindItem := clbintl .BindItem {}
8484 dMap := item .(map [string ]interface {})
8585 if v , ok := dMap ["load_balancer_id" ]; ok {
8686 bindItem .LoadBalancerId = helper .String (v .(string ))
@@ -103,7 +103,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentCreate(d *schema.ResourceD
103103 }
104104
105105 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
106- result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ().AssociateCustomizedConfig (request )
106+ result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ().AssociateCustomizedConfig (request )
107107 if e != nil {
108108 return tccommon .RetryError (e )
109109 } else {
@@ -113,7 +113,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentCreate(d *schema.ResourceD
113113 }
114114
115115 requestId := * result .Response .RequestId
116- retryErr := waitForTaskFinish (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ())
116+ retryErr := waitForTaskFinishIntl (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ())
117117 if retryErr != nil {
118118 return tccommon .RetryError (errors .WithStack (retryErr ))
119119 }
@@ -196,9 +196,9 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
196196 remove := olds .Difference (news ).List ()
197197 add := news .Difference (olds ).List ()
198198 if len (remove ) > 0 {
199- request := clb .NewDisassociateCustomizedConfigRequest ()
199+ request := clbintl .NewDisassociateCustomizedConfigRequest ()
200200 for _ , item := range remove {
201- bindItem := clb .BindItem {}
201+ bindItem := clbintl .BindItem {}
202202 dMap := item .(map [string ]interface {})
203203 if v , ok := dMap ["load_balancer_id" ]; ok {
204204 bindItem .LoadBalancerId = helper .String (v .(string ))
@@ -221,7 +221,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
221221
222222 request .UconfigId = helper .String (id )
223223 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
224- result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ().DisassociateCustomizedConfig (request )
224+ result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ().DisassociateCustomizedConfig (request )
225225 if e != nil {
226226 return tccommon .RetryError (e )
227227 } else {
@@ -231,7 +231,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
231231 }
232232
233233 requestId := * result .Response .RequestId
234- retryErr := waitForTaskFinish (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ())
234+ retryErr := waitForTaskFinishIntl (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ())
235235 if retryErr != nil {
236236 return tccommon .RetryError (errors .WithStack (retryErr ))
237237 }
@@ -247,10 +247,10 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
247247 }
248248
249249 if len (add ) > 0 {
250- request := clb .NewAssociateCustomizedConfigRequest ()
250+ request := clbintl .NewAssociateCustomizedConfigRequest ()
251251 request .UconfigId = helper .String (id )
252252 for _ , item := range add {
253- bindItem := clb .BindItem {}
253+ bindItem := clbintl .BindItem {}
254254 dMap := item .(map [string ]interface {})
255255 if v , ok := dMap ["load_balancer_id" ]; ok {
256256 bindItem .LoadBalancerId = helper .String (v .(string ))
@@ -272,7 +272,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
272272 }
273273
274274 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
275- result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ().AssociateCustomizedConfig (request )
275+ result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ().AssociateCustomizedConfig (request )
276276 if e != nil {
277277 return tccommon .RetryError (e )
278278 } else {
@@ -282,7 +282,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentUpdate(d *schema.ResourceD
282282 }
283283
284284 requestId := * result .Response .RequestId
285- retryErr := waitForTaskFinish (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ())
285+ retryErr := waitForTaskFinishIntl (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ())
286286 if retryErr != nil {
287287 return tccommon .RetryError (errors .WithStack (retryErr ))
288288 }
@@ -306,14 +306,14 @@ func resourceTencentCloudClbCustomizedConfigAttachmentDelete(d *schema.ResourceD
306306
307307 var (
308308 logId = tccommon .GetLogId (tccommon .ContextNil )
309- request = clb .NewDisassociateCustomizedConfigRequest ()
309+ request = clbintl .NewDisassociateCustomizedConfigRequest ()
310310 id = d .Id ()
311311 )
312312
313313 request .UconfigId = helper .String (id )
314314 if v , ok := d .GetOk ("bind_list" ); ok {
315315 for _ , item := range v .(* schema.Set ).List () {
316- bindItem := clb .BindItem {}
316+ bindItem := clbintl .BindItem {}
317317 dMap := item .(map [string ]interface {})
318318 if v , ok := dMap ["load_balancer_id" ]; ok {
319319 bindItem .LoadBalancerId = helper .String (v .(string ))
@@ -336,7 +336,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentDelete(d *schema.ResourceD
336336 }
337337
338338 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
339- result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ().DisassociateCustomizedConfig (request )
339+ result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ().DisassociateCustomizedConfig (request )
340340 if e != nil {
341341 return tccommon .RetryError (e )
342342 } else {
@@ -346,7 +346,7 @@ func resourceTencentCloudClbCustomizedConfigAttachmentDelete(d *schema.ResourceD
346346 }
347347
348348 requestId := * result .Response .RequestId
349- retryErr := waitForTaskFinish (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbClient ())
349+ retryErr := waitForTaskFinishIntl (requestId , meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseClbIntlClient ())
350350 if retryErr != nil {
351351 return tccommon .RetryError (errors .WithStack (retryErr ))
352352 }
0 commit comments