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);
}
Aggregations