@@ -66,6 +66,11 @@ func ResourceTencentCloudEipAssociation() *schema.Resource {
66
66
},
67
67
Description : "Indicates an IP belongs to the `network_interface_id`. This field is conflict with `instance_id`." ,
68
68
},
69
+ "cdc_id" : {
70
+ Type : schema .TypeString ,
71
+ Optional : true ,
72
+ Description : "CDC Unique ID." ,
73
+ },
69
74
},
70
75
}
71
76
}
@@ -82,8 +87,9 @@ func resourceTencentCloudEipAssociationCreate(d *schema.ResourceData, meta inter
82
87
)
83
88
84
89
eipId := d .Get ("eip_id" ).(string )
90
+ cdcId := d .Get ("cdc_id" ).(string )
85
91
err := resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
86
- eip , errRet = vpcService .DescribeEipById (ctx , eipId , "" )
92
+ eip , errRet = vpcService .DescribeEipById (ctx , eipId , cdcId )
87
93
if errRet != nil {
88
94
return tccommon .RetryError (errRet , tccommon .InternalError )
89
95
}
@@ -120,7 +126,7 @@ func resourceTencentCloudEipAssociationCreate(d *schema.ResourceData, meta inter
120
126
121
127
associationId := fmt .Sprintf ("%v::%v" , eipId , instanceId )
122
128
err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
123
- eip , errRet = vpcService .DescribeEipById (ctx , eipId , "" )
129
+ eip , errRet = vpcService .DescribeEipById (ctx , eipId , cdcId )
124
130
if errRet != nil {
125
131
return tccommon .RetryError (errRet )
126
132
}
@@ -183,7 +189,7 @@ func resourceTencentCloudEipAssociationCreate(d *schema.ResourceData, meta inter
183
189
id := fmt .Sprintf ("%v::%v::%v" , eipId , networkId , privateIp )
184
190
185
191
err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
186
- eip , errRet = vpcService .DescribeEipById (ctx , eipId , "" )
192
+ eip , errRet = vpcService .DescribeEipById (ctx , eipId , cdcId )
187
193
if errRet != nil {
188
194
return tccommon .RetryError (errRet )
189
195
}
@@ -226,8 +232,9 @@ func resourceTencentCloudEipAssociationRead(d *schema.ResourceData, meta interfa
226
232
return err
227
233
}
228
234
235
+ cdcId := d .Get ("cdc_id" ).(string )
229
236
err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
230
- eip , errRet := vpcService .DescribeEipById (ctx , association .EipId , "" )
237
+ eip , errRet := vpcService .DescribeEipById (ctx , association .EipId , cdcId )
231
238
if errRet != nil {
232
239
return tccommon .RetryError (errRet )
233
240
}
@@ -270,8 +277,9 @@ func resourceTencentCloudEipAssociationDelete(d *schema.ResourceData, meta inter
270
277
return err
271
278
}
272
279
280
+ cdcId := d .Get ("cdc_id" ).(string )
273
281
err = resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
274
- e := vpcService .UnattachEip (ctx , association .EipId , "" )
282
+ e := vpcService .UnattachEip (ctx , association .EipId , cdcId )
275
283
if e != nil {
276
284
return tccommon .RetryError (e , "DesOperation.MutexTaskRunning" )
277
285
}
0 commit comments