From 4b56d774883eeb4d59f91dc6cfdfd38d6688c86a Mon Sep 17 00:00:00 2001 From: Deepak Selvakumar Date: Mon, 5 Apr 2021 18:43:04 +0530 Subject: [PATCH] issue 2270 added vpn gateway conn id compute attribute --- ibm/resource_ibm_is_vpn_gateway_connection_test.go | 2 ++ ibm/resource_ibm_is_vpn_gateway_connections.go | 8 ++++++++ website/docs/r/is_vpc_routing_table_route.html.markdown | 2 +- website/docs/r/is_vpn_gateway_connection.html.markdown | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ibm/resource_ibm_is_vpn_gateway_connection_test.go b/ibm/resource_ibm_is_vpn_gateway_connection_test.go index f40595f517..0f09a67b2b 100644 --- a/ibm/resource_ibm_is_vpn_gateway_connection_test.go +++ b/ibm/resource_ibm_is_vpn_gateway_connection_test.go @@ -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{ diff --git a/ibm/resource_ibm_is_vpn_gateway_connections.go b/ibm/resource_ibm_is_vpn_gateway_connections.go index 3d852b6631..e23b212531 100644 --- a/ibm/resource_ibm_is_vpn_gateway_connections.go +++ b/ibm/resource_ibm_is_vpn_gateway_connections.go @@ -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" @@ -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, @@ -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) diff --git a/website/docs/r/is_vpc_routing_table_route.html.markdown b/website/docs/r/is_vpc_routing_table_route.html.markdown index f0a1f0313a..f7433ef6af 100644 --- a/website/docs/r/is_vpc_routing_table_route.html.markdown +++ b/website/docs/r/is_vpc_routing_table_route.html.markdown @@ -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 } ``` diff --git a/website/docs/r/is_vpn_gateway_connection.html.markdown b/website/docs/r/is_vpn_gateway_connection.html.markdown index 56fbd24c47..08b8035740 100644 --- a/website/docs/r/is_vpn_gateway_connection.html.markdown +++ b/website/docs/r/is_vpn_gateway_connection.html.markdown @@ -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 \/\. * `status` - The status of VPN gateway connection. * `authentication_mode` - The authentication mode,Only psk is currently supported..