private boolean isStabilized()

in aws-route53recoverycontrol-cluster/src/main/java/software/amazon/route53recoverycontrol/cluster/DeleteHandler.java [60:81]


    private boolean isStabilized(
            ResourceModel model,
            ProxyClient<Route53RecoveryControlConfigClient> proxyClient
    ) {
        String clusterArn = model.getClusterArn();

        DescribeClusterResponse response;

        try{
            response = describeCluster(DescribeClusterRequest.builder().clusterArn(clusterArn).build(), proxyClient);
        } catch (CfnNotFoundException e) {
            logger.log(String.format("%s has stabilized.", ResourceModel.TYPE_NAME));
            return true;
        }

        if (response != null && response.cluster().statusAsString().equals("PENDING_DELETION")) {
            logger.log(String.format("%s has not yet stabilized.", ResourceModel.TYPE_NAME));
        } else {
            logger.log(String.format("%s was not successfully marked for deletion.", ResourceModel.TYPE_NAME));
        }
        return false;
    }