Example usage for com.amazonaws.services.cloudformation.model DescribeChangeSetRequest DescribeChangeSetRequest

List of usage examples for com.amazonaws.services.cloudformation.model DescribeChangeSetRequest DescribeChangeSetRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model DescribeChangeSetRequest DescribeChangeSetRequest.

Prototype

DescribeChangeSetRequest

Source Link

Usage

From source file:com.github.kaklakariada.aws.sam.service.poll.ChangeSetCreateCompleteWaitCondition.java

License:Open Source License

private DescribeChangeSetResult getChangeSetStatus() {
    return cloudFormation.describeChangeSet(new DescribeChangeSetRequest().withChangeSetName(changeSetArn));
}

From source file:de.taimos.pipeline.aws.cloudformation.CloudFormationStack.java

License:Apache License

public boolean changeSetExists(String changeSetName) {
    try {//from   w ww. j  a v a  2 s  . co  m
        this.client.describeChangeSet(
                new DescribeChangeSetRequest().withStackName(this.stack).withChangeSetName(changeSetName));
        return true;
    } catch (AmazonCloudFormationException e) {
        if ("AccessDenied".equals(e.getErrorCode())) {
            this.listener.getLogger().format("Got error from describeStacks: %s %n", e.getErrorMessage());
            throw e;
        }
        return false;
    }
}

From source file:de.taimos.pipeline.aws.cloudformation.CloudFormationStack.java

License:Apache License

private boolean changeSetHasChanges(String changeSetName) {
    DescribeChangeSetResult result = this.client.describeChangeSet(
            new DescribeChangeSetRequest().withStackName(this.stack).withChangeSetName(changeSetName));
    return !result.getChanges().isEmpty();
}

From source file:de.taimos.pipeline.aws.cloudformation.CloudFormationStack.java

License:Apache License

public DescribeChangeSetResult describeChangeSet(String changeSet) {
    return this.client.describeChangeSet(
            new DescribeChangeSetRequest().withStackName(this.stack).withChangeSetName(changeSet));
}

From source file:de.taimos.pipeline.aws.cloudformation.EventPrinter.java

License:Apache License

public void waitAndPrintChangeSetEvents(String stack, String changeSet, Waiter<DescribeChangeSetRequest> waiter,
        long pollIntervalMillis) throws ExecutionException {

    final BasicFuture<AmazonWebServiceRequest> waitResult = new BasicFuture<>(null);

    waiter.runAsync(/*from   ww  w  .java  2s  .c o  m*/
            new WaiterParameters<>(
                    new DescribeChangeSetRequest().withStackName(stack).withChangeSetName(changeSet)),
            new WaiterHandler() {
                @Override
                public void onWaitSuccess(AmazonWebServiceRequest request) {
                    waitResult.completed(request);
                }

                @Override
                public void onWaitFailure(Exception e) {
                    waitResult.failed(e);
                }
            });

    this.waitAndPrintEvents(stack, pollIntervalMillis, waitResult);
}