Search in sources :

Example 1 with Vpc

use of software.amazon.awssdk.services.ec2.model.Vpc in project photon-model by vmware.

the class AWSRemoteCleanup method cleanUpVpc.

/**
 * Cleaning all VPC's that are not tagged with a name: enumtest-vpc or a default VPC in US_EAST_1 region
 * Deleting a VPC would require its dependencies to be deleted in the following order:
 * 1) EC2 Instances
 * 2) NAT Gateway
 * 3) Internet Gateway
 * 4) VPN Gateway
 * 5) Network ACL's
 * 6) Security Group ( not deleting default SG)
 * 7) Subnets
 * NOTE: Not deleting RouteTables currently
 */
@Test
public void cleanUpVpc() {
    if (this.isMock) {
        return;
    }
    AmazonEC2 usEastEc2Client = this.ec2Clients.get(US_EAST_1_TAG);
    DescribeVpcsResult vpcsResult = usEastEc2Client.describeVpcs();
    List<Vpc> vpcs = vpcsResult.getVpcs();
    List<String> vpcIdsToBeDeleted = new ArrayList<>();
    List<String> enumTestVpcIds = new ArrayList<>();
    try {
        vpcs.stream().forEach(vpc -> {
            vpc.getTags().stream().filter(tag -> tag.getKey().equalsIgnoreCase(NAME_TAG_KEY) && this.vpcTagsNotToBeDeleted.contains(tag.getValue().toLowerCase())).forEach(tag -> enumTestVpcIds.add(vpc.getVpcId()));
            if (!vpc.getIsDefault()) {
                vpcIdsToBeDeleted.add(vpc.getVpcId());
            }
        });
        vpcIdsToBeDeleted.removeAll(enumTestVpcIds);
        vpcIdsToBeDeleted.stream().forEach(vpcId -> {
            DescribeInstancesRequest instancesRequest = new DescribeInstancesRequest().withFilters(new Filter(VPC_KEY, Collections.singletonList(vpcId)));
            DescribeInstancesResult instancesResult = usEastEc2Client.describeInstances(instancesRequest);
            deleteAwsEc2instances(vpcIdsToBeDeleted, instancesResult, usEastEc2Client);
            deleteNATGateway(vpcId, usEastEc2Client);
            deleteNetworkInterfaces(vpcId, usEastEc2Client);
            deleteInternetGateways(vpcId, usEastEc2Client);
            deleteVirtualPrivateGateways(vpcId, usEastEc2Client);
            disassociateAndDeleteNetworkACLs(vpcId, usEastEc2Client);
            deleteSecurityGroups(vpcId, usEastEc2Client);
            deleteSubnets(vpcId, usEastEc2Client);
            DeleteVpcRequest deleteVpcRequest = new DeleteVpcRequest().withVpcId(vpcId);
            this.host.log("Terminating stale vpc: %s", vpcId);
            usEastEc2Client.deleteVpc(deleteVpcRequest);
        });
    } catch (Exception e) {
        this.host.log(Level.INFO, e.getMessage());
    }
}
Also used : DescribeVpcsResult(com.amazonaws.services.ec2.model.DescribeVpcsResult) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) DescribeNetworkAclsResult(com.amazonaws.services.ec2.model.DescribeNetworkAclsResult) DescribeSubnetsRequest(com.amazonaws.services.ec2.model.DescribeSubnetsRequest) DeleteVpnGatewayRequest(com.amazonaws.services.ec2.model.DeleteVpnGatewayRequest) TerminateInstancesResult(com.amazonaws.services.ec2.model.TerminateInstancesResult) ReleaseAddressRequest(com.amazonaws.services.ec2.model.ReleaseAddressRequest) DescribeSubnetsResult(com.amazonaws.services.ec2.model.DescribeSubnetsResult) CommandLineArgumentParser(com.vmware.xenon.common.CommandLineArgumentParser) Utils(com.vmware.xenon.common.Utils) DescribeNetworkAclsRequest(com.amazonaws.services.ec2.model.DescribeNetworkAclsRequest) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) Map(java.util.Map) DescribeNetworkInterfacesResult(com.amazonaws.services.ec2.model.DescribeNetworkInterfacesResult) DeleteSubnetRequest(com.amazonaws.services.ec2.model.DeleteSubnetRequest) Reservation(com.amazonaws.services.ec2.model.Reservation) DeleteVpcRequest(com.amazonaws.services.ec2.model.DeleteVpcRequest) DescribeInternetGatewaysResult(com.amazonaws.services.ec2.model.DescribeInternetGatewaysResult) DescribeVolumesResult(com.amazonaws.services.ec2.model.DescribeVolumesResult) DescribeInstancesResult(com.amazonaws.services.ec2.model.DescribeInstancesResult) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) DeleteNetworkInterfaceRequest(com.amazonaws.services.ec2.model.DeleteNetworkInterfaceRequest) List(java.util.List) Tag(com.amazonaws.services.ec2.model.Tag) DeleteInternetGatewayRequest(com.amazonaws.services.ec2.model.DeleteInternetGatewayRequest) BasicTestCase(com.vmware.xenon.common.BasicTestCase) HashMap(java.util.HashMap) DeleteNetworkAclRequest(com.amazonaws.services.ec2.model.DeleteNetworkAclRequest) DescribeNetworkInterfacesRequest(com.amazonaws.services.ec2.model.DescribeNetworkInterfacesRequest) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) Regions(com.amazonaws.regions.Regions) DescribeVpcsResult(com.amazonaws.services.ec2.model.DescribeVpcsResult) DisassociateAddressRequest(com.amazonaws.services.ec2.model.DisassociateAddressRequest) DescribeSecurityGroupsResult(com.amazonaws.services.ec2.model.DescribeSecurityGroupsResult) AmazonEC2(com.amazonaws.services.ec2.AmazonEC2) DescribeSecurityGroupsRequest(com.amazonaws.services.ec2.model.DescribeSecurityGroupsRequest) Filter(com.amazonaws.services.ec2.model.Filter) Volume(com.amazonaws.services.ec2.model.Volume) DescribeVpnGatewaysResult(com.amazonaws.services.ec2.model.DescribeVpnGatewaysResult) Instance(com.amazonaws.services.ec2.model.Instance) Before(org.junit.Before) Vpc(com.amazonaws.services.ec2.model.Vpc) DescribeNatGatewaysResult(com.amazonaws.services.ec2.model.DescribeNatGatewaysResult) Test(org.junit.Test) DescribeAddressesRequest(com.amazonaws.services.ec2.model.DescribeAddressesRequest) DetachInternetGatewayRequest(com.amazonaws.services.ec2.model.DetachInternetGatewayRequest) DetachVpnGatewayRequest(com.amazonaws.services.ec2.model.DetachVpnGatewayRequest) TerminateInstancesRequest(com.amazonaws.services.ec2.model.TerminateInstancesRequest) DeleteNatGatewayRequest(com.amazonaws.services.ec2.model.DeleteNatGatewayRequest) Bucket(com.amazonaws.services.s3.model.Bucket) DeleteSecurityGroupRequest(com.amazonaws.services.ec2.model.DeleteSecurityGroupRequest) DescribeNatGatewaysRequest(com.amazonaws.services.ec2.model.DescribeNatGatewaysRequest) TimeUnit(java.util.concurrent.TimeUnit) DescribeVpnGatewaysRequest(com.amazonaws.services.ec2.model.DescribeVpnGatewaysRequest) DeleteVolumeRequest(com.amazonaws.services.ec2.model.DeleteVolumeRequest) DescribeAddressesResult(com.amazonaws.services.ec2.model.DescribeAddressesResult) Collections(java.util.Collections) DescribeInternetGatewaysRequest(com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest) Vpc(com.amazonaws.services.ec2.model.Vpc) ArrayList(java.util.ArrayList) AmazonEC2(com.amazonaws.services.ec2.AmazonEC2) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) DescribeInstancesResult(com.amazonaws.services.ec2.model.DescribeInstancesResult) Filter(com.amazonaws.services.ec2.model.Filter) DeleteVpcRequest(com.amazonaws.services.ec2.model.DeleteVpcRequest) Test(org.junit.Test)

Example 2 with Vpc

use of software.amazon.awssdk.services.ec2.model.Vpc in project photon-model by vmware.

the class AWSNetworkStateEnumerationAdapterService method updateTagLinks.

private DeferredResult<AWSNetworkStateCreationContext> updateTagLinks(AWSNetworkStateCreationContext context) {
    if ((context.awsVpcs == null || context.awsVpcs.isEmpty()) && (context.awsSubnets == null || context.awsSubnets.isEmpty())) {
        logFine(() -> "No local vpcs or subnets to be updated so there are no tags to update.");
        return DeferredResult.completed(context);
    } else {
        List<DeferredResult<Set<String>>> updateNetworkSubnetTagLinksOps = new ArrayList<>();
        // update tag links for the existing NetworkStates
        for (String vpcId : context.awsVpcs.keySet()) {
            if (!context.localNetworkStateMap.containsKey(vpcId)) {
                // this is not a network to update
                continue;
            }
            Vpc vpc = context.awsVpcs.get(vpcId);
            NetworkState existingNetworkState = context.localNetworkStateMap.get(vpcId);
            Map<String, String> remoteTags = new HashMap<>();
            for (Tag awsVpcTag : vpc.getTags()) {
                if (!awsVpcTag.getKey().equals(AWSConstants.AWS_TAG_NAME)) {
                    remoteTags.put(awsVpcTag.getKey(), awsVpcTag.getValue());
                }
            }
            updateNetworkSubnetTagLinksOps.add(updateLocalTagStates(this, existingNetworkState, remoteTags, null));
        }
        // update tag links for the existing SubnetStates
        for (String subnetId : context.awsSubnets.keySet()) {
            if (!context.localSubnetStateMap.containsKey(subnetId)) {
                // this is not a subnet to update
                continue;
            }
            Subnet subnet = context.awsSubnets.get(subnetId);
            SubnetState existingSubnetState = context.localSubnetStateMap.get(subnetId);
            Map<String, String> remoteTags = new HashMap<>();
            for (Tag awsSubnetTag : subnet.getTags()) {
                if (!awsSubnetTag.getKey().equals(AWSConstants.AWS_TAG_NAME)) {
                    remoteTags.put(awsSubnetTag.getKey(), awsSubnetTag.getValue());
                }
            }
            updateNetworkSubnetTagLinksOps.add(updateLocalTagStates(this, existingSubnetState, remoteTags, null));
        }
        return DeferredResult.allOf(updateNetworkSubnetTagLinksOps).thenApply(ignore -> context);
    }
}
Also used : ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Vpc(com.amazonaws.services.ec2.model.Vpc) AWSNetworkUtils.mapVPCToNetworkState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.mapVPCToNetworkState) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState) Tag(com.amazonaws.services.ec2.model.Tag) Subnet(com.amazonaws.services.ec2.model.Subnet) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) AWSNetworkUtils.mapSubnetToSubnetState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.mapSubnetToSubnetState) DeferredResult(com.vmware.xenon.common.DeferredResult)

Example 3 with Vpc

use of software.amazon.awssdk.services.ec2.model.Vpc in project photon-model by vmware.

the class AWSNetworkStateEnumerationAdapterService method createNetworkStateOperations.

/**
 * Create the network state operations for all the VPCs that need to be created or updated in
 * the system.
 */
private void createNetworkStateOperations(AWSNetworkStateCreationContext context, AWSNetworkStateCreationStage next) {
    if (context.vpcs.isEmpty()) {
        logFine(() -> "No new VPCs have been discovered.");
        handleNetworkStateChanges(context, next);
        return;
    }
    final List<Operation> networkOperations = new ArrayList<>();
    for (String remoteVPCId : context.vpcs.keySet()) {
        NetworkState networkState = context.vpcs.get(remoteVPCId);
        final Operation networkStateOp;
        if (context.localNetworkStateMap.containsKey(remoteVPCId)) {
            // If the local network state already exists for the VPC -> Update it.
            networkState.documentSelfLink = context.localNetworkStateMap.get(remoteVPCId).documentSelfLink;
            // don't overwrite resourcePoolLink
            networkState.resourcePoolLink = null;
            if (networkState.tagLinks == null || networkState.tagLinks.isEmpty()) {
                setTagLinksToResourceState(networkState, context.networkInternalTagsMap, false);
            } else {
                context.networkInternalTagLinksSet.stream().filter(tagLink -> !networkState.tagLinks.contains(tagLink)).map(tagLink -> networkState.tagLinks.add(tagLink)).collect(Collectors.toSet());
            }
            networkStateOp = createPatchOperation(this, networkState, networkState.documentSelfLink);
        } else {
            Vpc awsVpc = context.awsVpcs.get(remoteVPCId);
            // Add both external and internal tags.
            setResourceTags(networkState, awsVpc.getTags());
            setTagLinksToResourceState(networkState, context.networkInternalTagsMap, false);
            networkStateOp = createPostOperation(this, networkState, NetworkService.FACTORY_LINK);
        }
        networkOperations.add(networkStateOp);
    }
    JoinedCompletionHandler joinCompletion = (ops, excs) -> {
        if (excs != null) {
            Entry<Long, Throwable> excEntry = excs.entrySet().iterator().next();
            Throwable exc = excEntry.getValue();
            Operation op = ops.get(excEntry.getKey());
            logSevere(() -> String.format("Error %s-ing a Network state: %s", op.getAction(), Utils.toString(excs)));
            finishWithFailure(context, exc);
            return;
        }
        logFine(() -> "Created/updated all network states.");
        ops.values().stream().filter(op -> op.getStatusCode() != Operation.STATUS_CODE_NOT_MODIFIED).forEach(op -> {
            NetworkState networkState = op.getBody(NetworkState.class);
            context.vpcs.put(networkState.id, networkState);
        });
        handleNetworkStateChanges(context, next);
    };
    OperationJoin.create(networkOperations).setCompletion(joinCompletion).sendWith(this);
}
Also used : Arrays(java.util.Arrays) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) AWSNetworkUtils.mapVPCToNetworkState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.mapVPCToNetworkState) DescribeSubnetsRequest(com.amazonaws.services.ec2.model.DescribeSubnetsRequest) DescribeVpcsRequest(com.amazonaws.services.ec2.model.DescribeVpcsRequest) AWSResourceType(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWSResourceType) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) QueryTask(com.vmware.xenon.services.common.QueryTask) LifecycleState(com.vmware.photon.controller.model.resources.ComputeService.LifecycleState) ServiceDocument(com.vmware.xenon.common.ServiceDocument) AWSNetworkUtils.createQueryToGetExistingNetworkStatesFilteredByDiscoveredVPCs(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.createQueryToGetExistingNetworkStatesFilteredByDiscoveredVPCs) DescribeSubnetsResult(com.amazonaws.services.ec2.model.DescribeSubnetsResult) Utils(com.vmware.xenon.common.Utils) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) Map(java.util.Map) SubnetStateWithParentVpcId(com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSNetworkStateEnumerationAdapterService.AWSNetworkStateCreationContext.SubnetStateWithParentVpcId) AWS_ATTACHMENT_VPC_FILTER(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_ATTACHMENT_VPC_FILTER) InternetGatewayAttachment(com.amazonaws.services.ec2.model.InternetGatewayAttachment) AdapterUtils.createPatchOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPatchOperation) URI(java.net.URI) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState) AWSClientManager(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManager) SubnetService(com.vmware.photon.controller.model.resources.SubnetService) AWS_MAIN_ROUTE_ASSOCIATION(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_MAIN_ROUTE_ASSOCIATION) AWSAsyncHandler(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSAsyncHandler) StatelessService(com.vmware.xenon.common.StatelessService) AWSNetworkUtils.mapSubnetToSubnetState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.mapSubnetToSubnetState) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) DescribeInternetGatewaysResult(com.amazonaws.services.ec2.model.DescribeInternetGatewaysResult) Set(java.util.Set) Occurance(com.vmware.xenon.services.common.QueryTask.Query.Occurance) AdapterUtils.getDeletionState(com.vmware.photon.controller.model.adapters.util.AdapterUtils.getDeletionState) Collectors(java.util.stream.Collectors) AWS_GATEWAY_ID(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_GATEWAY_ID) List(java.util.List) AWS_FILTER_VPC_ID(com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.AWS_FILTER_VPC_ID) DescribeRouteTablesRequest(com.amazonaws.services.ec2.model.DescribeRouteTablesRequest) TagService(com.vmware.photon.controller.model.resources.TagService) CompletionHandler(com.vmware.xenon.common.Operation.CompletionHandler) Tag(com.amazonaws.services.ec2.model.Tag) DeferredResult(com.vmware.xenon.common.DeferredResult) TAG_KEY_TYPE(com.vmware.photon.controller.model.constants.PhotonModelConstants.TAG_KEY_TYPE) Entry(java.util.Map.Entry) TagsUtil.setTagLinksToResourceState(com.vmware.photon.controller.model.adapters.util.TagsUtil.setTagLinksToResourceState) DescribeRouteTablesResult(com.amazonaws.services.ec2.model.DescribeRouteTablesResult) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) HashMap(java.util.HashMap) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) JoinedCompletionHandler(com.vmware.xenon.common.OperationJoin.JoinedCompletionHandler) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) HashSet(java.util.HashSet) AWSConstants(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) DescribeVpcsResult(com.amazonaws.services.ec2.model.DescribeVpcsResult) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) Query(com.vmware.xenon.services.common.QueryTask.Query) UriPaths(com.vmware.photon.controller.model.UriPaths) TagsUtil.updateLocalTagStates(com.vmware.photon.controller.model.adapters.util.TagsUtil.updateLocalTagStates) AdapterUtils.createPostOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation) BiConsumer(java.util.function.BiConsumer) Filter(com.amazonaws.services.ec2.model.Filter) RouteTable(com.amazonaws.services.ec2.model.RouteTable) Subnet(com.amazonaws.services.ec2.model.Subnet) AWS_VPC_ROUTE_TABLE_ID(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_VPC_ROUTE_TABLE_ID) AmazonWebServiceRequest(com.amazonaws.AmazonWebServiceRequest) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) Vpc(com.amazonaws.services.ec2.model.Vpc) AdapterUriUtil(com.vmware.photon.controller.model.adapters.util.AdapterUriUtil) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) AWSNetworkUtils.createQueryToGetExistingSubnetStatesFilteredByDiscoveredSubnets(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.createQueryToGetExistingSubnetStatesFilteredByDiscoveredSubnets) NumericRange.createLessThanRange(com.vmware.xenon.services.common.QueryTask.NumericRange.createLessThanRange) AWSUtils(com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils) AWS_VPC_ID_FILTER(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWS_VPC_ID_FILTER) InternetGateway(com.amazonaws.services.ec2.model.InternetGateway) NetworkService(com.vmware.photon.controller.model.resources.NetworkService) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) AWSClientManagerFactory(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManagerFactory) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState) DescribeInternetGatewaysRequest(com.amazonaws.services.ec2.model.DescribeInternetGatewaysRequest) AWSUriPaths(com.vmware.photon.controller.model.adapters.awsadapter.AWSUriPaths) OperationJoin(com.vmware.xenon.common.OperationJoin) AmazonEC2AsyncClient(com.amazonaws.services.ec2.AmazonEC2AsyncClient) JoinedCompletionHandler(com.vmware.xenon.common.OperationJoin.JoinedCompletionHandler) Entry(java.util.Map.Entry) ArrayList(java.util.ArrayList) Vpc(com.amazonaws.services.ec2.model.Vpc) AdapterUtils.createPatchOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPatchOperation) AdapterUtils.createPostOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation) Operation(com.vmware.xenon.common.Operation) AWSNetworkUtils.mapVPCToNetworkState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSNetworkUtils.mapVPCToNetworkState) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState)

Example 4 with Vpc

use of software.amazon.awssdk.services.ec2.model.Vpc in project photon-model by vmware.

the class AWSNetworkClient method getVPC.

public Vpc getVPC(String vpcId) {
    DescribeVpcsRequest req = new DescribeVpcsRequest().withVpcIds(vpcId);
    DescribeVpcsResult result = this.client.describeVpcs(req);
    List<Vpc> vpcs = result.getVpcs();
    if (vpcs != null && vpcs.size() == 1) {
        return vpcs.get(0);
    }
    return null;
}
Also used : DescribeVpcsResult(com.amazonaws.services.ec2.model.DescribeVpcsResult) DescribeVpcsRequest(com.amazonaws.services.ec2.model.DescribeVpcsRequest) Vpc(com.amazonaws.services.ec2.model.Vpc)

Example 5 with Vpc

use of software.amazon.awssdk.services.ec2.model.Vpc in project photon-model by vmware.

the class TestAWSNetworkService method testGetMainRouteTable.

@Test
public void testGetMainRouteTable() throws Throwable {
    Vpc defVPC = this.netClient.getDefaultVPC();
    assertTrue(defVPC != null);
    RouteTable routeTable = this.netClient.getMainRouteTable(defVPC.getVpcId());
    assertTrue(routeTable != null);
}
Also used : RouteTable(com.amazonaws.services.ec2.model.RouteTable) Vpc(com.amazonaws.services.ec2.model.Vpc) Test(org.junit.Test)

Aggregations

Vpc (com.amazonaws.services.ec2.model.Vpc)27 HashMap (java.util.HashMap)21 DescribeVpcsResult (com.amazonaws.services.ec2.model.DescribeVpcsResult)20 DescribeSubnetsResult (com.amazonaws.services.ec2.model.DescribeSubnetsResult)18 AmazonEC2Client (com.amazonaws.services.ec2.AmazonEC2Client)17 Test (org.junit.Test)16 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)14 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)14 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)14 Group (com.sequenceiq.cloudbreak.cloud.model.Group)14 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)14 Location (com.sequenceiq.cloudbreak.cloud.model.Location)14 Network (com.sequenceiq.cloudbreak.cloud.model.Network)14 Subnet (com.sequenceiq.cloudbreak.cloud.model.Subnet)14 ArrayList (java.util.ArrayList)8 Subnet (com.amazonaws.services.ec2.model.Subnet)7 DescribeVpcsRequest (com.amazonaws.services.ec2.model.DescribeVpcsRequest)6 DescribeSubnetsRequest (com.amazonaws.services.ec2.model.DescribeSubnetsRequest)5 Filter (com.amazonaws.services.ec2.model.Filter)5 NetworkState (com.vmware.photon.controller.model.resources.NetworkService.NetworkState)5