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