{-# 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.EC2.Types.VpcPeeringConnectionOptionsDescription
-- 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.EC2.Types.VpcPeeringConnectionOptionsDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | We are retiring EC2-Classic. We recommend that you migrate from
-- EC2-Classic to a VPC. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html Migrate from EC2-Classic to a VPC>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- Describes the VPC peering connection options.
--
-- /See:/ 'newVpcPeeringConnectionOptionsDescription' smart constructor.
data VpcPeeringConnectionOptionsDescription = VpcPeeringConnectionOptionsDescription'
  { -- | Indicates whether a local VPC can resolve public DNS hostnames to
    -- private IP addresses when queried from instances in a peer VPC.
    VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowDnsResolutionFromRemoteVpc :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether a local ClassicLink connection can communicate with
    -- the peer VPC over the VPC peering connection.
    VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether a local VPC can communicate with a ClassicLink
    -- connection in the peer VPC over the VPC peering connection.
    VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Prelude.Maybe Prelude.Bool
  }
  deriving (VpcPeeringConnectionOptionsDescription
-> VpcPeeringConnectionOptionsDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcPeeringConnectionOptionsDescription
-> VpcPeeringConnectionOptionsDescription -> Bool
$c/= :: VpcPeeringConnectionOptionsDescription
-> VpcPeeringConnectionOptionsDescription -> Bool
== :: VpcPeeringConnectionOptionsDescription
-> VpcPeeringConnectionOptionsDescription -> Bool
$c== :: VpcPeeringConnectionOptionsDescription
-> VpcPeeringConnectionOptionsDescription -> Bool
Prelude.Eq, ReadPrec [VpcPeeringConnectionOptionsDescription]
ReadPrec VpcPeeringConnectionOptionsDescription
Int -> ReadS VpcPeeringConnectionOptionsDescription
ReadS [VpcPeeringConnectionOptionsDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcPeeringConnectionOptionsDescription]
$creadListPrec :: ReadPrec [VpcPeeringConnectionOptionsDescription]
readPrec :: ReadPrec VpcPeeringConnectionOptionsDescription
$creadPrec :: ReadPrec VpcPeeringConnectionOptionsDescription
readList :: ReadS [VpcPeeringConnectionOptionsDescription]
$creadList :: ReadS [VpcPeeringConnectionOptionsDescription]
readsPrec :: Int -> ReadS VpcPeeringConnectionOptionsDescription
$creadsPrec :: Int -> ReadS VpcPeeringConnectionOptionsDescription
Prelude.Read, Int -> VpcPeeringConnectionOptionsDescription -> ShowS
[VpcPeeringConnectionOptionsDescription] -> ShowS
VpcPeeringConnectionOptionsDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcPeeringConnectionOptionsDescription] -> ShowS
$cshowList :: [VpcPeeringConnectionOptionsDescription] -> ShowS
show :: VpcPeeringConnectionOptionsDescription -> String
$cshow :: VpcPeeringConnectionOptionsDescription -> String
showsPrec :: Int -> VpcPeeringConnectionOptionsDescription -> ShowS
$cshowsPrec :: Int -> VpcPeeringConnectionOptionsDescription -> ShowS
Prelude.Show, forall x.
Rep VpcPeeringConnectionOptionsDescription x
-> VpcPeeringConnectionOptionsDescription
forall x.
VpcPeeringConnectionOptionsDescription
-> Rep VpcPeeringConnectionOptionsDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VpcPeeringConnectionOptionsDescription x
-> VpcPeeringConnectionOptionsDescription
$cfrom :: forall x.
VpcPeeringConnectionOptionsDescription
-> Rep VpcPeeringConnectionOptionsDescription x
Prelude.Generic)

-- |
-- Create a value of 'VpcPeeringConnectionOptionsDescription' 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:
--
-- 'allowDnsResolutionFromRemoteVpc', 'vpcPeeringConnectionOptionsDescription_allowDnsResolutionFromRemoteVpc' - Indicates whether a local VPC can resolve public DNS hostnames to
-- private IP addresses when queried from instances in a peer VPC.
--
-- 'allowEgressFromLocalClassicLinkToRemoteVpc', 'vpcPeeringConnectionOptionsDescription_allowEgressFromLocalClassicLinkToRemoteVpc' - Indicates whether a local ClassicLink connection can communicate with
-- the peer VPC over the VPC peering connection.
--
-- 'allowEgressFromLocalVpcToRemoteClassicLink', 'vpcPeeringConnectionOptionsDescription_allowEgressFromLocalVpcToRemoteClassicLink' - Indicates whether a local VPC can communicate with a ClassicLink
-- connection in the peer VPC over the VPC peering connection.
newVpcPeeringConnectionOptionsDescription ::
  VpcPeeringConnectionOptionsDescription
newVpcPeeringConnectionOptionsDescription :: VpcPeeringConnectionOptionsDescription
newVpcPeeringConnectionOptionsDescription =
  VpcPeeringConnectionOptionsDescription'
    { $sel:allowDnsResolutionFromRemoteVpc:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowDnsResolutionFromRemoteVpc =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allowEgressFromLocalClassicLinkToRemoteVpc:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allowEgressFromLocalVpcToRemoteClassicLink:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether a local VPC can resolve public DNS hostnames to
-- private IP addresses when queried from instances in a peer VPC.
vpcPeeringConnectionOptionsDescription_allowDnsResolutionFromRemoteVpc :: Lens.Lens' VpcPeeringConnectionOptionsDescription (Prelude.Maybe Prelude.Bool)
vpcPeeringConnectionOptionsDescription_allowDnsResolutionFromRemoteVpc :: Lens' VpcPeeringConnectionOptionsDescription (Maybe Bool)
vpcPeeringConnectionOptionsDescription_allowDnsResolutionFromRemoteVpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcPeeringConnectionOptionsDescription' {Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowDnsResolutionFromRemoteVpc} -> Maybe Bool
allowDnsResolutionFromRemoteVpc) (\s :: VpcPeeringConnectionOptionsDescription
s@VpcPeeringConnectionOptionsDescription' {} Maybe Bool
a -> VpcPeeringConnectionOptionsDescription
s {$sel:allowDnsResolutionFromRemoteVpc:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowDnsResolutionFromRemoteVpc = Maybe Bool
a} :: VpcPeeringConnectionOptionsDescription)

-- | Indicates whether a local ClassicLink connection can communicate with
-- the peer VPC over the VPC peering connection.
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalClassicLinkToRemoteVpc :: Lens.Lens' VpcPeeringConnectionOptionsDescription (Prelude.Maybe Prelude.Bool)
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalClassicLinkToRemoteVpc :: Lens' VpcPeeringConnectionOptionsDescription (Maybe Bool)
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalClassicLinkToRemoteVpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcPeeringConnectionOptionsDescription' {Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc} -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc) (\s :: VpcPeeringConnectionOptionsDescription
s@VpcPeeringConnectionOptionsDescription' {} Maybe Bool
a -> VpcPeeringConnectionOptionsDescription
s {$sel:allowEgressFromLocalClassicLinkToRemoteVpc:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc = Maybe Bool
a} :: VpcPeeringConnectionOptionsDescription)

-- | Indicates whether a local VPC can communicate with a ClassicLink
-- connection in the peer VPC over the VPC peering connection.
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalVpcToRemoteClassicLink :: Lens.Lens' VpcPeeringConnectionOptionsDescription (Prelude.Maybe Prelude.Bool)
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalVpcToRemoteClassicLink :: Lens' VpcPeeringConnectionOptionsDescription (Maybe Bool)
vpcPeeringConnectionOptionsDescription_allowEgressFromLocalVpcToRemoteClassicLink = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcPeeringConnectionOptionsDescription' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink} -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink) (\s :: VpcPeeringConnectionOptionsDescription
s@VpcPeeringConnectionOptionsDescription' {} Maybe Bool
a -> VpcPeeringConnectionOptionsDescription
s {$sel:allowEgressFromLocalVpcToRemoteClassicLink:VpcPeeringConnectionOptionsDescription' :: Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink = Maybe Bool
a} :: VpcPeeringConnectionOptionsDescription)

instance
  Data.FromXML
    VpcPeeringConnectionOptionsDescription
  where
  parseXML :: [Node] -> Either String VpcPeeringConnectionOptionsDescription
parseXML [Node]
x =
    Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> VpcPeeringConnectionOptionsDescription
VpcPeeringConnectionOptionsDescription'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"allowDnsResolutionFromRemoteVpc")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"allowEgressFromLocalClassicLinkToRemoteVpc"
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"allowEgressFromLocalVpcToRemoteClassicLink"
                  )

instance
  Prelude.Hashable
    VpcPeeringConnectionOptionsDescription
  where
  hashWithSalt :: Int -> VpcPeeringConnectionOptionsDescription -> Int
hashWithSalt
    Int
_salt
    VpcPeeringConnectionOptionsDescription' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowDnsResolutionFromRemoteVpc
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink

instance
  Prelude.NFData
    VpcPeeringConnectionOptionsDescription
  where
  rnf :: VpcPeeringConnectionOptionsDescription -> ()
rnf VpcPeeringConnectionOptionsDescription' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:VpcPeeringConnectionOptionsDescription' :: VpcPeeringConnectionOptionsDescription -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowDnsResolutionFromRemoteVpc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink