diff --git a/cloud-aws/src/main/java/com/sequenceiq/cloudbreak/cloud/aws/AwsResourceConnector.java b/cloud-aws/src/main/java/com/sequenceiq/cloudbreak/cloud/aws/AwsResourceConnector.java index 54d8f8cd44a..5a715c0b8c8 100644 --- a/cloud-aws/src/main/java/com/sequenceiq/cloudbreak/cloud/aws/AwsResourceConnector.java +++ b/cloud-aws/src/main/java/com/sequenceiq/cloudbreak/cloud/aws/AwsResourceConnector.java @@ -673,13 +673,14 @@ public List downscale(AuthenticatedContext auth, CloudStack detachInstances(instanceIdsBatches, detachInstancesRequest, amazonASClient); terminateInstances(instanceIdsBatches, amazonEC2Client); LOGGER.info("Terminated instances in stack '{}': '{}'", auth.getCloudContext().getId(), instanceIdsBatches); - try { - amazonASClient.updateAutoScalingGroup(new UpdateAutoScalingGroupRequest() - .withAutoScalingGroupName(asGroupName) - .withMaxSize(getInstanceCount(stack, vms.get(0).getTemplate().getGroupName()))); - } catch (AmazonServiceException e) { - LOGGER.warn(e.getErrorMessage()); - } + } + + try { + amazonASClient.updateAutoScalingGroup(new UpdateAutoScalingGroupRequest() + .withAutoScalingGroupName(asGroupName) + .withMaxSize(getInstanceCount(stack, vms.get(0).getTemplate().getGroupName()))); + } catch (AmazonServiceException e) { + LOGGER.warn(e.getErrorMessage()); } } return check(auth, resources);