if (configuration.getVendorFamily().getAws().getSubnetId() != null) { String subnetId = configuration.getVendorFamily().getAws().getSubnetId(); Aggregate subnetAggregate = pojoTopology.getOrCreateAggregate(subnetId, AggregateType.SUBNET); subnetAggregate.getContents().add(pojoNode.getId()); String vpcId = configuration.getVendorFamily().getAws().getVpcId(); Aggregate vpcAggregate = pojoTopology.getOrCreateAggregate(vpcId, AggregateType.VNET); vpcAggregate.getContents().add(subnetAggregate.getId()); } else if (configuration.getVendorFamily().getAws().getVpcId() != null) { String vpcId = configuration.getVendorFamily().getAws().getVpcId(); Aggregate vpcAggregate = pojoTopology.getOrCreateAggregate(vpcId, AggregateType.VNET); vpcAggregate.getContents().add(pojoNode.getId()); String region = configuration.getVendorFamily().getAws().getRegion(); Aggregate regionAggregate = pojoTopology.getOrCreateAggregate(region, AggregateType.REGION); regionAggregate.getContents().add(vpcAggregate.getId()); } else if (configuration.getVendorFamily().getAws().getRegion() != null) { String region = configuration.getVendorFamily().getAws().getRegion(); Aggregate regionAggregate = pojoTopology.getOrCreateAggregate(region, AggregateType.REGION);
iface.setAllAddresses(ifaceAddresses); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
public Configuration toConfigurationNode( AwsConfiguration awsConfiguration, Region region, Warnings warnings) { Configuration cfgNode = Utils.newAwsConfiguration(_vpcId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName()); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode .getDefaultVrf() .getStaticRoutes() .add( StaticRoute.builder() .setAdministrativeCost(Route.DEFAULT_STATIC_ROUTE_ADMIN) .setMetric(Route.DEFAULT_STATIC_ROUTE_COST) .setNetwork(_cidrBlock) .setNextHopInterface(Interface.NULL_INTERFACE_NAME) .build()); // we only create a node here // interfaces are added to this node as we traverse subnets and // internetgateways return cfgNode; } }
public Configuration toConfigurationNode( AwsConfiguration awsConfiguration, Region region, Warnings warnings) { Configuration cfgNode = Utils.newAwsConfiguration(_natGatewayId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName()); // TODO: Configure forwarding for this NAT // for (NatGatewayAddress natAddress : _natGatewayAddresses) { // foreach natgatewayaddress create interfaces for public and private IPs, configure NAT rules // also connect the nat to the VPC router // } return cfgNode; } }
public static Configuration newAwsConfiguration(String name, String domainName) { Configuration c = FACTORY .configurationBuilder() .setHostname(name) .setDomainName(domainName) .setConfigurationFormat(ConfigurationFormat.AWS) .setDefaultInboundAction(LineAction.PERMIT) .setDefaultCrossZoneAction(LineAction.PERMIT) .build(); FACTORY.vrfBuilder().setName(Configuration.DEFAULT_VRF_NAME).setOwner(c).build(); c.getVendorFamily().setAws(new AwsFamily()); return c; }
public Configuration toConfigurationNode(AwsConfiguration awsConfiguration, Region region) { Configuration cfgNode = Utils.newAwsConfiguration(_internetGatewayId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
subnetToVpc.setOutgoingFilter(outAcl); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
public Configuration toConfigurationNode( AwsConfiguration awsConfiguration, Region region, Warnings warnings) { Configuration cfgNode = Utils.newAwsConfiguration(_vpnGatewayId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName());