-- | Polls 'Network.AWS.ElastiCache.DescribeCacheClusters' every 30 seconds until a
-- successful state is reached. An error is returned after 60 failed checks.
cacheClusterAvailable :: Wait DescribeCacheClusters
cacheClusterAvailable =
    Wait
    { _waitName = "CacheClusterAvailable"
    , _waitAttempts = 60
    , _waitDelay = 30
    , _waitAcceptors = [ matchAll
                             "available"
                             AcceptSuccess
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleted"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleting"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "incompatible-network"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "restore-failed"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)]
    }
cacheClusterAvailable :: Wait DescribeCacheClusters
cacheClusterAvailable =
    Wait
    { _waitName = "CacheClusterAvailable"
    , _waitAttempts = 60
    , _waitDelay = 30
    , _waitAcceptors = [ matchAll
                             "available"
                             AcceptSuccess
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleted"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleting"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "incompatible-network"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "restore-failed"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)]
    }
cacheClusterAvailable =
    Wait
    { _waitName = "CacheClusterAvailable"
    , _waitAttempts = 60
    , _waitDelay = 30
    , _waitAcceptors = [ matchAll
                             "available"
                             AcceptSuccess
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleted"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "deleting"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "incompatible-network"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)
                       , matchAny
                             "restore-failed"
                             AcceptFailure
                             (folding (concatOf drsCacheClusters) .
                              ccCacheClusterStatus . _Just . to toTextCI)]
    }