List of usage examples for com.amazonaws.services.cloudformation.model ListChangeSetsResult getSummaries
public java.util.List<ChangeSetSummary> getSummaries()
A list of ChangeSetSummary structures that provides the ID and status of each change set for the specified stack.
From source file:jp.classmethod.aws.gradle.cloudformation.AmazonCloudFormationExecuteChangeSetTask.java
License:Apache License
/** * * Return the latest ChangeSet Summary for the specified CloudFormation stack. * @param cfn AmazonCloudFormation//from www . ja va2 s. c o m * @return Optional */ private Optional<ChangeSetSummary> getLatestChangeSetSummary(AmazonCloudFormation cfn) { ListChangeSetsResult changeSetsResult = cfn .listChangeSets(new ListChangeSetsRequest().withStackName(getStackName())); List<ChangeSetSummary> changeSetSummaries = changeSetsResult.getSummaries(); if (changeSetSummaries.isEmpty()) { return Optional.empty(); } changeSetSummaries.sort(Comparator.comparing(ChangeSetSummary::getCreationTime).reversed()); return Optional.of(changeSetSummaries.get(0)); }