src/main/java/com/digitalglobe/util/maven/plugin/CloudFormationDeployMavenPlugin.java
/**
     * Waits for a change set to complete.
     * @param cfAsyncClient
     * @param stackName
     * @param changeSetName
     */
Waits for a change set to complete.
Waits for a change set to complete .
private void WaitChangeSet(CloudFormationAsyncClient cfAsyncClient, String stackName, String changeSetName) {
        boolean retry;
        Random random = new Random();
        do {
            String token = UUID.randomUUID().toString();
            DescribeChangeSetRequest describeChangeSetRequest = DescribeChangeSetRequest.builder()
                    .changeSetName(changeSetName)
                    .stackName(stackName)
                    .nextToken(token)
                    .build();
            try {
                DescribeChangeSetResponse result = cfAsyncClient.describeChangeSet(describeChangeSetRequest).get();
                retry = (result.status() == ChangeSetStatus.CREATE_PENDING) ||
                        (result.status() == ChangeSetStatus.CREATE_IN_PROGRESS);
                if(retry) Thread.sleep(random.nextInt(10000) + 1);
            } catch (InterruptedException ie) { retry = true; }
            catch (ExecutionException ex) { retry = ex.getMessage().contains("Rate exceeded"); }
        } while (retry);
    }
private void WaitChangeSet ( CloudFormationAsyncClient cfAsyncClient , String stackName , String changeSetName ) { boolean retry ; Random random = new Random ( ) ; do { String token = UUID . randomUUID ( ) . toString ( ) ; DescribeChangeSetRequest describeChangeSetRequest = DescribeChangeSetRequest . builder ( ) . changeSetName ( changeSetName ) . stackName ( stackName ) . nextToken ( token ) . build ( ) ; try { DescribeChangeSetResponse result = cfAsyncClient . describeChangeSet ( describeChangeSetRequest ) . get ( ) ; retry = ( result . status ( ) == ChangeSetStatus . CREATE_PENDING ) || ( result . status ( ) == ChangeSetStatus . CREATE_IN_PROGRESS ) ; if ( retry ) Thread . sleep ( random . nextInt ( 10000 ) + 1 ) ; } catch ( InterruptedException ie ) { retry = true ; } catch ( ExecutionException ex ) { retry = ex . getMessage ( ) . contains ( "Rate exceeded" ) ; } } while ( retry ) ; }
Waits for a change set to complete.
Waits for a change set to complete .