Skip to content

Commit b45a778

Browse files
committed
fix: modify eip
1 parent 4e18f1f commit b45a778

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tencentcloud/services/cvm/resource_tc_eip_association.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func ResourceTencentCloudEipAssociation() *schema.Resource {
6969
"cdc_id": {
7070
Type: schema.TypeString,
7171
Optional: true,
72+
ForceNew: true,
7273
Description: "CDC Unique ID.",
7374
},
7475
},
@@ -225,6 +226,7 @@ func resourceTencentCloudEipAssociationRead(d *schema.ResourceData, meta interfa
225226
ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId)
226227
vpcService = svcvpc.NewVpcService(meta.(tccommon.ProviderMeta).GetAPIV3Conn())
227228
id = d.Id()
229+
eipAddress *vpc.Address
228230
)
229231

230232
association, err := ParseEipAssociationId(id)
@@ -242,6 +244,7 @@ func resourceTencentCloudEipAssociationRead(d *schema.ResourceData, meta interfa
242244
if eip == nil {
243245
d.SetId("")
244246
}
247+
eipAddress = eip
245248

246249
return nil
247250
})
@@ -259,6 +262,9 @@ func resourceTencentCloudEipAssociationRead(d *schema.ResourceData, meta interfa
259262

260263
_ = d.Set("network_interface_id", association.NetworkInterfaceId)
261264
_ = d.Set("private_ip", association.PrivateIp)
265+
if eipAddress.DedicatedClusterId != nil {
266+
_ = d.Set("cdc_ip", eipAddress.DedicatedClusterId)
267+
}
262268
return nil
263269
}
264270

0 commit comments

Comments
 (0)