Search in sources :

Example 16 with AmazonCloudFormationClient

use of com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient in project cloudbreak by hortonworks.

the class AwsNetworkConnectorTest method testDeleteNetworkWithSubNetsWhenCfStackDoesNotExist.

@Test
public void testDeleteNetworkWithSubNetsWhenCfStackDoesNotExist() {
    NetworkDeletionRequest networkDeletionRequest = createNetworkDeletionRequest();
    AmazonCloudFormationClient cfClient = mock(AmazonCloudFormationClient.class);
    when(awsClient.createCloudFormationClient(any(AwsCredentialView.class), eq(networkDeletionRequest.getRegion()))).thenReturn(cfClient);
    when(retryService.testWith2SecDelayMax15Times(any())).thenReturn(false);
    underTest.deleteNetworkWithSubnets(networkDeletionRequest);
    verify(cfClient, never()).deleteStack(any(DeleteStackRequest.class));
}
Also used : AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) NetworkDeletionRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkDeletionRequest) DeleteStackRequest(com.amazonaws.services.cloudformation.model.DeleteStackRequest) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) Test(org.junit.Test)

Example 17 with AmazonCloudFormationClient

use of com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient in project cloudbreak by hortonworks.

the class AwsNetworkConnectorTest method testCreateNewNetworkWithSubnetsShouldCreateTheNetworkAndSubnets.

@Test
public void testCreateNewNetworkWithSubnetsShouldCreateTheNetworkAndSubnets() {
    String networkCidr = "0.0.0.0/16";
    Set<NetworkSubnetRequest> subnets = Set.of(new NetworkSubnetRequest("1.1.1.1/8", PUBLIC), new NetworkSubnetRequest("1.1.1.2/8", PUBLIC));
    AmazonServiceException amazonServiceException = new AmazonServiceException("does not exist");
    amazonServiceException.setStatusCode(400);
    AmazonCloudFormationClient cfClient = mock(AmazonCloudFormationClient.class);
    when(cfClient.describeStacks(any(DescribeStacksRequest.class))).thenThrow(amazonServiceException);
    AmazonEc2Client ec2Client = mock(AmazonEc2Client.class);
    Map<String, String> output = createOutput();
    NetworkCreationRequest networkCreationRequest = createNetworkRequest(networkCidr, subnets);
    List<SubnetRequest> subnetRequestList = createSubnetRequestList();
    Set<CreatedSubnet> createdSubnets = Set.of(new CreatedSubnet(), new CreatedSubnet(), new CreatedSubnet());
    when(awsClient.createEc2Client(any(), any())).thenReturn(ec2Client);
    when(awsSubnetRequestProvider.provide(ec2Client, new ArrayList<>(subnets), new ArrayList<>(subnets))).thenReturn(subnetRequestList);
    when(awsClient.createCloudFormationClient(any(AwsCredentialView.class), eq(REGION.value()))).thenReturn(cfClient);
    when(cfClient.waiters()).thenReturn(cfWaiters);
    when(cfWaiters.stackCreateComplete()).thenReturn(creationWaiter);
    when(cfStackUtil.getOutputs(NETWORK_ID, cfClient)).thenReturn(output);
    when(awsCreatedSubnetProvider.provide(output, subnetRequestList, true)).thenReturn(createdSubnets);
    CreatedCloudNetwork actual = underTest.createNetworkWithSubnets(networkCreationRequest);
    verify(awsClient).createCloudFormationClient(any(AwsCredentialView.class), eq(REGION.value()));
    verify(awsNetworkCfTemplateProvider).provide(networkCreationRequest, subnetRequestList);
    verify(creationWaiter, times(1)).run(any());
    verify(awsTaggingService).prepareCloudformationTags(any(), any());
    verify(cfClient).createStack(any(CreateStackRequest.class));
    verify(cfStackUtil).getOutputs(NETWORK_ID, cfClient);
    assertEquals(VPC_ID, actual.getNetworkId());
    assertEquals(NUMBER_OF_SUBNETS, actual.getSubnets().size());
}
Also used : DescribeStacksRequest(com.amazonaws.services.cloudformation.model.DescribeStacksRequest) NetworkSubnetRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkSubnetRequest) SubnetRequest(com.sequenceiq.cloudbreak.cloud.model.network.SubnetRequest) NetworkCreationRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkCreationRequest) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) NetworkSubnetRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkSubnetRequest) AmazonServiceException(com.amazonaws.AmazonServiceException) CreatedCloudNetwork(com.sequenceiq.cloudbreak.cloud.model.network.CreatedCloudNetwork) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) CreatedSubnet(com.sequenceiq.cloudbreak.cloud.model.network.CreatedSubnet) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) CreateStackRequest(com.amazonaws.services.cloudformation.model.CreateStackRequest) Test(org.junit.Test)

Example 18 with AmazonCloudFormationClient

use of com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient in project cloudbreak by hortonworks.

the class AwsLaunchTest method launchStack.

@Test
public void launchStack() throws Exception {
    setup();
    setupRetryService();
    setupFreemarkerTemplateProcessing();
    setupDescribeStacksResponses();
    setupDescribeImagesResponse();
    setupDescribeStackResourceResponse();
    setupAutoscalingResponses();
    setupDescribeInstancesResponse();
    setupCreateVolumeResponse();
    setupDescribeVolumeResponse();
    setupDescribeSubnetResponse();
    setupDescribePrefixListsResponse();
    InMemoryStateStore.putStack(1L, PollGroup.POLLABLE);
    AuthenticatedContext authenticatedContext = componentTestUtil.getAuthenticatedContext();
    authenticatedContext.putParameter(AmazonEc2Client.class, amazonEc2Client);
    awsResourceConnector.launch(authenticatedContext, componentTestUtil.getStackForLaunch(InstanceStatus.CREATE_REQUESTED, InstanceStatus.CREATE_REQUESTED), persistenceNotifier, new AdjustmentTypeWithThreshold(AdjustmentType.EXACT, Long.MAX_VALUE));
    // assert
    verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_VPC.equals(cloudResource.getType())), any());
    verify(persistenceNotifier, times(2)).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_VOLUMESET.equals(cloudResource.getType())), any());
    verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_SUBNET.equals(cloudResource.getType())), any());
    verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.CLOUDFORMATION_STACK.equals(cloudResource.getType())), any());
    InOrder inOrder = inOrder(amazonEc2Client, amazonCloudFormationClient, amazonEc2Client);
    inOrder.verify(amazonEc2Client).describeImages(any());
    inOrder.verify(amazonCloudFormationClient).createStack(any());
    inOrder.verify(amazonEc2Client, times(2)).createVolume(any());
    inOrder.verify(amazonEc2Client, times(2)).attachVolume(any());
    inOrder.verify(amazonEc2Client, never()).describePrefixLists();
}
Also used : DescribeMountTargetsResult(com.amazonaws.services.elasticfilesystem.model.DescribeMountTargetsResult) Arrays(java.util.Arrays) DescribeSubnetsRequest(com.amazonaws.services.ec2.model.DescribeSubnetsRequest) EntitlementService(com.sequenceiq.cloudbreak.auth.altus.EntitlementService) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ActiveProfiles(org.springframework.test.context.ActiveProfiles) AmazonCloudWatchClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonCloudWatchClient) DescribeStacksResult(com.amazonaws.services.cloudformation.model.DescribeStacksResult) DescribeSubnetsResult(com.amazonaws.services.ec2.model.DescribeSubnetsResult) AmazonEC2Waiters(com.amazonaws.services.ec2.waiters.AmazonEC2Waiters) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) DescribeInstancesRequest(com.amazonaws.services.ec2.model.DescribeInstancesRequest) DescribeScalingActivitiesRequest(com.amazonaws.services.autoscaling.model.DescribeScalingActivitiesRequest) SpringRunner(org.springframework.test.context.junit4.SpringRunner) AmazonAutoScalingWaiters(com.amazonaws.services.autoscaling.waiters.AmazonAutoScalingWaiters) Waiter(com.amazonaws.waiters.Waiter) MockBean(org.springframework.boot.test.mock.mockito.MockBean) Reservation(com.amazonaws.services.ec2.model.Reservation) LifeCycleState(com.amazonaws.services.elasticfilesystem.model.LifeCycleState) DescribeFileSystemsResult(com.amazonaws.services.elasticfilesystem.model.DescribeFileSystemsResult) AmazonServiceException(com.amazonaws.AmazonServiceException) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) Output(com.amazonaws.services.cloudformation.model.Output) DescribeVolumesResult(com.amazonaws.services.ec2.model.DescribeVolumesResult) DescribeInstancesResult(com.amazonaws.services.ec2.model.DescribeInstancesResult) TestPropertySource(org.springframework.test.context.TestPropertySource) AmazonCloudFormationWaiters(com.amazonaws.services.cloudformation.waiters.AmazonCloudFormationWaiters) Retry(com.sequenceiq.cloudbreak.service.Retry) FreeMarkerTemplateUtils(com.sequenceiq.cloudbreak.util.FreeMarkerTemplateUtils) AwsResourceConnector(com.sequenceiq.cloudbreak.cloud.aws.connector.resource.AwsResourceConnector) CreateFileSystemResult(com.amazonaws.services.elasticfilesystem.model.CreateFileSystemResult) AdjustmentType(com.sequenceiq.common.api.type.AdjustmentType) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) VolumeState(com.amazonaws.services.ec2.model.VolumeState) Mockito.inOrder(org.mockito.Mockito.inOrder) DeleteFileSystemResult(com.amazonaws.services.elasticfilesystem.model.DeleteFileSystemResult) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) LocationHelper(com.sequenceiq.cloudbreak.cloud.storage.LocationHelper) Mock(org.mockito.Mock) DescribeStacksRequest(com.amazonaws.services.cloudformation.model.DescribeStacksRequest) AVAILABILITY_ZONE(com.sequenceiq.cloudbreak.cloud.aws.component.ComponentTestUtil.AVAILABILITY_ZONE) RunWith(org.junit.runner.RunWith) AmazonEfsClient(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEfsClient) ResourceRetriever(com.sequenceiq.cloudbreak.cloud.service.ResourceRetriever) Supplier(java.util.function.Supplier) StackResourceDetail(com.amazonaws.services.cloudformation.model.StackResourceDetail) Inject(javax.inject.Inject) CreateVolumeResult(com.amazonaws.services.ec2.model.CreateVolumeResult) Answer(org.mockito.stubbing.Answer) AmazonEc2Client(com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) DescribeVolumesRequest(com.amazonaws.services.ec2.model.DescribeVolumesRequest) DeleteMountTargetResult(com.amazonaws.services.elasticfilesystem.model.DeleteMountTargetResult) DescribeImagesResult(com.amazonaws.services.ec2.model.DescribeImagesResult) ResourceType(com.sequenceiq.common.api.type.ResourceType) InOrder(org.mockito.InOrder) AmazonElasticFileSystemClient(com.amazonaws.services.elasticfilesystem.AmazonElasticFileSystemClient) FileSystemDescription(com.amazonaws.services.elasticfilesystem.model.FileSystemDescription) DescribeScalingActivitiesResult(com.amazonaws.services.autoscaling.model.DescribeScalingActivitiesResult) AwsCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.AwsCloudFormationClient) AdjustmentTypeWithThreshold(com.sequenceiq.common.api.adjustment.AdjustmentTypeWithThreshold) DescribePrefixListsResult(com.amazonaws.services.ec2.model.DescribePrefixListsResult) InMemoryStateStore(com.sequenceiq.cloudbreak.cloud.store.InMemoryStateStore) Import(org.springframework.context.annotation.Import) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Stack(com.amazonaws.services.cloudformation.model.Stack) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) LifecycleState(com.amazonaws.services.autoscaling.model.LifecycleState) Mockito.verify(org.mockito.Mockito.verify) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) Mockito.never(org.mockito.Mockito.never) MountTargetDescription(com.amazonaws.services.elasticfilesystem.model.MountTargetDescription) CustomAmazonWaiterProvider(com.sequenceiq.cloudbreak.cloud.aws.scheduler.CustomAmazonWaiterProvider) InstanceStatus(com.sequenceiq.cloudbreak.cloud.model.InstanceStatus) Instance(com.amazonaws.services.autoscaling.model.Instance) DescribeStackResourceResult(com.amazonaws.services.cloudformation.model.DescribeStackResourceResult) CommonAwsClient(com.sequenceiq.cloudbreak.cloud.aws.common.CommonAwsClient) PollGroup(com.sequenceiq.cloudbreak.cloud.scheduler.PollGroup) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) InOrder(org.mockito.InOrder) AdjustmentTypeWithThreshold(com.sequenceiq.common.api.adjustment.AdjustmentTypeWithThreshold) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Test(org.junit.Test)

Example 19 with AmazonCloudFormationClient

use of com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient in project cloudbreak by hortonworks.

the class AwsCloudFormationErrorMessageProvider method getStackResourceStatusReasons.

private String getStackResourceStatusReasons(AwsCredentialView credentialView, String region, String stackName, Set<String> resourceErrorStatuses, AmazonCloudFormationClient cfClient) {
    DescribeStackResourcesRequest describeStackResourcesRequest = new DescribeStackResourcesRequest().withStackName(stackName);
    DescribeStackResourcesResult describeStackResourcesResult = cfClient.describeStackResources(describeStackResourcesRequest);
    String stackResourceStatusReasons = describeStackResourcesResult.getStackResources().stream().filter(stackResource -> resourceErrorStatuses.contains(stackResource.getResourceStatus())).map(stackResource -> getStackResourceMessage(credentialView, region, stackResource)).collect(Collectors.joining(", "));
    return stackResourceStatusReasons;
}
Also used : Arrays(java.util.Arrays) DescribeStacksRequest(com.amazonaws.services.cloudformation.model.DescribeStacksRequest) LoggerFactory(org.slf4j.LoggerFactory) StackResource(com.amazonaws.services.cloudformation.model.StackResource) DescribeStacksResult(com.amazonaws.services.cloudformation.model.DescribeStacksResult) Inject(javax.inject.Inject) StackEvent(com.amazonaws.services.cloudformation.model.StackEvent) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) DescribeStackEventsResult(com.amazonaws.services.cloudformation.model.DescribeStackEventsResult) AwsEncodedAuthorizationFailureMessageDecoder(com.sequenceiq.cloudbreak.cloud.aws.common.util.AwsEncodedAuthorizationFailureMessageDecoder) Logger(org.slf4j.Logger) DescribeStackResourcesResult(com.amazonaws.services.cloudformation.model.DescribeStackResourcesResult) AwsCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.AwsCloudFormationClient) Set(java.util.Set) ResourceStatus(com.amazonaws.services.cloudformation.model.ResourceStatus) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) List(java.util.List) Component(org.springframework.stereotype.Component) Stream(java.util.stream.Stream) CollectionUtils(org.springframework.util.CollectionUtils) DescribeStackEventsRequest(com.amazonaws.services.cloudformation.model.DescribeStackEventsRequest) DescribeStackResourcesRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourcesRequest) StringUtils(org.springframework.util.StringUtils) DescribeStackResourcesResult(com.amazonaws.services.cloudformation.model.DescribeStackResourcesResult) DescribeStackResourcesRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourcesRequest)

Example 20 with AmazonCloudFormationClient

use of com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient in project cloudbreak by hortonworks.

the class AwsCloudFormationSetup method scalingPrerequisites.

@Override
public void scalingPrerequisites(AuthenticatedContext ac, CloudStack stack, boolean upscale) {
    if (!upscale) {
        return;
    }
    String regionName = ac.getCloudContext().getLocation().getRegion().value();
    AwsCredentialView awsCredential = new AwsCredentialView(ac.getCloudCredential());
    AmazonCloudFormationClient cloudFormationClient = awsClient.createCloudFormationClient(awsCredential, regionName);
    AmazonAutoScalingClient amazonASClient = awsClient.createAutoScalingClient(awsCredential, regionName);
    List<Group> groups = stack.getGroups().stream().filter(g -> g.getInstances().stream().anyMatch(inst -> InstanceStatus.CREATE_REQUESTED == inst.getTemplate().getStatus())).collect(Collectors.toList());
    Map<String, Group> groupMap = groups.stream().collect(Collectors.toMap(g -> cfStackUtil.getAutoscalingGroupName(ac, cloudFormationClient, g.getName()), g -> g));
    DescribeAutoScalingGroupsResult result = amazonASClient.describeAutoScalingGroups(new DescribeAutoScalingGroupsRequest().withAutoScalingGroupNames(groupMap.keySet()));
    for (AutoScalingGroup asg : result.getAutoScalingGroups()) {
        Group group = groupMap.get(asg.getAutoScalingGroupName());
        List<CloudInstance> groupInstances = group.getInstances().stream().filter(inst -> InstanceStatus.CREATED.equals(inst.getTemplate().getStatus())).collect(Collectors.toList());
        List<CloudVmInstanceStatus> instanceStatuses = instanceConnector.check(ac, groupInstances);
        if (checkInstanceStatuses(instanceStatuses, ac.getCloudCredential().getAccountId())) {
            String errorMessage = "Not all the existing instances are in allowed state, upscale is not possible!";
            LOGGER.info(errorMessage);
            throw new CloudConnectorException(errorMessage);
        }
        List<Instance> asgOnlyInstances = asg.getInstances().stream().filter(inst -> groupInstances.stream().noneMatch(gi -> gi.getInstanceId().equals(inst.getInstanceId()))).collect(Collectors.toList());
        List<CloudInstance> cbOnlyInstances = groupInstances.stream().filter(gi -> asg.getInstances().stream().noneMatch(inst -> inst.getInstanceId().equals(gi.getInstanceId()))).collect(Collectors.toList());
        if (!asgOnlyInstances.isEmpty() || !cbOnlyInstances.isEmpty()) {
            String errorMessage = "The instances in the autoscaling group are not in sync with the instances in cloudbreak! Cloudbreak only instances: [" + cbOnlyInstances.stream().map(CloudInstance::getInstanceId).collect(Collectors.joining(",")) + "], AWS only instances: [" + asgOnlyInstances.stream().map(Instance::getInstanceId).collect(Collectors.joining(",")) + "]. Upscale is not possible!";
            LOGGER.info(errorMessage);
            throw new CloudConnectorException(errorMessage);
        }
        if (groupInstances.size() != asg.getDesiredCapacity()) {
            String errorMessage = String.format("The autoscale group's desired instance count is not match with the instance count in the cloudbreak." + " Desired count: %d <> cb instance count: %d. Upscale is not possible!", asg.getDesiredCapacity(), groupInstances.size());
            LOGGER.info(errorMessage);
            throw new CloudConnectorException(errorMessage);
        }
    }
}
Also used : EntitlementService(com.sequenceiq.cloudbreak.auth.altus.EntitlementService) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Inject(javax.inject.Inject) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Map(java.util.Map) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) CloudVmInstanceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudVmInstanceStatus) EnumSet(java.util.EnumSet) AwsInstanceConnector(com.sequenceiq.cloudbreak.cloud.aws.common.AwsInstanceConnector) AwsSetup(com.sequenceiq.cloudbreak.cloud.aws.common.AwsSetup) Logger(org.slf4j.Logger) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) Set(java.util.Set) Collectors(java.util.stream.Collectors) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) List(java.util.List) Component(org.springframework.stereotype.Component) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) InstanceStatus(com.sequenceiq.cloudbreak.cloud.model.InstanceStatus) Group(com.sequenceiq.cloudbreak.cloud.model.Group) LoggerFactory.getLogger(org.slf4j.LoggerFactory.getLogger) Instance(com.amazonaws.services.autoscaling.model.Instance) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) Group(com.sequenceiq.cloudbreak.cloud.model.Group) AutoScalingGroup(com.amazonaws.services.autoscaling.model.AutoScalingGroup) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) Instance(com.amazonaws.services.autoscaling.model.Instance) CloudVmInstanceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudVmInstanceStatus) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) DescribeAutoScalingGroupsRequest(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest) AmazonAutoScalingClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient) DescribeAutoScalingGroupsResult(com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient)

Aggregations

AmazonCloudFormationClient (com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient)32 AwsCredentialView (com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView)27 AmazonAutoScalingClient (com.sequenceiq.cloudbreak.cloud.aws.client.AmazonAutoScalingClient)15 AmazonEc2Client (com.sequenceiq.cloudbreak.cloud.aws.common.client.AmazonEc2Client)12 AutoScalingGroup (com.amazonaws.services.autoscaling.model.AutoScalingGroup)11 DescribeStacksRequest (com.amazonaws.services.cloudformation.model.DescribeStacksRequest)11 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)11 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)10 DescribeAutoScalingGroupsRequest (com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest)9 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)9 AmazonServiceException (com.amazonaws.AmazonServiceException)8 List (java.util.List)8 ArrayList (java.util.ArrayList)7 Inject (javax.inject.Inject)7 DescribeAutoScalingGroupsResult (com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsResult)6 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)6 Group (com.sequenceiq.cloudbreak.cloud.model.Group)6 AdjustmentTypeWithThreshold (com.sequenceiq.common.api.adjustment.AdjustmentTypeWithThreshold)6 Map (java.util.Map)6 Collectors (java.util.stream.Collectors)6