{-# 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.PeeringConnectionOptionsRequest
-- 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.PeeringConnectionOptionsRequest 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/.
--
-- The VPC peering connection options.
--
-- /See:/ 'newPeeringConnectionOptionsRequest' smart constructor.
data PeeringConnectionOptionsRequest = PeeringConnectionOptionsRequest'
  { -- | If true, enables a local VPC to resolve public DNS hostnames to private
    -- IP addresses when queried from instances in the peer VPC.
    PeeringConnectionOptionsRequest -> Maybe Bool
allowDnsResolutionFromRemoteVpc :: Prelude.Maybe Prelude.Bool,
    -- | If true, enables outbound communication from an EC2-Classic instance
    -- that\'s linked to a local VPC using ClassicLink to instances in a peer
    -- VPC.
    PeeringConnectionOptionsRequest -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Prelude.Maybe Prelude.Bool,
    -- | If true, enables outbound communication from instances in a local VPC to
    -- an EC2-Classic instance that\'s linked to a peer VPC using ClassicLink.
    PeeringConnectionOptionsRequest -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Prelude.Maybe Prelude.Bool
  }
  deriving (PeeringConnectionOptionsRequest
-> PeeringConnectionOptionsRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PeeringConnectionOptionsRequest
-> PeeringConnectionOptionsRequest -> Bool
$c/= :: PeeringConnectionOptionsRequest
-> PeeringConnectionOptionsRequest -> Bool
== :: PeeringConnectionOptionsRequest
-> PeeringConnectionOptionsRequest -> Bool
$c== :: PeeringConnectionOptionsRequest
-> PeeringConnectionOptionsRequest -> Bool
Prelude.Eq, ReadPrec [PeeringConnectionOptionsRequest]
ReadPrec PeeringConnectionOptionsRequest
Int -> ReadS PeeringConnectionOptionsRequest
ReadS [PeeringConnectionOptionsRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PeeringConnectionOptionsRequest]
$creadListPrec :: ReadPrec [PeeringConnectionOptionsRequest]
readPrec :: ReadPrec PeeringConnectionOptionsRequest
$creadPrec :: ReadPrec PeeringConnectionOptionsRequest
readList :: ReadS [PeeringConnectionOptionsRequest]
$creadList :: ReadS [PeeringConnectionOptionsRequest]
readsPrec :: Int -> ReadS PeeringConnectionOptionsRequest
$creadsPrec :: Int -> ReadS PeeringConnectionOptionsRequest
Prelude.Read, Int -> PeeringConnectionOptionsRequest -> ShowS
[PeeringConnectionOptionsRequest] -> ShowS
PeeringConnectionOptionsRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PeeringConnectionOptionsRequest] -> ShowS
$cshowList :: [PeeringConnectionOptionsRequest] -> ShowS
show :: PeeringConnectionOptionsRequest -> String
$cshow :: PeeringConnectionOptionsRequest -> String
showsPrec :: Int -> PeeringConnectionOptionsRequest -> ShowS
$cshowsPrec :: Int -> PeeringConnectionOptionsRequest -> ShowS
Prelude.Show, forall x.
Rep PeeringConnectionOptionsRequest x
-> PeeringConnectionOptionsRequest
forall x.
PeeringConnectionOptionsRequest
-> Rep PeeringConnectionOptionsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PeeringConnectionOptionsRequest x
-> PeeringConnectionOptionsRequest
$cfrom :: forall x.
PeeringConnectionOptionsRequest
-> Rep PeeringConnectionOptionsRequest x
Prelude.Generic)

-- |
-- Create a value of 'PeeringConnectionOptionsRequest' 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', 'peeringConnectionOptionsRequest_allowDnsResolutionFromRemoteVpc' - If true, enables a local VPC to resolve public DNS hostnames to private
-- IP addresses when queried from instances in the peer VPC.
--
-- 'allowEgressFromLocalClassicLinkToRemoteVpc', 'peeringConnectionOptionsRequest_allowEgressFromLocalClassicLinkToRemoteVpc' - If true, enables outbound communication from an EC2-Classic instance
-- that\'s linked to a local VPC using ClassicLink to instances in a peer
-- VPC.
--
-- 'allowEgressFromLocalVpcToRemoteClassicLink', 'peeringConnectionOptionsRequest_allowEgressFromLocalVpcToRemoteClassicLink' - If true, enables outbound communication from instances in a local VPC to
-- an EC2-Classic instance that\'s linked to a peer VPC using ClassicLink.
newPeeringConnectionOptionsRequest ::
  PeeringConnectionOptionsRequest
newPeeringConnectionOptionsRequest :: PeeringConnectionOptionsRequest
newPeeringConnectionOptionsRequest =
  PeeringConnectionOptionsRequest'
    { $sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: Maybe Bool
allowDnsResolutionFromRemoteVpc =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc =
        forall a. Maybe a
Prelude.Nothing,
      $sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink =
        forall a. Maybe a
Prelude.Nothing
    }

-- | If true, enables a local VPC to resolve public DNS hostnames to private
-- IP addresses when queried from instances in the peer VPC.
peeringConnectionOptionsRequest_allowDnsResolutionFromRemoteVpc :: Lens.Lens' PeeringConnectionOptionsRequest (Prelude.Maybe Prelude.Bool)
peeringConnectionOptionsRequest_allowDnsResolutionFromRemoteVpc :: Lens' PeeringConnectionOptionsRequest (Maybe Bool)
peeringConnectionOptionsRequest_allowDnsResolutionFromRemoteVpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PeeringConnectionOptionsRequest' {Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
allowDnsResolutionFromRemoteVpc} -> Maybe Bool
allowDnsResolutionFromRemoteVpc) (\s :: PeeringConnectionOptionsRequest
s@PeeringConnectionOptionsRequest' {} Maybe Bool
a -> PeeringConnectionOptionsRequest
s {$sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: Maybe Bool
allowDnsResolutionFromRemoteVpc = Maybe Bool
a} :: PeeringConnectionOptionsRequest)

-- | If true, enables outbound communication from an EC2-Classic instance
-- that\'s linked to a local VPC using ClassicLink to instances in a peer
-- VPC.
peeringConnectionOptionsRequest_allowEgressFromLocalClassicLinkToRemoteVpc :: Lens.Lens' PeeringConnectionOptionsRequest (Prelude.Maybe Prelude.Bool)
peeringConnectionOptionsRequest_allowEgressFromLocalClassicLinkToRemoteVpc :: Lens' PeeringConnectionOptionsRequest (Maybe Bool)
peeringConnectionOptionsRequest_allowEgressFromLocalClassicLinkToRemoteVpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PeeringConnectionOptionsRequest' {Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc} -> Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc) (\s :: PeeringConnectionOptionsRequest
s@PeeringConnectionOptionsRequest' {} Maybe Bool
a -> PeeringConnectionOptionsRequest
s {$sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc = Maybe Bool
a} :: PeeringConnectionOptionsRequest)

-- | If true, enables outbound communication from instances in a local VPC to
-- an EC2-Classic instance that\'s linked to a peer VPC using ClassicLink.
peeringConnectionOptionsRequest_allowEgressFromLocalVpcToRemoteClassicLink :: Lens.Lens' PeeringConnectionOptionsRequest (Prelude.Maybe Prelude.Bool)
peeringConnectionOptionsRequest_allowEgressFromLocalVpcToRemoteClassicLink :: Lens' PeeringConnectionOptionsRequest (Maybe Bool)
peeringConnectionOptionsRequest_allowEgressFromLocalVpcToRemoteClassicLink = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PeeringConnectionOptionsRequest' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink} -> Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink) (\s :: PeeringConnectionOptionsRequest
s@PeeringConnectionOptionsRequest' {} Maybe Bool
a -> PeeringConnectionOptionsRequest
s {$sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink = Maybe Bool
a} :: PeeringConnectionOptionsRequest)

instance
  Prelude.Hashable
    PeeringConnectionOptionsRequest
  where
  hashWithSalt :: Int -> PeeringConnectionOptionsRequest -> Int
hashWithSalt
    Int
_salt
    PeeringConnectionOptionsRequest' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> 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
    PeeringConnectionOptionsRequest
  where
  rnf :: PeeringConnectionOptionsRequest -> ()
rnf PeeringConnectionOptionsRequest' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> 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

instance Data.ToQuery PeeringConnectionOptionsRequest where
  toQuery :: PeeringConnectionOptionsRequest -> QueryString
toQuery PeeringConnectionOptionsRequest' {Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink :: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc :: Maybe Bool
allowDnsResolutionFromRemoteVpc :: Maybe Bool
$sel:allowEgressFromLocalVpcToRemoteClassicLink:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowEgressFromLocalClassicLinkToRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
$sel:allowDnsResolutionFromRemoteVpc:PeeringConnectionOptionsRequest' :: PeeringConnectionOptionsRequest -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"AllowDnsResolutionFromRemoteVpc"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
allowDnsResolutionFromRemoteVpc,
        ByteString
"AllowEgressFromLocalClassicLinkToRemoteVpc"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
allowEgressFromLocalClassicLinkToRemoteVpc,
        ByteString
"AllowEgressFromLocalVpcToRemoteClassicLink"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
allowEgressFromLocalVpcToRemoteClassicLink
      ]