Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#396 fix vpn connection tunnel output sorting #10584

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions aws/resource_aws_vpn_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"log"
"net"
"regexp"
"sort"
"strings"
"time"

Expand Down Expand Up @@ -592,9 +591,6 @@ func xmlConfigToTunnelInfo(xmlConfig string) (*TunnelInfo, error) {
return nil, fmt.Errorf("Error Unmarshalling XML: %s", err)
}

// don't expect consistent ordering from the XML
sort.Sort(vpnConfig)

tunnelInfo := TunnelInfo{
Tunnel1Address: vpnConfig.Tunnels[0].OutsideAddress,
Tunnel1PreSharedKey: vpnConfig.Tunnels[0].PreSharedKey,
Expand Down
24 changes: 12 additions & 12 deletions aws/resource_aws_vpn_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,27 +584,27 @@ const testAccAwsVpnTunnelInfoXML = `
<ip_address>123.123.123.123</ip_address>
</tunnel_outside_address>
<tunnel_inside_address>
<ip_address>SECOND_CGW_INSIDE_ADDRESS</ip_address>
<ip_address>FIRST_CGW_INSIDE_ADDRESS</ip_address>
<network_mask>255.255.255.252</network_mask>
<network_cidr>30</network_cidr>
</tunnel_inside_address>
</customer_gateway>
<vpn_gateway>
<tunnel_outside_address>
<ip_address>SECOND_ADDRESS</ip_address>
<ip_address>FIRST_ADDRESS</ip_address>
</tunnel_outside_address>
<tunnel_inside_address>
<ip_address>SECOND_VGW_INSIDE_ADDRESS</ip_address>
<ip_address>FIRST_VGW_INSIDE_ADDRESS</ip_address>
<network_mask>255.255.255.252</network_mask>
<network_cidr>30</network_cidr>
</tunnel_inside_address>
<bgp>
<asn>SECOND_BGP_ASN</asn>
<hold_time>32</hold_time>
<asn>FIRST_BGP_ASN</asn>
<hold_time>31</hold_time>
</bgp>
</vpn_gateway>
<ike>
<pre_shared_key>SECOND_KEY</pre_shared_key>
<pre_shared_key>FIRST_KEY</pre_shared_key>
</ike>
</ipsec_tunnel>
<ipsec_tunnel>
Expand All @@ -613,27 +613,27 @@ const testAccAwsVpnTunnelInfoXML = `
<ip_address>123.123.123.123</ip_address>
</tunnel_outside_address>
<tunnel_inside_address>
<ip_address>FIRST_CGW_INSIDE_ADDRESS</ip_address>
<ip_address>SECOND_CGW_INSIDE_ADDRESS</ip_address>
<network_mask>255.255.255.252</network_mask>
<network_cidr>30</network_cidr>
</tunnel_inside_address>
</customer_gateway>
<vpn_gateway>
<tunnel_outside_address>
<ip_address>FIRST_ADDRESS</ip_address>
<ip_address>SECOND_ADDRESS</ip_address>
</tunnel_outside_address>
<tunnel_inside_address>
<ip_address>FIRST_VGW_INSIDE_ADDRESS</ip_address>
<ip_address>SECOND_VGW_INSIDE_ADDRESS</ip_address>
<network_mask>255.255.255.252</network_mask>
<network_cidr>30</network_cidr>
</tunnel_inside_address>
<bgp>
<asn>FIRST_BGP_ASN</asn>
<hold_time>31</hold_time>
<asn>SECOND_BGP_ASN</asn>
<hold_time>32</hold_time>
</bgp>
</vpn_gateway>
<ike>
<pre_shared_key>FIRST_KEY</pre_shared_key>
<pre_shared_key>SECOND_KEY</pre_shared_key>
</ike>
</ipsec_tunnel>
</vpn_connection>
Expand Down