Skip to content

Commit 9e3c958

Browse files
committed
[bugfix for vpngw and vpn connection]
1. fix force new issue when apply repeatedly.
1 parent 3e6afb4 commit 9e3c958

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## 1.41.1 (Unreleased)
2+
3+
BUG FIXES:
4+
5+
* Resource: `tencentcloud_vpn_gateway` fix force new issue when apply repeatedly.
6+
* Resource: `tencentcloud_vpn_connection` fix force new issue when apply repeatedly.
7+
28
## 1.41.0 (August 17, 2020)
39

410
FEATURES:

tencentcloud/resource_tc_vpn_connection.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ func resourceTencentCloudVpnConnectionCreate(d *schema.ResourceData, meta interf
315315
}
316316
request.VpcId = helper.String(d.Get("vpc_id").(string))
317317
} else {
318+
if _, ok := d.GetOk("vpc_id"); ok {
319+
return fmt.Errorf("[CRITAL] vpc_id doesn't make sense when vpn gateway is in CCN type")
320+
}
318321
request.VpcId = helper.String("")
319322
}
320323
request.VpnGatewayId = helper.String(d.Get("vpn_gateway_id").(string))
@@ -545,7 +548,6 @@ func resourceTencentCloudVpnConnectionRead(d *schema.ResourceData, meta interfac
545548

546549
connection := response.Response.VpnConnectionSet[0]
547550
_ = d.Set("name", *connection.VpnConnectionName)
548-
_ = d.Set("vpc_id", *connection.VpcId)
549551
_ = d.Set("create_time", *connection.CreatedTime)
550552
_ = d.Set("vpn_gateway_id", *connection.VpnGatewayId)
551553
_ = d.Set("customer_gateway_id", *connection.CustomerGatewayId)

tencentcloud/resource_tc_vpn_gateway.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ func resourceTencentCloudVpnGatewayCreate(d *schema.ResourceData, meta interface
191191
}
192192
request.VpcId = helper.String(d.Get("vpc_id").(string))
193193
} else {
194+
if _, ok := d.GetOk("vpc_id"); ok {
195+
return fmt.Errorf("[CRITAL] vpc_id doesn't make sense when vpn gateway is in CCN type")
196+
}
194197
request.VpcId = helper.String("")
195198
}
196199
} else {

0 commit comments

Comments
 (0)