{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.ELBv2.Waiters where
import Network.AWS.ELBv2.DescribeLoadBalancers
import Network.AWS.ELBv2.DescribeLoadBalancers
import Network.AWS.ELBv2.DescribeLoadBalancers
import Network.AWS.ELBv2.DescribeTargetHealth
import Network.AWS.ELBv2.DescribeTargetHealth
import Network.AWS.ELBv2.Types
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Waiter
loadBalancersDeleted :: Wait DescribeLoadBalancers
loadBalancersDeleted =
Wait
{ _waitName = "LoadBalancersDeleted"
, _waitAttempts = 40
, _waitDelay = 15
, _waitAcceptors =
[ matchAll
"active"
AcceptRetry
(folding (concatOf dlbrsLoadBalancers) .
lbState . _Just . lbsCode . _Just . to toTextCI)
, matchError "LoadBalancerNotFound" AcceptSuccess
]
}
targetDeregistered :: Wait DescribeTargetHealth
targetDeregistered =
Wait
{ _waitName = "TargetDeregistered"
, _waitAttempts = 40
, _waitDelay = 15
, _waitAcceptors =
[ matchError "InvalidTarget" AcceptSuccess
, matchAll
"unused"
AcceptSuccess
(folding (concatOf dthrsTargetHealthDescriptions) .
thdTargetHealth . _Just . thState . _Just . to toTextCI)
]
}
loadBalancerAvailable :: Wait DescribeLoadBalancers
loadBalancerAvailable =
Wait
{ _waitName = "LoadBalancerAvailable"
, _waitAttempts = 40
, _waitDelay = 15
, _waitAcceptors =
[ matchAll
"active"
AcceptSuccess
(folding (concatOf dlbrsLoadBalancers) .
lbState . _Just . lbsCode . _Just . to toTextCI)
, matchAny
"provisioning"
AcceptRetry
(folding (concatOf dlbrsLoadBalancers) .
lbState . _Just . lbsCode . _Just . to toTextCI)
, matchError "LoadBalancerNotFound" AcceptRetry
]
}
targetInService :: Wait DescribeTargetHealth
targetInService =
Wait
{ _waitName = "TargetInService"
, _waitAttempts = 40
, _waitDelay = 15
, _waitAcceptors =
[ matchAll
"healthy"
AcceptSuccess
(folding (concatOf dthrsTargetHealthDescriptions) .
thdTargetHealth . _Just . thState . _Just . to toTextCI)
, matchError "InvalidInstance" AcceptRetry
]
}
loadBalancerExists :: Wait DescribeLoadBalancers
loadBalancerExists =
Wait
{ _waitName = "LoadBalancerExists"
, _waitAttempts = 40
, _waitDelay = 15
, _waitAcceptors =
[ matchStatus 200 AcceptSuccess
, matchError "LoadBalancerNotFound" AcceptRetry
]
}