{-# 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.SecurityHub.Types.AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-- 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.SecurityHub.Types.AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | For tasks that use the @awsvpc@ networking mode, the VPC subnet and
-- security group configuration.
--
-- /See:/ 'newAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' smart constructor.
data AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails = AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails'
  { -- | The IDs of the security groups associated with the task or service.
    --
    -- You can provide up to five security groups.
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The IDs of the subnets associated with the task or service.
    --
    -- You can provide up to 16 subnets.
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
    -- | Whether the task\'s elastic network interface receives a public IP
    -- address. The default value is @DISABLED@.
    --
    -- Valid values: @ENABLED@ | @DISABLED@
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe Text
assignPublicIp :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Bool
(AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> Bool)
-> (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> Bool)
-> Eq AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Bool
$c/= :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Bool
== :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Bool
$c== :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
ReadPrec
  AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
Int
-> ReadS
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
ReadS [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
(Int
 -> ReadS
      AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> ReadS
     [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
-> ReadPrec
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> ReadPrec
     [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
-> Read AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
$creadListPrec :: ReadPrec
  [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
readPrec :: ReadPrec
  AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
$creadPrec :: ReadPrec
  AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
readList :: ReadS [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
$creadList :: ReadS [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
readsPrec :: Int
-> ReadS
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
$creadsPrec :: Int
-> ReadS
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
Prelude.Read, Int
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> ShowS
[AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
-> ShowS
AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> String
(Int
 -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> ShowS)
-> (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> String)
-> ([AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
    -> ShowS)
-> Show AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
-> ShowS
$cshowList :: [AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails]
-> ShowS
show :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> String
$cshow :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> String
showsPrec :: Int
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> Rep
      AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x)
-> (forall x.
    Rep AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x
    -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Generic
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall x.
Rep AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall x.
AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Rep
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
$cfrom :: forall x.
AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Rep
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' 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:
--
-- 'securityGroups', 'awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_securityGroups' - The IDs of the security groups associated with the task or service.
--
-- You can provide up to five security groups.
--
-- 'subnets', 'awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_subnets' - The IDs of the subnets associated with the task or service.
--
-- You can provide up to 16 subnets.
--
-- 'assignPublicIp', 'awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_assignPublicIp' - Whether the task\'s elastic network interface receives a public IP
-- address. The default value is @DISABLED@.
--
-- Valid values: @ENABLED@ | @DISABLED@
newAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails ::
  AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
newAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
newAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails =
  AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails'
    { $sel:securityGroups:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe [Text]
securityGroups =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe [Text]
subnets =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:assignPublicIp:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe Text
assignPublicIp =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The IDs of the security groups associated with the task or service.
--
-- You can provide up to five security groups.
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_securityGroups :: Lens.Lens' AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails (Prelude.Maybe [Prelude.Text])
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_securityGroups = (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> Maybe [Text])
-> (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> Maybe [Text]
    -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Lens
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s@AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {} Maybe [Text]
a -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s {$sel:securityGroups:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
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 IDs of the subnets associated with the task or service.
--
-- You can provide up to 16 subnets.
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_subnets :: Lens.Lens' AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails (Prelude.Maybe [Prelude.Text])
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_subnets :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_subnets = (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> Maybe [Text])
-> (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> Maybe [Text]
    -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Lens
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s@AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {} Maybe [Text]
a -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s {$sel:subnets:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe [Text]
subnets = Maybe [Text]
a} :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
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

-- | Whether the task\'s elastic network interface receives a public IP
-- address. The default value is @DISABLED@.
--
-- Valid values: @ENABLED@ | @DISABLED@
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_assignPublicIp :: Lens.Lens' AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails (Prelude.Maybe Prelude.Text)
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_assignPublicIp :: (Maybe Text -> f (Maybe Text))
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> f AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
awsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails_assignPublicIp = (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
 -> Maybe Text)
-> (AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
    -> Maybe Text
    -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Lens
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {Maybe Text
assignPublicIp :: Maybe Text
$sel:assignPublicIp:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe Text
assignPublicIp} -> Maybe Text
assignPublicIp) (\s :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s@AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {} Maybe Text
a -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
s {$sel:assignPublicIp:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: Maybe Text
assignPublicIp = Maybe Text
a} :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)

instance
  Core.FromJSON
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
  where
  parseJSON :: Value
-> Parser
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Value
-> Parser
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails'
            (Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroups" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
              Parser
  (Maybe [Text]
   -> Maybe Text
   -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Subnets" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
              Parser
  (Maybe Text
   -> AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails)
-> Parser (Maybe Text)
-> Parser
     AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssignPublicIp")
      )

instance
  Prelude.Hashable
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails

instance
  Prelude.NFData
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails

instance
  Core.ToJSON
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
  where
  toJSON :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Value
toJSON
    AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' {Maybe [Text]
Maybe Text
assignPublicIp :: Maybe Text
subnets :: Maybe [Text]
securityGroups :: Maybe [Text]
$sel:assignPublicIp:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe Text
$sel:subnets:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
$sel:securityGroups:AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails' :: AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails
-> Maybe [Text]
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"SecurityGroups" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroups,
              (Text
"Subnets" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnets,
              (Text
"AssignPublicIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
assignPublicIp
            ]
        )