@@ -5,8 +5,8 @@ Example Usage
55
66```hcl
77resource "tencentcloud_eip_public_address_adjust" "public_address_adjust" {
8- instance_id = "ins-osckfnm7 "
9- address_id = "eip-erft45fu"
8+ instance_id = "ins-cr2rfq78 "
9+ address_id = "eip-erft45fu"
1010}
1111```
1212*/
@@ -34,7 +34,6 @@ func resourceTencentCloudEipPublicAddressAdjust() *schema.Resource {
3434 Type : schema .TypeString ,
3535 Description : "A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:`ins-osckfnm7`." ,
3636 },
37-
3837 "address_id" : {
3938 Optional : true ,
4039 ForceNew : true ,
@@ -49,13 +48,15 @@ func resourceTencentCloudEipPublicAddressAdjustCreate(d *schema.ResourceData, me
4948 defer logElapsed ("resource.tencentcloud_vpc_public_address_adjust.create" )()
5049 defer inconsistentCheck (d , meta )()
5150
52- logId := getLogId (contextNil )
53-
5451 var (
52+ logId = getLogId (contextNil )
53+ service = VpcService {client : meta .(* TencentCloudClient ).apiV3Conn }
5554 request = vpc .NewAdjustPublicAddressRequest ()
5655 instanceId string
5756 addressId string
57+ taskId uint64
5858 )
59+
5960 if v , ok := d .GetOk ("instance_id" ); ok {
6061 instanceId = v .(string )
6162 request .InstanceId = helper .String (v .(string ))
@@ -73,23 +74,23 @@ func resourceTencentCloudEipPublicAddressAdjustCreate(d *schema.ResourceData, me
7374 } else {
7475 log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n " , logId , request .GetAction (), request .ToJsonString (), result .ToJsonString ())
7576 }
77+
78+ taskId = * result .Response .TaskId
7679 return nil
7780 })
81+
7882 if err != nil {
7983 log .Printf ("[CRITAL]%s operate vpc publicAddressAdjust failed, reason:%+v" , logId , err )
8084 return err
8185 }
8286
83- d .SetId (instanceId + FILED_SP + addressId )
84-
85- service := VpcService {client : meta .(* TencentCloudClient ).apiV3Conn }
86-
87- conf := BuildStateChangeConf ([]string {}, []string {"SUCCESS" }, 1 * readRetryTimeout , time .Second , service .VpcIpv6AddressStateRefreshFunc (d .Id (), []string {}))
87+ conf := BuildStateChangeConf ([]string {}, []string {"SUCCESS" }, 1 * readRetryTimeout , time .Second , service .VpcIpv6AddressStateRefreshFunc (helper .UInt64ToStr (taskId ), []string {}))
8888
8989 if _ , e := conf .WaitForState (); e != nil {
9090 return e
9191 }
9292
93+ d .SetId (instanceId + FILED_SP + addressId )
9394 return resourceTencentCloudEipPublicAddressAdjustRead (d , meta )
9495}
9596
0 commit comments