Skip to content

Commit

Permalink
issue 2270 added vpn gateway conn id compute attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaksibm authored and hkantare committed Apr 6, 2021
1 parent ab618e6 commit 4b56d77
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ibm/resource_ibm_is_vpn_gateway_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func TestAccIBMISVPNGatewayConnection_basic(t *testing.T) {
testAccCheckIBMISVPNGatewayConnectionExists("ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", VPNGatewayConnection),
resource.TestCheckResourceAttr(
"ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "name", name1),
resource.TestCheckResourceAttrSet(
"ibm_is_vpn_gateway_connection.testacc_VPNGatewayConnection1", "gateway_connection"),
),
},
resource.TestStep{
Expand Down
8 changes: 8 additions & 0 deletions ibm/resource_ibm_is_vpn_gateway_connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
isVPNGatewayConnectionAdminAuthenticationmode = "authentication_mode"
isVPNGatewayConnectionName = "name"
isVPNGatewayConnectionVPNGateway = "vpn_gateway"
isVPNGatewayConnection = "gateway_connection"
isVPNGatewayConnectionPeerAddress = "peer_address"
isVPNGatewayConnectionPreSharedKey = "preshared_key"
isVPNGatewayConnectionLocalCIDRS = "local_cidrs"
Expand Down Expand Up @@ -139,6 +140,12 @@ func resourceIBMISVPNGatewayConnection() *schema.Resource {
Description: "VPN gateway connection IKE Policy",
},

isVPNGatewayConnection: {
Type: schema.TypeString,
Computed: true,
Description: "The unique identifier for this VPN gateway connection",
},

isVPNGatewayConnectionStatus: {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -495,6 +502,7 @@ func vpngwconGet(d *schema.ResourceData, meta interface{}, gID, gConnID string)
}
return fmt.Errorf("Error Getting Vpn Gateway Connection (%s): %s\n%s", gConnID, err, response)
}
d.Set(isVPNGatewayConnection, gConnID)
vpnGatewayConnection := vpnGatewayConnectionIntf.(*vpcv1.VPNGatewayConnection)
d.Set(isVPNGatewayConnectionName, *vpnGatewayConnection.Name)
d.Set(isVPNGatewayConnectionVPNGateway, gID)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/is_vpc_routing_table_route.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "ibm_is_vpc_routing_table_route" "test_ibm_is_vpc_routing_table_route"
name = "custom-route-2"
destination = "192.168.4.0/24"
action = "deliver"
next_hop = vpnConnectinID
next_hop = ibm_is_vpn_gateway_connection.VPNGatewayConnection.gateway_connection
}
```
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/is_vpn_gateway_connection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The following arguments are supported:
## Attribute Reference

The following attributes are exported:

* `gateway_connection` - The unique identifier for this VPN gateway connection
* `id` - The unique identifier of the VPN gateway connection. The id is composed of \<vpn_gateway_id\>/\<vpn_gateway_connection_id\>.
* `status` - The status of VPN gateway connection.
* `authentication_mode` - The authentication mode,Only psk is currently supported..
Expand Down

0 comments on commit 4b56d77

Please sign in to comment.