{-# 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.Route53Resolver.Types.ResolverEndpoint
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Resolver.Types.ResolverEndpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ResolverEndpointDirection
import Amazonka.Route53Resolver.Types.ResolverEndpointStatus

-- | In the response to a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_DeleteResolverEndpoint.html DeleteResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_GetResolverEndpoint.html GetResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_ListResolverEndpoints.html ListResolverEndpoints>,
-- or
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_UpdateResolverEndpoint.html UpdateResolverEndpoint>
-- request, a complex type that contains settings for an existing inbound
-- or outbound Resolver endpoint.
--
-- /See:/ 'newResolverEndpoint' smart constructor.
data ResolverEndpoint = ResolverEndpoint'
  { -- | The ARN (Amazon Resource Name) for the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the endpoint was created, in Unix time format and
    -- Coordinated Universal Time (UTC).
    ResolverEndpoint -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | A unique string that identifies the request that created the Resolver
    -- endpoint. The @CreatorRequestId@ allows failed requests to be retried
    -- without the risk of running the operation twice.
    ResolverEndpoint -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the Resolver endpoint allows inbound or outbound DNS
    -- queries:
    --
    -- -   @INBOUND@: allows DNS queries to your VPC from your network
    --
    -- -   @OUTBOUND@: allows DNS queries from your VPC to your network
    ResolverEndpoint -> Maybe ResolverEndpointDirection
direction :: Prelude.Maybe ResolverEndpointDirection,
    -- | The ID of the VPC that you want to create the Resolver endpoint in.
    ResolverEndpoint -> Maybe Text
hostVPCId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The number of IP addresses that the Resolver endpoint can use for DNS
    -- queries.
    ResolverEndpoint -> Maybe Int
ipAddressCount :: Prelude.Maybe Prelude.Int,
    -- | The date and time that the endpoint was last modified, in Unix time
    -- format and Coordinated Universal Time (UTC).
    ResolverEndpoint -> Maybe Text
modificationTime :: Prelude.Maybe Prelude.Text,
    -- | The name that you assigned to the Resolver endpoint when you submitted a
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
    -- request.
    ResolverEndpoint -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of one or more security groups that control access to this VPC.
    -- The security group must include one or more inbound rules (for inbound
    -- endpoints) or outbound rules (for outbound endpoints). Inbound and
    -- outbound rules must allow TCP and UDP access. For inbound access, open
    -- port 53. For outbound access, open the port that you\'re using for DNS
    -- queries on your network.
    ResolverEndpoint -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | A code that specifies the current status of the Resolver endpoint. Valid
    -- values include the following:
    --
    -- -   @CREATING@: Resolver is creating and configuring one or more Amazon
    --     VPC network interfaces for this endpoint.
    --
    -- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
    --     are correctly configured and able to pass inbound or outbound DNS
    --     queries between your network and Resolver.
    --
    -- -   @UPDATING@: Resolver is associating or disassociating one or more
    --     network interfaces with this endpoint.
    --
    -- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
    --     network interfaces that are associated with this endpoint. During
    --     the recovery process, the endpoint functions with limited capacity
    --     because of the limit on the number of DNS queries per IP address
    --     (per network interface). For the current limit, see
    --     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
    --
    -- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
    --     automatically recover it. To resolve the problem, we recommend that
    --     you check each IP address that you associated with the endpoint. For
    --     each IP address that isn\'t available, add another IP address and
    --     then delete the IP address that isn\'t available. (An endpoint must
    --     always include at least two IP addresses.) A status of
    --     @ACTION_NEEDED@ can have a variety of causes. Here are two common
    --     causes:
    --
    --     -   One or more of the network interfaces that are associated with
    --         the endpoint were deleted using Amazon VPC.
    --
    --     -   The network interface couldn\'t be created for some reason
    --         that\'s outside the control of Resolver.
    --
    -- -   @DELETING@: Resolver is deleting this endpoint and the associated
    --     network interfaces.
    ResolverEndpoint -> Maybe ResolverEndpointStatus
status :: Prelude.Maybe ResolverEndpointStatus,
    -- | A detailed description of the status of the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (ResolverEndpoint -> ResolverEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolverEndpoint -> ResolverEndpoint -> Bool
$c/= :: ResolverEndpoint -> ResolverEndpoint -> Bool
== :: ResolverEndpoint -> ResolverEndpoint -> Bool
$c== :: ResolverEndpoint -> ResolverEndpoint -> Bool
Prelude.Eq, ReadPrec [ResolverEndpoint]
ReadPrec ResolverEndpoint
Int -> ReadS ResolverEndpoint
ReadS [ResolverEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolverEndpoint]
$creadListPrec :: ReadPrec [ResolverEndpoint]
readPrec :: ReadPrec ResolverEndpoint
$creadPrec :: ReadPrec ResolverEndpoint
readList :: ReadS [ResolverEndpoint]
$creadList :: ReadS [ResolverEndpoint]
readsPrec :: Int -> ReadS ResolverEndpoint
$creadsPrec :: Int -> ReadS ResolverEndpoint
Prelude.Read, Int -> ResolverEndpoint -> ShowS
[ResolverEndpoint] -> ShowS
ResolverEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolverEndpoint] -> ShowS
$cshowList :: [ResolverEndpoint] -> ShowS
show :: ResolverEndpoint -> String
$cshow :: ResolverEndpoint -> String
showsPrec :: Int -> ResolverEndpoint -> ShowS
$cshowsPrec :: Int -> ResolverEndpoint -> ShowS
Prelude.Show, forall x. Rep ResolverEndpoint x -> ResolverEndpoint
forall x. ResolverEndpoint -> Rep ResolverEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResolverEndpoint x -> ResolverEndpoint
$cfrom :: forall x. ResolverEndpoint -> Rep ResolverEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ResolverEndpoint' 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:
--
-- 'arn', 'resolverEndpoint_arn' - The ARN (Amazon Resource Name) for the Resolver endpoint.
--
-- 'creationTime', 'resolverEndpoint_creationTime' - The date and time that the endpoint was created, in Unix time format and
-- Coordinated Universal Time (UTC).
--
-- 'creatorRequestId', 'resolverEndpoint_creatorRequestId' - A unique string that identifies the request that created the Resolver
-- endpoint. The @CreatorRequestId@ allows failed requests to be retried
-- without the risk of running the operation twice.
--
-- 'direction', 'resolverEndpoint_direction' - Indicates whether the Resolver endpoint allows inbound or outbound DNS
-- queries:
--
-- -   @INBOUND@: allows DNS queries to your VPC from your network
--
-- -   @OUTBOUND@: allows DNS queries from your VPC to your network
--
-- 'hostVPCId', 'resolverEndpoint_hostVPCId' - The ID of the VPC that you want to create the Resolver endpoint in.
--
-- 'id', 'resolverEndpoint_id' - The ID of the Resolver endpoint.
--
-- 'ipAddressCount', 'resolverEndpoint_ipAddressCount' - The number of IP addresses that the Resolver endpoint can use for DNS
-- queries.
--
-- 'modificationTime', 'resolverEndpoint_modificationTime' - The date and time that the endpoint was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
--
-- 'name', 'resolverEndpoint_name' - The name that you assigned to the Resolver endpoint when you submitted a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
-- request.
--
-- 'securityGroupIds', 'resolverEndpoint_securityGroupIds' - The ID of one or more security groups that control access to this VPC.
-- The security group must include one or more inbound rules (for inbound
-- endpoints) or outbound rules (for outbound endpoints). Inbound and
-- outbound rules must allow TCP and UDP access. For inbound access, open
-- port 53. For outbound access, open the port that you\'re using for DNS
-- queries on your network.
--
-- 'status', 'resolverEndpoint_status' - A code that specifies the current status of the Resolver endpoint. Valid
-- values include the following:
--
-- -   @CREATING@: Resolver is creating and configuring one or more Amazon
--     VPC network interfaces for this endpoint.
--
-- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
--     are correctly configured and able to pass inbound or outbound DNS
--     queries between your network and Resolver.
--
-- -   @UPDATING@: Resolver is associating or disassociating one or more
--     network interfaces with this endpoint.
--
-- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
--     network interfaces that are associated with this endpoint. During
--     the recovery process, the endpoint functions with limited capacity
--     because of the limit on the number of DNS queries per IP address
--     (per network interface). For the current limit, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
--
-- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
--     automatically recover it. To resolve the problem, we recommend that
--     you check each IP address that you associated with the endpoint. For
--     each IP address that isn\'t available, add another IP address and
--     then delete the IP address that isn\'t available. (An endpoint must
--     always include at least two IP addresses.) A status of
--     @ACTION_NEEDED@ can have a variety of causes. Here are two common
--     causes:
--
--     -   One or more of the network interfaces that are associated with
--         the endpoint were deleted using Amazon VPC.
--
--     -   The network interface couldn\'t be created for some reason
--         that\'s outside the control of Resolver.
--
-- -   @DELETING@: Resolver is deleting this endpoint and the associated
--     network interfaces.
--
-- 'statusMessage', 'resolverEndpoint_statusMessage' - A detailed description of the status of the Resolver endpoint.
newResolverEndpoint ::
  ResolverEndpoint
newResolverEndpoint :: ResolverEndpoint
newResolverEndpoint =
  ResolverEndpoint'
    { $sel:arn:ResolverEndpoint' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:ResolverEndpoint' :: Maybe Text
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:ResolverEndpoint' :: Maybe Text
creatorRequestId = forall a. Maybe a
Prelude.Nothing,
      $sel:direction:ResolverEndpoint' :: Maybe ResolverEndpointDirection
direction = forall a. Maybe a
Prelude.Nothing,
      $sel:hostVPCId:ResolverEndpoint' :: Maybe Text
hostVPCId = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResolverEndpoint' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressCount:ResolverEndpoint' :: Maybe Int
ipAddressCount = forall a. Maybe a
Prelude.Nothing,
      $sel:modificationTime:ResolverEndpoint' :: Maybe Text
modificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ResolverEndpoint' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:ResolverEndpoint' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResolverEndpoint' :: Maybe ResolverEndpointStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:ResolverEndpoint' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN (Amazon Resource Name) for the Resolver endpoint.
resolverEndpoint_arn :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_arn :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
arn :: Maybe Text
$sel:arn:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:arn:ResolverEndpoint' :: Maybe Text
arn = Maybe Text
a} :: ResolverEndpoint)

-- | The date and time that the endpoint was created, in Unix time format and
-- Coordinated Universal Time (UTC).
resolverEndpoint_creationTime :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_creationTime :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:creationTime:ResolverEndpoint' :: Maybe Text
creationTime = Maybe Text
a} :: ResolverEndpoint)

-- | A unique string that identifies the request that created the Resolver
-- endpoint. The @CreatorRequestId@ allows failed requests to be retried
-- without the risk of running the operation twice.
resolverEndpoint_creatorRequestId :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_creatorRequestId :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_creatorRequestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:creatorRequestId:ResolverEndpoint' :: Maybe Text
creatorRequestId = Maybe Text
a} :: ResolverEndpoint)

-- | Indicates whether the Resolver endpoint allows inbound or outbound DNS
-- queries:
--
-- -   @INBOUND@: allows DNS queries to your VPC from your network
--
-- -   @OUTBOUND@: allows DNS queries from your VPC to your network
resolverEndpoint_direction :: Lens.Lens' ResolverEndpoint (Prelude.Maybe ResolverEndpointDirection)
resolverEndpoint_direction :: Lens' ResolverEndpoint (Maybe ResolverEndpointDirection)
resolverEndpoint_direction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe ResolverEndpointDirection
direction :: Maybe ResolverEndpointDirection
$sel:direction:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointDirection
direction} -> Maybe ResolverEndpointDirection
direction) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe ResolverEndpointDirection
a -> ResolverEndpoint
s {$sel:direction:ResolverEndpoint' :: Maybe ResolverEndpointDirection
direction = Maybe ResolverEndpointDirection
a} :: ResolverEndpoint)

-- | The ID of the VPC that you want to create the Resolver endpoint in.
resolverEndpoint_hostVPCId :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_hostVPCId :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_hostVPCId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
hostVPCId :: Maybe Text
$sel:hostVPCId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
hostVPCId} -> Maybe Text
hostVPCId) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:hostVPCId:ResolverEndpoint' :: Maybe Text
hostVPCId = Maybe Text
a} :: ResolverEndpoint)

-- | The ID of the Resolver endpoint.
resolverEndpoint_id :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_id :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
id :: Maybe Text
$sel:id:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
id} -> Maybe Text
id) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:id:ResolverEndpoint' :: Maybe Text
id = Maybe Text
a} :: ResolverEndpoint)

-- | The number of IP addresses that the Resolver endpoint can use for DNS
-- queries.
resolverEndpoint_ipAddressCount :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Int)
resolverEndpoint_ipAddressCount :: Lens' ResolverEndpoint (Maybe Int)
resolverEndpoint_ipAddressCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Int
ipAddressCount :: Maybe Int
$sel:ipAddressCount:ResolverEndpoint' :: ResolverEndpoint -> Maybe Int
ipAddressCount} -> Maybe Int
ipAddressCount) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Int
a -> ResolverEndpoint
s {$sel:ipAddressCount:ResolverEndpoint' :: Maybe Int
ipAddressCount = Maybe Int
a} :: ResolverEndpoint)

-- | The date and time that the endpoint was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
resolverEndpoint_modificationTime :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_modificationTime :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_modificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
modificationTime :: Maybe Text
$sel:modificationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
modificationTime} -> Maybe Text
modificationTime) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:modificationTime:ResolverEndpoint' :: Maybe Text
modificationTime = Maybe Text
a} :: ResolverEndpoint)

-- | The name that you assigned to the Resolver endpoint when you submitted a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
-- request.
resolverEndpoint_name :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_name :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
name :: Maybe Text
$sel:name:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
name} -> Maybe Text
name) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:name:ResolverEndpoint' :: Maybe Text
name = Maybe Text
a} :: ResolverEndpoint)

-- | The ID of one or more security groups that control access to this VPC.
-- The security group must include one or more inbound rules (for inbound
-- endpoints) or outbound rules (for outbound endpoints). Inbound and
-- outbound rules must allow TCP and UDP access. For inbound access, open
-- port 53. For outbound access, open the port that you\'re using for DNS
-- queries on your network.
resolverEndpoint_securityGroupIds :: Lens.Lens' ResolverEndpoint (Prelude.Maybe [Prelude.Text])
resolverEndpoint_securityGroupIds :: Lens' ResolverEndpoint (Maybe [Text])
resolverEndpoint_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:ResolverEndpoint' :: ResolverEndpoint -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe [Text]
a -> ResolverEndpoint
s {$sel:securityGroupIds:ResolverEndpoint' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: ResolverEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A code that specifies the current status of the Resolver endpoint. Valid
-- values include the following:
--
-- -   @CREATING@: Resolver is creating and configuring one or more Amazon
--     VPC network interfaces for this endpoint.
--
-- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
--     are correctly configured and able to pass inbound or outbound DNS
--     queries between your network and Resolver.
--
-- -   @UPDATING@: Resolver is associating or disassociating one or more
--     network interfaces with this endpoint.
--
-- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
--     network interfaces that are associated with this endpoint. During
--     the recovery process, the endpoint functions with limited capacity
--     because of the limit on the number of DNS queries per IP address
--     (per network interface). For the current limit, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
--
-- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
--     automatically recover it. To resolve the problem, we recommend that
--     you check each IP address that you associated with the endpoint. For
--     each IP address that isn\'t available, add another IP address and
--     then delete the IP address that isn\'t available. (An endpoint must
--     always include at least two IP addresses.) A status of
--     @ACTION_NEEDED@ can have a variety of causes. Here are two common
--     causes:
--
--     -   One or more of the network interfaces that are associated with
--         the endpoint were deleted using Amazon VPC.
--
--     -   The network interface couldn\'t be created for some reason
--         that\'s outside the control of Resolver.
--
-- -   @DELETING@: Resolver is deleting this endpoint and the associated
--     network interfaces.
resolverEndpoint_status :: Lens.Lens' ResolverEndpoint (Prelude.Maybe ResolverEndpointStatus)
resolverEndpoint_status :: Lens' ResolverEndpoint (Maybe ResolverEndpointStatus)
resolverEndpoint_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe ResolverEndpointStatus
status :: Maybe ResolverEndpointStatus
$sel:status:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointStatus
status} -> Maybe ResolverEndpointStatus
status) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe ResolverEndpointStatus
a -> ResolverEndpoint
s {$sel:status:ResolverEndpoint' :: Maybe ResolverEndpointStatus
status = Maybe ResolverEndpointStatus
a} :: ResolverEndpoint)

-- | A detailed description of the status of the Resolver endpoint.
resolverEndpoint_statusMessage :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_statusMessage :: Lens' ResolverEndpoint (Maybe Text)
resolverEndpoint_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:statusMessage:ResolverEndpoint' :: Maybe Text
statusMessage = Maybe Text
a} :: ResolverEndpoint)

instance Data.FromJSON ResolverEndpoint where
  parseJSON :: Value -> Parser ResolverEndpoint
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ResolverEndpoint"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResolverEndpointDirection
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe ResolverEndpointStatus
-> Maybe Text
-> ResolverEndpoint
ResolverEndpoint'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatorRequestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Direction")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HostVPCId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IpAddressCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ModificationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecurityGroupIds"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusMessage")
      )

instance Prelude.Hashable ResolverEndpoint where
  hashWithSalt :: Int -> ResolverEndpoint -> Int
hashWithSalt Int
_salt ResolverEndpoint' {Maybe Int
Maybe [Text]
Maybe Text
Maybe ResolverEndpointDirection
Maybe ResolverEndpointStatus
statusMessage :: Maybe Text
status :: Maybe ResolverEndpointStatus
securityGroupIds :: Maybe [Text]
name :: Maybe Text
modificationTime :: Maybe Text
ipAddressCount :: Maybe Int
id :: Maybe Text
hostVPCId :: Maybe Text
direction :: Maybe ResolverEndpointDirection
creatorRequestId :: Maybe Text
creationTime :: Maybe Text
arn :: Maybe Text
$sel:statusMessage:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:status:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointStatus
$sel:securityGroupIds:ResolverEndpoint' :: ResolverEndpoint -> Maybe [Text]
$sel:name:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:modificationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:ipAddressCount:ResolverEndpoint' :: ResolverEndpoint -> Maybe Int
$sel:id:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:hostVPCId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:direction:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointDirection
$sel:creatorRequestId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:creationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:arn:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creatorRequestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResolverEndpointDirection
direction
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostVPCId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
ipAddressCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modificationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResolverEndpointStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage

instance Prelude.NFData ResolverEndpoint where
  rnf :: ResolverEndpoint -> ()
rnf ResolverEndpoint' {Maybe Int
Maybe [Text]
Maybe Text
Maybe ResolverEndpointDirection
Maybe ResolverEndpointStatus
statusMessage :: Maybe Text
status :: Maybe ResolverEndpointStatus
securityGroupIds :: Maybe [Text]
name :: Maybe Text
modificationTime :: Maybe Text
ipAddressCount :: Maybe Int
id :: Maybe Text
hostVPCId :: Maybe Text
direction :: Maybe ResolverEndpointDirection
creatorRequestId :: Maybe Text
creationTime :: Maybe Text
arn :: Maybe Text
$sel:statusMessage:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:status:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointStatus
$sel:securityGroupIds:ResolverEndpoint' :: ResolverEndpoint -> Maybe [Text]
$sel:name:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:modificationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:ipAddressCount:ResolverEndpoint' :: ResolverEndpoint -> Maybe Int
$sel:id:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:hostVPCId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:direction:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointDirection
$sel:creatorRequestId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:creationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
$sel:arn:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creatorRequestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResolverEndpointDirection
direction
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostVPCId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
ipAddressCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResolverEndpointStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage