Search in sources :

Example 1 with EnvironmentCancellationCheck

use of com.sequenceiq.cloudbreak.cloud.aws.scheduler.EnvironmentCancellationCheck in project cloudbreak by hortonworks.

the class AwsNetworkConnector method getCreatedNetworkWithPolling.

private CreatedCloudNetwork getCreatedNetworkWithPolling(NetworkCreationRequest networkRequest, AwsCredentialView credentialView, AmazonCloudFormationClient cloudFormationRetryClient, List<SubnetRequest> subnetRequests) {
    String regionName = networkRequest.getRegion().value();
    Waiter<DescribeStacksRequest> creationWaiter = cloudFormationRetryClient.waiters().stackCreateComplete();
    String cfStackName = networkRequest.getStackName();
    DescribeStacksRequest stackRequestWithStackId = new DescribeStacksRequest().withStackName(cfStackName);
    EnvironmentCancellationCheck environmentCancellationCheck = new EnvironmentCancellationCheck(networkRequest.getEnvId(), networkRequest.getEnvName());
    run(creationWaiter, stackRequestWithStackId, environmentCancellationCheck, String.format("Network creation failed (cloudformation stack: %s).", cfStackName), () -> awsCloudFormationErrorMessageProvider.getErrorReason(credentialView, regionName, cfStackName, ResourceStatus.CREATE_FAILED));
    return getCreatedCloudNetwork(cloudFormationRetryClient, networkRequest, subnetRequests);
}
Also used : DescribeStacksRequest(com.amazonaws.services.cloudformation.model.DescribeStacksRequest) EnvironmentCancellationCheck(com.sequenceiq.cloudbreak.cloud.aws.scheduler.EnvironmentCancellationCheck)

Aggregations

DescribeStacksRequest (com.amazonaws.services.cloudformation.model.DescribeStacksRequest)1 EnvironmentCancellationCheck (com.sequenceiq.cloudbreak.cloud.aws.scheduler.EnvironmentCancellationCheck)1