{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ELBV2.Types.TargetGroup
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ELBV2.Types.TargetGroup where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.Types.Matcher
import Amazonka.ELBV2.Types.ProtocolEnum
import Amazonka.ELBV2.Types.TargetGroupIpAddressTypeEnum
import Amazonka.ELBV2.Types.TargetTypeEnum
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a target group.
--
-- /See:/ 'newTargetGroup' smart constructor.
data TargetGroup = TargetGroup'
  { -- | [HTTP\/HTTPS protocol] The protocol version. The possible values are
    -- @GRPC@, @HTTP1@, and @HTTP2@.
    TargetGroup -> Maybe Text
protocolVersion :: Prelude.Maybe Prelude.Text,
    -- | The HTTP or gRPC codes to use when checking for a successful response
    -- from a target.
    TargetGroup -> Maybe Matcher
matcher :: Prelude.Maybe Matcher,
    -- | The destination for health checks on the targets.
    TargetGroup -> Maybe Text
healthCheckPath :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether health checks are enabled.
    TargetGroup -> Maybe Bool
healthCheckEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The number of consecutive health check failures required before
    -- considering the target unhealthy.
    TargetGroup -> Maybe Natural
unhealthyThresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the VPC for the targets.
    TargetGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the target group.
    TargetGroup -> Maybe Text
targetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The protocol to use for routing traffic to the targets.
    TargetGroup -> Maybe ProtocolEnum
protocol :: Prelude.Maybe ProtocolEnum,
    -- | The approximate amount of time, in seconds, between health checks of an
    -- individual target.
    TargetGroup -> Maybe Natural
healthCheckIntervalSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The type of target that you must specify when registering targets with
    -- this target group. The possible values are @instance@ (register targets
    -- by instance ID), @ip@ (register targets by IP address), @lambda@
    -- (register a single Lambda function as a target), or @alb@ (register a
    -- single Application Load Balancer as a target).
    TargetGroup -> Maybe TargetTypeEnum
targetType :: Prelude.Maybe TargetTypeEnum,
    -- | The number of consecutive health checks successes required before
    -- considering an unhealthy target healthy.
    TargetGroup -> Maybe Natural
healthyThresholdCount :: Prelude.Maybe Prelude.Natural,
    -- | The protocol to use to connect with the target. The GENEVE, TLS, UDP,
    -- and TCP_UDP protocols are not supported for health checks.
    TargetGroup -> Maybe ProtocolEnum
healthCheckProtocol :: Prelude.Maybe ProtocolEnum,
    -- | The Amazon Resource Names (ARN) of the load balancers that route traffic
    -- to this target group.
    TargetGroup -> Maybe [Text]
loadBalancerArns :: Prelude.Maybe [Prelude.Text],
    -- | The type of IP address used for this target group. The possible values
    -- are @ipv4@ and @ipv6@. This is an optional parameter. If not specified,
    -- the IP address type defaults to @ipv4@.
    TargetGroup -> Maybe TargetGroupIpAddressTypeEnum
ipAddressType :: Prelude.Maybe TargetGroupIpAddressTypeEnum,
    -- | The amount of time, in seconds, during which no response means a failed
    -- health check.
    TargetGroup -> Maybe Natural
healthCheckTimeoutSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The port to use to connect with the target.
    TargetGroup -> Maybe Text
healthCheckPort :: Prelude.Maybe Prelude.Text,
    -- | The name of the target group.
    TargetGroup -> Maybe Text
targetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The port on which the targets are listening. Not used if the target is a
    -- Lambda function.
    TargetGroup -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
  }
  deriving (TargetGroup -> TargetGroup -> Bool
(TargetGroup -> TargetGroup -> Bool)
-> (TargetGroup -> TargetGroup -> Bool) -> Eq TargetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetGroup -> TargetGroup -> Bool
$c/= :: TargetGroup -> TargetGroup -> Bool
== :: TargetGroup -> TargetGroup -> Bool
$c== :: TargetGroup -> TargetGroup -> Bool
Prelude.Eq, ReadPrec [TargetGroup]
ReadPrec TargetGroup
Int -> ReadS TargetGroup
ReadS [TargetGroup]
(Int -> ReadS TargetGroup)
-> ReadS [TargetGroup]
-> ReadPrec TargetGroup
-> ReadPrec [TargetGroup]
-> Read TargetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetGroup]
$creadListPrec :: ReadPrec [TargetGroup]
readPrec :: ReadPrec TargetGroup
$creadPrec :: ReadPrec TargetGroup
readList :: ReadS [TargetGroup]
$creadList :: ReadS [TargetGroup]
readsPrec :: Int -> ReadS TargetGroup
$creadsPrec :: Int -> ReadS TargetGroup
Prelude.Read, Int -> TargetGroup -> ShowS
[TargetGroup] -> ShowS
TargetGroup -> String
(Int -> TargetGroup -> ShowS)
-> (TargetGroup -> String)
-> ([TargetGroup] -> ShowS)
-> Show TargetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetGroup] -> ShowS
$cshowList :: [TargetGroup] -> ShowS
show :: TargetGroup -> String
$cshow :: TargetGroup -> String
showsPrec :: Int -> TargetGroup -> ShowS
$cshowsPrec :: Int -> TargetGroup -> ShowS
Prelude.Show, (forall x. TargetGroup -> Rep TargetGroup x)
-> (forall x. Rep TargetGroup x -> TargetGroup)
-> Generic TargetGroup
forall x. Rep TargetGroup x -> TargetGroup
forall x. TargetGroup -> Rep TargetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TargetGroup x -> TargetGroup
$cfrom :: forall x. TargetGroup -> Rep TargetGroup x
Prelude.Generic)

-- |
-- Create a value of 'TargetGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'protocolVersion', 'targetGroup_protocolVersion' - [HTTP\/HTTPS protocol] The protocol version. The possible values are
-- @GRPC@, @HTTP1@, and @HTTP2@.
--
-- 'matcher', 'targetGroup_matcher' - The HTTP or gRPC codes to use when checking for a successful response
-- from a target.
--
-- 'healthCheckPath', 'targetGroup_healthCheckPath' - The destination for health checks on the targets.
--
-- 'healthCheckEnabled', 'targetGroup_healthCheckEnabled' - Indicates whether health checks are enabled.
--
-- 'unhealthyThresholdCount', 'targetGroup_unhealthyThresholdCount' - The number of consecutive health check failures required before
-- considering the target unhealthy.
--
-- 'vpcId', 'targetGroup_vpcId' - The ID of the VPC for the targets.
--
-- 'targetGroupArn', 'targetGroup_targetGroupArn' - The Amazon Resource Name (ARN) of the target group.
--
-- 'protocol', 'targetGroup_protocol' - The protocol to use for routing traffic to the targets.
--
-- 'healthCheckIntervalSeconds', 'targetGroup_healthCheckIntervalSeconds' - The approximate amount of time, in seconds, between health checks of an
-- individual target.
--
-- 'targetType', 'targetGroup_targetType' - The type of target that you must specify when registering targets with
-- this target group. The possible values are @instance@ (register targets
-- by instance ID), @ip@ (register targets by IP address), @lambda@
-- (register a single Lambda function as a target), or @alb@ (register a
-- single Application Load Balancer as a target).
--
-- 'healthyThresholdCount', 'targetGroup_healthyThresholdCount' - The number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
--
-- 'healthCheckProtocol', 'targetGroup_healthCheckProtocol' - The protocol to use to connect with the target. The GENEVE, TLS, UDP,
-- and TCP_UDP protocols are not supported for health checks.
--
-- 'loadBalancerArns', 'targetGroup_loadBalancerArns' - The Amazon Resource Names (ARN) of the load balancers that route traffic
-- to this target group.
--
-- 'ipAddressType', 'targetGroup_ipAddressType' - The type of IP address used for this target group. The possible values
-- are @ipv4@ and @ipv6@. This is an optional parameter. If not specified,
-- the IP address type defaults to @ipv4@.
--
-- 'healthCheckTimeoutSeconds', 'targetGroup_healthCheckTimeoutSeconds' - The amount of time, in seconds, during which no response means a failed
-- health check.
--
-- 'healthCheckPort', 'targetGroup_healthCheckPort' - The port to use to connect with the target.
--
-- 'targetGroupName', 'targetGroup_targetGroupName' - The name of the target group.
--
-- 'port', 'targetGroup_port' - The port on which the targets are listening. Not used if the target is a
-- Lambda function.
newTargetGroup ::
  TargetGroup
newTargetGroup :: TargetGroup
newTargetGroup =
  TargetGroup' :: Maybe Text
-> Maybe Matcher
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe ProtocolEnum
-> Maybe Natural
-> Maybe TargetTypeEnum
-> Maybe Natural
-> Maybe ProtocolEnum
-> Maybe [Text]
-> Maybe TargetGroupIpAddressTypeEnum
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> TargetGroup
TargetGroup'
    { $sel:protocolVersion:TargetGroup' :: Maybe Text
protocolVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:matcher:TargetGroup' :: Maybe Matcher
matcher = Maybe Matcher
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPath:TargetGroup' :: Maybe Text
healthCheckPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckEnabled:TargetGroup' :: Maybe Bool
healthCheckEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:unhealthyThresholdCount:TargetGroup' :: Maybe Natural
unhealthyThresholdCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:TargetGroup' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupArn:TargetGroup' :: Maybe Text
targetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocol:TargetGroup' :: Maybe ProtocolEnum
protocol = Maybe ProtocolEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckIntervalSeconds:TargetGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:targetType:TargetGroup' :: Maybe TargetTypeEnum
targetType = Maybe TargetTypeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:healthyThresholdCount:TargetGroup' :: Maybe Natural
healthyThresholdCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckProtocol:TargetGroup' :: Maybe ProtocolEnum
healthCheckProtocol = Maybe ProtocolEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerArns:TargetGroup' :: Maybe [Text]
loadBalancerArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:TargetGroup' :: Maybe TargetGroupIpAddressTypeEnum
ipAddressType = Maybe TargetGroupIpAddressTypeEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckTimeoutSeconds:TargetGroup' :: Maybe Natural
healthCheckTimeoutSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckPort:TargetGroup' :: Maybe Text
healthCheckPort = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupName:TargetGroup' :: Maybe Text
targetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:port:TargetGroup' :: Maybe Natural
port = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | [HTTP\/HTTPS protocol] The protocol version. The possible values are
-- @GRPC@, @HTTP1@, and @HTTP2@.
targetGroup_protocolVersion :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_protocolVersion :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_protocolVersion = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
protocolVersion :: Maybe Text
$sel:protocolVersion:TargetGroup' :: TargetGroup -> Maybe Text
protocolVersion} -> Maybe Text
protocolVersion) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:protocolVersion:TargetGroup' :: Maybe Text
protocolVersion = Maybe Text
a} :: TargetGroup)

-- | The HTTP or gRPC codes to use when checking for a successful response
-- from a target.
targetGroup_matcher :: Lens.Lens' TargetGroup (Prelude.Maybe Matcher)
targetGroup_matcher :: (Maybe Matcher -> f (Maybe Matcher))
-> TargetGroup -> f TargetGroup
targetGroup_matcher = (TargetGroup -> Maybe Matcher)
-> (TargetGroup -> Maybe Matcher -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Matcher) (Maybe Matcher)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Matcher
matcher :: Maybe Matcher
$sel:matcher:TargetGroup' :: TargetGroup -> Maybe Matcher
matcher} -> Maybe Matcher
matcher) (\s :: TargetGroup
s@TargetGroup' {} Maybe Matcher
a -> TargetGroup
s {$sel:matcher:TargetGroup' :: Maybe Matcher
matcher = Maybe Matcher
a} :: TargetGroup)

-- | The destination for health checks on the targets.
targetGroup_healthCheckPath :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_healthCheckPath :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_healthCheckPath = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
healthCheckPath :: Maybe Text
$sel:healthCheckPath:TargetGroup' :: TargetGroup -> Maybe Text
healthCheckPath} -> Maybe Text
healthCheckPath) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:healthCheckPath:TargetGroup' :: Maybe Text
healthCheckPath = Maybe Text
a} :: TargetGroup)

-- | Indicates whether health checks are enabled.
targetGroup_healthCheckEnabled :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Bool)
targetGroup_healthCheckEnabled :: (Maybe Bool -> f (Maybe Bool)) -> TargetGroup -> f TargetGroup
targetGroup_healthCheckEnabled = (TargetGroup -> Maybe Bool)
-> (TargetGroup -> Maybe Bool -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Bool
healthCheckEnabled :: Maybe Bool
$sel:healthCheckEnabled:TargetGroup' :: TargetGroup -> Maybe Bool
healthCheckEnabled} -> Maybe Bool
healthCheckEnabled) (\s :: TargetGroup
s@TargetGroup' {} Maybe Bool
a -> TargetGroup
s {$sel:healthCheckEnabled:TargetGroup' :: Maybe Bool
healthCheckEnabled = Maybe Bool
a} :: TargetGroup)

-- | The number of consecutive health check failures required before
-- considering the target unhealthy.
targetGroup_unhealthyThresholdCount :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Natural)
targetGroup_unhealthyThresholdCount :: (Maybe Natural -> f (Maybe Natural))
-> TargetGroup -> f TargetGroup
targetGroup_unhealthyThresholdCount = (TargetGroup -> Maybe Natural)
-> (TargetGroup -> Maybe Natural -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Natural
unhealthyThresholdCount :: Maybe Natural
$sel:unhealthyThresholdCount:TargetGroup' :: TargetGroup -> Maybe Natural
unhealthyThresholdCount} -> Maybe Natural
unhealthyThresholdCount) (\s :: TargetGroup
s@TargetGroup' {} Maybe Natural
a -> TargetGroup
s {$sel:unhealthyThresholdCount:TargetGroup' :: Maybe Natural
unhealthyThresholdCount = Maybe Natural
a} :: TargetGroup)

-- | The ID of the VPC for the targets.
targetGroup_vpcId :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_vpcId :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_vpcId = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:TargetGroup' :: TargetGroup -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:vpcId:TargetGroup' :: Maybe Text
vpcId = Maybe Text
a} :: TargetGroup)

-- | The Amazon Resource Name (ARN) of the target group.
targetGroup_targetGroupArn :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_targetGroupArn :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_targetGroupArn = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
targetGroupArn :: Maybe Text
$sel:targetGroupArn:TargetGroup' :: TargetGroup -> Maybe Text
targetGroupArn} -> Maybe Text
targetGroupArn) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:targetGroupArn:TargetGroup' :: Maybe Text
targetGroupArn = Maybe Text
a} :: TargetGroup)

-- | The protocol to use for routing traffic to the targets.
targetGroup_protocol :: Lens.Lens' TargetGroup (Prelude.Maybe ProtocolEnum)
targetGroup_protocol :: (Maybe ProtocolEnum -> f (Maybe ProtocolEnum))
-> TargetGroup -> f TargetGroup
targetGroup_protocol = (TargetGroup -> Maybe ProtocolEnum)
-> (TargetGroup -> Maybe ProtocolEnum -> TargetGroup)
-> Lens
     TargetGroup TargetGroup (Maybe ProtocolEnum) (Maybe ProtocolEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe ProtocolEnum
protocol :: Maybe ProtocolEnum
$sel:protocol:TargetGroup' :: TargetGroup -> Maybe ProtocolEnum
protocol} -> Maybe ProtocolEnum
protocol) (\s :: TargetGroup
s@TargetGroup' {} Maybe ProtocolEnum
a -> TargetGroup
s {$sel:protocol:TargetGroup' :: Maybe ProtocolEnum
protocol = Maybe ProtocolEnum
a} :: TargetGroup)

-- | The approximate amount of time, in seconds, between health checks of an
-- individual target.
targetGroup_healthCheckIntervalSeconds :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Natural)
targetGroup_healthCheckIntervalSeconds :: (Maybe Natural -> f (Maybe Natural))
-> TargetGroup -> f TargetGroup
targetGroup_healthCheckIntervalSeconds = (TargetGroup -> Maybe Natural)
-> (TargetGroup -> Maybe Natural -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Natural
healthCheckIntervalSeconds :: Maybe Natural
$sel:healthCheckIntervalSeconds:TargetGroup' :: TargetGroup -> Maybe Natural
healthCheckIntervalSeconds} -> Maybe Natural
healthCheckIntervalSeconds) (\s :: TargetGroup
s@TargetGroup' {} Maybe Natural
a -> TargetGroup
s {$sel:healthCheckIntervalSeconds:TargetGroup' :: Maybe Natural
healthCheckIntervalSeconds = Maybe Natural
a} :: TargetGroup)

-- | The type of target that you must specify when registering targets with
-- this target group. The possible values are @instance@ (register targets
-- by instance ID), @ip@ (register targets by IP address), @lambda@
-- (register a single Lambda function as a target), or @alb@ (register a
-- single Application Load Balancer as a target).
targetGroup_targetType :: Lens.Lens' TargetGroup (Prelude.Maybe TargetTypeEnum)
targetGroup_targetType :: (Maybe TargetTypeEnum -> f (Maybe TargetTypeEnum))
-> TargetGroup -> f TargetGroup
targetGroup_targetType = (TargetGroup -> Maybe TargetTypeEnum)
-> (TargetGroup -> Maybe TargetTypeEnum -> TargetGroup)
-> Lens
     TargetGroup
     TargetGroup
     (Maybe TargetTypeEnum)
     (Maybe TargetTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe TargetTypeEnum
targetType :: Maybe TargetTypeEnum
$sel:targetType:TargetGroup' :: TargetGroup -> Maybe TargetTypeEnum
targetType} -> Maybe TargetTypeEnum
targetType) (\s :: TargetGroup
s@TargetGroup' {} Maybe TargetTypeEnum
a -> TargetGroup
s {$sel:targetType:TargetGroup' :: Maybe TargetTypeEnum
targetType = Maybe TargetTypeEnum
a} :: TargetGroup)

-- | The number of consecutive health checks successes required before
-- considering an unhealthy target healthy.
targetGroup_healthyThresholdCount :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Natural)
targetGroup_healthyThresholdCount :: (Maybe Natural -> f (Maybe Natural))
-> TargetGroup -> f TargetGroup
targetGroup_healthyThresholdCount = (TargetGroup -> Maybe Natural)
-> (TargetGroup -> Maybe Natural -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Natural
healthyThresholdCount :: Maybe Natural
$sel:healthyThresholdCount:TargetGroup' :: TargetGroup -> Maybe Natural
healthyThresholdCount} -> Maybe Natural
healthyThresholdCount) (\s :: TargetGroup
s@TargetGroup' {} Maybe Natural
a -> TargetGroup
s {$sel:healthyThresholdCount:TargetGroup' :: Maybe Natural
healthyThresholdCount = Maybe Natural
a} :: TargetGroup)

-- | The protocol to use to connect with the target. The GENEVE, TLS, UDP,
-- and TCP_UDP protocols are not supported for health checks.
targetGroup_healthCheckProtocol :: Lens.Lens' TargetGroup (Prelude.Maybe ProtocolEnum)
targetGroup_healthCheckProtocol :: (Maybe ProtocolEnum -> f (Maybe ProtocolEnum))
-> TargetGroup -> f TargetGroup
targetGroup_healthCheckProtocol = (TargetGroup -> Maybe ProtocolEnum)
-> (TargetGroup -> Maybe ProtocolEnum -> TargetGroup)
-> Lens
     TargetGroup TargetGroup (Maybe ProtocolEnum) (Maybe ProtocolEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe ProtocolEnum
healthCheckProtocol :: Maybe ProtocolEnum
$sel:healthCheckProtocol:TargetGroup' :: TargetGroup -> Maybe ProtocolEnum
healthCheckProtocol} -> Maybe ProtocolEnum
healthCheckProtocol) (\s :: TargetGroup
s@TargetGroup' {} Maybe ProtocolEnum
a -> TargetGroup
s {$sel:healthCheckProtocol:TargetGroup' :: Maybe ProtocolEnum
healthCheckProtocol = Maybe ProtocolEnum
a} :: TargetGroup)

-- | The Amazon Resource Names (ARN) of the load balancers that route traffic
-- to this target group.
targetGroup_loadBalancerArns :: Lens.Lens' TargetGroup (Prelude.Maybe [Prelude.Text])
targetGroup_loadBalancerArns :: (Maybe [Text] -> f (Maybe [Text])) -> TargetGroup -> f TargetGroup
targetGroup_loadBalancerArns = (TargetGroup -> Maybe [Text])
-> (TargetGroup -> Maybe [Text] -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe [Text]
loadBalancerArns :: Maybe [Text]
$sel:loadBalancerArns:TargetGroup' :: TargetGroup -> Maybe [Text]
loadBalancerArns} -> Maybe [Text]
loadBalancerArns) (\s :: TargetGroup
s@TargetGroup' {} Maybe [Text]
a -> TargetGroup
s {$sel:loadBalancerArns:TargetGroup' :: Maybe [Text]
loadBalancerArns = Maybe [Text]
a} :: TargetGroup) ((Maybe [Text] -> f (Maybe [Text]))
 -> TargetGroup -> f TargetGroup)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> TargetGroup
-> f TargetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of IP address used for this target group. The possible values
-- are @ipv4@ and @ipv6@. This is an optional parameter. If not specified,
-- the IP address type defaults to @ipv4@.
targetGroup_ipAddressType :: Lens.Lens' TargetGroup (Prelude.Maybe TargetGroupIpAddressTypeEnum)
targetGroup_ipAddressType :: (Maybe TargetGroupIpAddressTypeEnum
 -> f (Maybe TargetGroupIpAddressTypeEnum))
-> TargetGroup -> f TargetGroup
targetGroup_ipAddressType = (TargetGroup -> Maybe TargetGroupIpAddressTypeEnum)
-> (TargetGroup
    -> Maybe TargetGroupIpAddressTypeEnum -> TargetGroup)
-> Lens
     TargetGroup
     TargetGroup
     (Maybe TargetGroupIpAddressTypeEnum)
     (Maybe TargetGroupIpAddressTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe TargetGroupIpAddressTypeEnum
ipAddressType :: Maybe TargetGroupIpAddressTypeEnum
$sel:ipAddressType:TargetGroup' :: TargetGroup -> Maybe TargetGroupIpAddressTypeEnum
ipAddressType} -> Maybe TargetGroupIpAddressTypeEnum
ipAddressType) (\s :: TargetGroup
s@TargetGroup' {} Maybe TargetGroupIpAddressTypeEnum
a -> TargetGroup
s {$sel:ipAddressType:TargetGroup' :: Maybe TargetGroupIpAddressTypeEnum
ipAddressType = Maybe TargetGroupIpAddressTypeEnum
a} :: TargetGroup)

-- | The amount of time, in seconds, during which no response means a failed
-- health check.
targetGroup_healthCheckTimeoutSeconds :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Natural)
targetGroup_healthCheckTimeoutSeconds :: (Maybe Natural -> f (Maybe Natural))
-> TargetGroup -> f TargetGroup
targetGroup_healthCheckTimeoutSeconds = (TargetGroup -> Maybe Natural)
-> (TargetGroup -> Maybe Natural -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Natural
healthCheckTimeoutSeconds :: Maybe Natural
$sel:healthCheckTimeoutSeconds:TargetGroup' :: TargetGroup -> Maybe Natural
healthCheckTimeoutSeconds} -> Maybe Natural
healthCheckTimeoutSeconds) (\s :: TargetGroup
s@TargetGroup' {} Maybe Natural
a -> TargetGroup
s {$sel:healthCheckTimeoutSeconds:TargetGroup' :: Maybe Natural
healthCheckTimeoutSeconds = Maybe Natural
a} :: TargetGroup)

-- | The port to use to connect with the target.
targetGroup_healthCheckPort :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_healthCheckPort :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_healthCheckPort = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
healthCheckPort :: Maybe Text
$sel:healthCheckPort:TargetGroup' :: TargetGroup -> Maybe Text
healthCheckPort} -> Maybe Text
healthCheckPort) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:healthCheckPort:TargetGroup' :: Maybe Text
healthCheckPort = Maybe Text
a} :: TargetGroup)

-- | The name of the target group.
targetGroup_targetGroupName :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Text)
targetGroup_targetGroupName :: (Maybe Text -> f (Maybe Text)) -> TargetGroup -> f TargetGroup
targetGroup_targetGroupName = (TargetGroup -> Maybe Text)
-> (TargetGroup -> Maybe Text -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Text
targetGroupName :: Maybe Text
$sel:targetGroupName:TargetGroup' :: TargetGroup -> Maybe Text
targetGroupName} -> Maybe Text
targetGroupName) (\s :: TargetGroup
s@TargetGroup' {} Maybe Text
a -> TargetGroup
s {$sel:targetGroupName:TargetGroup' :: Maybe Text
targetGroupName = Maybe Text
a} :: TargetGroup)

-- | The port on which the targets are listening. Not used if the target is a
-- Lambda function.
targetGroup_port :: Lens.Lens' TargetGroup (Prelude.Maybe Prelude.Natural)
targetGroup_port :: (Maybe Natural -> f (Maybe Natural))
-> TargetGroup -> f TargetGroup
targetGroup_port = (TargetGroup -> Maybe Natural)
-> (TargetGroup -> Maybe Natural -> TargetGroup)
-> Lens TargetGroup TargetGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroup' {Maybe Natural
port :: Maybe Natural
$sel:port:TargetGroup' :: TargetGroup -> Maybe Natural
port} -> Maybe Natural
port) (\s :: TargetGroup
s@TargetGroup' {} Maybe Natural
a -> TargetGroup
s {$sel:port:TargetGroup' :: Maybe Natural
port = Maybe Natural
a} :: TargetGroup)

instance Core.FromXML TargetGroup where
  parseXML :: [Node] -> Either String TargetGroup
parseXML [Node]
x =
    Maybe Text
-> Maybe Matcher
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe ProtocolEnum
-> Maybe Natural
-> Maybe TargetTypeEnum
-> Maybe Natural
-> Maybe ProtocolEnum
-> Maybe [Text]
-> Maybe TargetGroupIpAddressTypeEnum
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> TargetGroup
TargetGroup'
      (Maybe Text
 -> Maybe Matcher
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe ProtocolEnum
 -> Maybe Natural
 -> Maybe TargetTypeEnum
 -> Maybe Natural
 -> Maybe ProtocolEnum
 -> Maybe [Text]
 -> Maybe TargetGroupIpAddressTypeEnum
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> TargetGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Matcher
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ProtocolVersion")
      Either
  String
  (Maybe Matcher
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Matcher)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Matcher)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Matcher")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckPath")
      Either
  String
  (Maybe Bool
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckEnabled")
      Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UnhealthyThresholdCount")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcId")
      Either
  String
  (Maybe Text
   -> Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ProtocolEnum
      -> Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetGroupArn")
      Either
  String
  (Maybe ProtocolEnum
   -> Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe ProtocolEnum)
-> Either
     String
     (Maybe Natural
      -> Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ProtocolEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Protocol")
      Either
  String
  (Maybe Natural
   -> Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe TargetTypeEnum
      -> Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckIntervalSeconds")
      Either
  String
  (Maybe TargetTypeEnum
   -> Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe TargetTypeEnum)
-> Either
     String
     (Maybe Natural
      -> Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TargetTypeEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetType")
      Either
  String
  (Maybe Natural
   -> Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe ProtocolEnum
      -> Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthyThresholdCount")
      Either
  String
  (Maybe ProtocolEnum
   -> Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe ProtocolEnum)
-> Either
     String
     (Maybe [Text]
      -> Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ProtocolEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckProtocol")
      Either
  String
  (Maybe [Text]
   -> Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe TargetGroupIpAddressTypeEnum
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LoadBalancerArns"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe TargetGroupIpAddressTypeEnum
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> TargetGroup)
-> Either String (Maybe TargetGroupIpAddressTypeEnum)
-> Either
     String
     (Maybe Natural
      -> Maybe Text -> Maybe Text -> Maybe Natural -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe TargetGroupIpAddressTypeEnum)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IpAddressType")
      Either
  String
  (Maybe Natural
   -> Maybe Text -> Maybe Text -> Maybe Natural -> TargetGroup)
-> Either String (Maybe Natural)
-> Either
     String (Maybe Text -> Maybe Text -> Maybe Natural -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckTimeoutSeconds")
      Either
  String (Maybe Text -> Maybe Text -> Maybe Natural -> TargetGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Natural -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthCheckPort")
      Either String (Maybe Text -> Maybe Natural -> TargetGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Natural -> TargetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetGroupName")
      Either String (Maybe Natural -> TargetGroup)
-> Either String (Maybe Natural) -> Either String TargetGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Port")

instance Prelude.Hashable TargetGroup

instance Prelude.NFData TargetGroup