for (StackResource resource : stackbuilder.describeStackResources(logicalNameResourceRequest).getStackResources()) {
System.out.format(" %1$-40s %2$-25s %3$s\n", resource.getResourceType(), resource.getLogicalResourceId(), resource.getPhysicalResourceId());
}
// Delete the stack
DeleteStackRequest deleteRequest = new DeleteStackRequest();
deleteRequest.setStackName(stackName);
System.out.println("Deleting the stack called " + deleteRequest.getStackName() + ".");
stackbuilder.deleteStack(deleteRequest);
// Wait for stack to be deleted
// Note that you could used SNS notifications on the original CreateStack call to track the progress of the stack deletion
System.out.println("Stack creation completed, the stack " + stackName + " completed with " + waitForCompletion(stackbuilder, stackName));