module Network.AWS.Redshift.Waiters where
import Network.AWS.Prelude
import Network.AWS.Redshift.DescribeClusters
import Network.AWS.Redshift.DescribeClusters
import Network.AWS.Redshift.DescribeClusterSnapshots
import Network.AWS.Redshift.Types
import Network.AWS.Waiter
clusterDeleted :: Wait DescribeClusters
clusterDeleted =
Wait
{ _waitName = "ClusterDeleted"
, _waitAttempts = 30
, _waitDelay = 60
, _waitAcceptors = [ matchError "ClusterNotFound" AcceptSuccess
, matchAny
"creating"
AcceptFailure
(folding (concatOf dcrsClusters) .
cClusterStatus . _Just . to toTextCI)
, matchAny
"rebooting"
AcceptFailure
(folding (concatOf dcrsClusters) .
cClusterStatus . _Just . to toTextCI)]
}
snapshotAvailable :: Wait DescribeClusterSnapshots
snapshotAvailable =
Wait
{ _waitName = "SnapshotAvailable"
, _waitAttempts = 20
, _waitDelay = 15
, _waitAcceptors = [ matchAll
"available"
AcceptSuccess
(folding (concatOf dcssrsSnapshots) .
sStatus . _Just . to toTextCI)
, matchAny
"failed"
AcceptFailure
(folding (concatOf dcssrsSnapshots) .
sStatus . _Just . to toTextCI)
, matchAny
"deleted"
AcceptFailure
(folding (concatOf dcssrsSnapshots) .
sStatus . _Just . to toTextCI)]
}
clusterAvailable :: Wait DescribeClusters
clusterAvailable =
Wait
{ _waitName = "ClusterAvailable"
, _waitAttempts = 30
, _waitDelay = 60
, _waitAcceptors = [ matchAll
"available"
AcceptSuccess
(folding (concatOf dcrsClusters) .
cClusterStatus . _Just . to toTextCI)
, matchAny
"deleting"
AcceptFailure
(folding (concatOf dcrsClusters) .
cClusterStatus . _Just . to toTextCI)
, matchError "ClusterNotFound" AcceptRetry]
}