src/main/java/com/digitalglobe/util/maven/plugin/CloudFormationDeployMavenPlugin.java
/**
     * Waits for a stack to complete.
     *
     * @param stackName The name of the stack being created
     * @param cfClient The CloudFormation client to use.
     * @throws InterruptedException Occurs when a process is interrupted.
     * @throws ExecutionException Occurs when an error happens during the execution of the describe operation.
     */
Waits for a stack to complete.
@param stackName The name of the stack being created
@param cfClient The CloudFormation client to use.
@throws InterruptedException Occurs when a process is interrupted.
@throws ExecutionException Occurs when an error happens during the execution of the describe operation.
Waits for a stack to complete . @param stackName The name of the stack being created @param cfClient The CloudFormation client to use . @throws InterruptedException Occurs when a process is interrupted . @throws ExecutionException Occurs when an error happens during the execution of the describe operation .
private void WaitStackInProgress(String stackName, CloudFormationAsyncClient cfClient)
            throws InterruptedException, ExecutionException {
        boolean retry;
        Random random = new Random();
        do {
            DescribeStacksResponse describeResponse = cfClient.describeStacks(DescribeStacksRequest.builder()
                    .stackName(stackName).build()).get();
            switch(describeResponse.stacks().get(0).stackStatus()) {
                case CREATE_IN_PROGRESS:
                case ROLLBACK_IN_PROGRESS:
                case UPDATE_IN_PROGRESS:
                case REVIEW_IN_PROGRESS:
                case IMPORT_ROLLBACK_IN_PROGRESS:
                case UPDATE_ROLLBACK_IN_PROGRESS:
                case DELETE_IN_PROGRESS:
                case IMPORT_IN_PROGRESS:
                case UPDATE_COMPLETE_CLEANUP_IN_PROGRESS:
                case UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS:
                    retry = true;
                    Thread.sleep(random.nextInt(10000) + 1);
                    break;
                default:
                    retry = false;
                    break;
            }
        } while(retry);
    }
private void WaitStackInProgress ( String stackName , CloudFormationAsyncClient cfClient ) throws InterruptedException , ExecutionException { boolean retry ; Random random = new Random ( ) ; do { DescribeStacksResponse describeResponse = cfClient . describeStacks ( DescribeStacksRequest . builder ( ) . stackName ( stackName ) . build ( ) ) . get ( ) ; switch ( describeResponse . stacks ( ) . get ( 0 ) . stackStatus ( ) ) { case CREATE_IN_PROGRESS : case ROLLBACK_IN_PROGRESS : case UPDATE_IN_PROGRESS : case REVIEW_IN_PROGRESS : case IMPORT_ROLLBACK_IN_PROGRESS : case UPDATE_ROLLBACK_IN_PROGRESS : case DELETE_IN_PROGRESS : case IMPORT_IN_PROGRESS : case UPDATE_COMPLETE_CLEANUP_IN_PROGRESS : case UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS : retry = true ; Thread . sleep ( random . nextInt ( 10000 ) + 1 ) ; break ; default : retry = false ; break ; } } while ( retry ) ; }
Waits for a stack to complete.
Waits for a stack to complete .