@Test public void testInitVpnConnection() { Configuration vgwConfig = Utils.newAwsConfiguration("vgw", "awstest"); VpnConnection.initVpnConnectionsInfrastructure(vgwConfig); assertThat(vgwConfig.getVrfs(), hasKey(VPN_UNDERLAY_VRF_NAME)); assertThat( vgwConfig.getRoutingPolicies().get(VPN_TO_BACKBONE_EXPORT_POLICY_NAME), equalTo( RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build())); assertThat(vgwConfig.getAllInterfaces(), hasKey(BACKBONE_FACING_INTERFACE_NAME)); }
static void initVpnConnectionsInfrastructure(Configuration gwCfg) { Vrf underlayVrf = Vrf.builder().setOwner(gwCfg).setName(VPN_UNDERLAY_VRF_NAME).build(); RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setOwner(gwCfg) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build(); createBackboneConnection(gwCfg, underlayVrf, VPN_TO_BACKBONE_EXPORT_POLICY_NAME); }
VpnConnection implements AwsVpcEntity, Serializable { static void initVpnConnectionsInfrastructure(Configuration gwCfg) { Vrf underlayVrf = Vrf.builder().setOwner(gwCfg).setName(VPN_UNDERLAY_VRF_NAME).build(); RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setOwner(gwCfg) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build(); createBackboneConnection(gwCfg, underlayVrf, VPN_TO_BACKBONE_EXPORT_POLICY_NAME); } }
VpnConnection implements AwsVpcEntity, Serializable { static void initVpnConnectionsInfrastructure(Configuration gwCfg) { Vrf underlayVrf = Vrf.builder().setOwner(gwCfg).setName(VPN_UNDERLAY_VRF_NAME).build(); RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setOwner(gwCfg) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build(); createBackboneConnection(gwCfg, underlayVrf, VPN_TO_BACKBONE_EXPORT_POLICY_NAME); } VpnConnection(
      boolean isBgpConnection,
      String vpnConnectionId,
      String customerGatewayId,
      GatewayType awsGatewayType,
      String awsGatewayId,
      List<IpsecTunnel> ipsecTunnels,
      List<Prefix> routes,
      List<VgwTelemetry> vgwTelemetrys,
      boolean staticRoutesOnly); }
VpnConnection implements AwsVpcEntity, Serializable { static void initVpnConnectionsInfrastructure(Configuration gwCfg) { Vrf underlayVrf = Vrf.builder().setOwner(gwCfg).setName(VPN_UNDERLAY_VRF_NAME).build(); RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setOwner(gwCfg) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build(); createBackboneConnection(gwCfg, underlayVrf, VPN_TO_BACKBONE_EXPORT_POLICY_NAME); } VpnConnection(
      boolean isBgpConnection,
      String vpnConnectionId,
      String customerGatewayId,
      GatewayType awsGatewayType,
      String awsGatewayId,
      List<IpsecTunnel> ipsecTunnels,
      List<Prefix> routes,
      List<VgwTelemetry> vgwTelemetrys,
      boolean staticRoutesOnly); @Override String getId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
VpnConnection implements AwsVpcEntity, Serializable { static void initVpnConnectionsInfrastructure(Configuration gwCfg) { Vrf underlayVrf = Vrf.builder().setOwner(gwCfg).setName(VPN_UNDERLAY_VRF_NAME).build(); RoutingPolicy.builder() .setName(VPN_TO_BACKBONE_EXPORT_POLICY_NAME) .setOwner(gwCfg) .setStatements(Collections.singletonList(EXPORT_CONNECTED_STATEMENT)) .build(); createBackboneConnection(gwCfg, underlayVrf, VPN_TO_BACKBONE_EXPORT_POLICY_NAME); } VpnConnection(
      boolean isBgpConnection,
      String vpnConnectionId,
      String customerGatewayId,
      GatewayType awsGatewayType,
      String awsGatewayId,
      List<IpsecTunnel> ipsecTunnels,
      List<Prefix> routes,
      List<VgwTelemetry> vgwTelemetrys,
      boolean staticRoutesOnly); @Override String getId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }