{-# 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.AwsEc2InstanceDetails
-- 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.AwsEc2InstanceDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsEc2InstanceNetworkInterfacesDetails

-- | The details of an EC2 instance.
--
-- /See:/ 'newAwsEc2InstanceDetails' smart constructor.
data AwsEc2InstanceDetails = AwsEc2InstanceDetails'
  { -- | The IAM profile ARN of the instance.
    AwsEc2InstanceDetails -> Maybe Text
iamInstanceProfileArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the VPC that the instance was launched in.
    AwsEc2InstanceDetails -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The key name associated with the instance.
    AwsEc2InstanceDetails -> Maybe Text
keyName :: Prelude.Maybe Prelude.Text,
    -- | The identifiers of the network interfaces for the EC2 instance. The
    -- details for each network interface are in a corresponding
    -- @AwsEc2NetworkInterfacesDetails@ object.
    AwsEc2InstanceDetails
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces :: Prelude.Maybe [AwsEc2InstanceNetworkInterfacesDetails],
    -- | The IPv4 addresses associated with the instance.
    AwsEc2InstanceDetails -> Maybe [Text]
ipV4Addresses :: Prelude.Maybe [Prelude.Text],
    -- | The identifier of the subnet that the instance was launched in.
    AwsEc2InstanceDetails -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Machine Image (AMI) ID of the instance.
    AwsEc2InstanceDetails -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | The instance type of the instance.
    AwsEc2InstanceDetails -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The IPv6 addresses associated with the instance.
    AwsEc2InstanceDetails -> Maybe [Text]
ipV6Addresses :: Prelude.Maybe [Prelude.Text],
    -- | Indicates when the instance was launched.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsEc2InstanceDetails -> Maybe Text
launchedAt :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool
(AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool)
-> (AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool)
-> Eq AwsEc2InstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool
$c/= :: AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool
== :: AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool
$c== :: AwsEc2InstanceDetails -> AwsEc2InstanceDetails -> Bool
Prelude.Eq, ReadPrec [AwsEc2InstanceDetails]
ReadPrec AwsEc2InstanceDetails
Int -> ReadS AwsEc2InstanceDetails
ReadS [AwsEc2InstanceDetails]
(Int -> ReadS AwsEc2InstanceDetails)
-> ReadS [AwsEc2InstanceDetails]
-> ReadPrec AwsEc2InstanceDetails
-> ReadPrec [AwsEc2InstanceDetails]
-> Read AwsEc2InstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2InstanceDetails]
$creadListPrec :: ReadPrec [AwsEc2InstanceDetails]
readPrec :: ReadPrec AwsEc2InstanceDetails
$creadPrec :: ReadPrec AwsEc2InstanceDetails
readList :: ReadS [AwsEc2InstanceDetails]
$creadList :: ReadS [AwsEc2InstanceDetails]
readsPrec :: Int -> ReadS AwsEc2InstanceDetails
$creadsPrec :: Int -> ReadS AwsEc2InstanceDetails
Prelude.Read, Int -> AwsEc2InstanceDetails -> ShowS
[AwsEc2InstanceDetails] -> ShowS
AwsEc2InstanceDetails -> String
(Int -> AwsEc2InstanceDetails -> ShowS)
-> (AwsEc2InstanceDetails -> String)
-> ([AwsEc2InstanceDetails] -> ShowS)
-> Show AwsEc2InstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2InstanceDetails] -> ShowS
$cshowList :: [AwsEc2InstanceDetails] -> ShowS
show :: AwsEc2InstanceDetails -> String
$cshow :: AwsEc2InstanceDetails -> String
showsPrec :: Int -> AwsEc2InstanceDetails -> ShowS
$cshowsPrec :: Int -> AwsEc2InstanceDetails -> ShowS
Prelude.Show, (forall x. AwsEc2InstanceDetails -> Rep AwsEc2InstanceDetails x)
-> (forall x. Rep AwsEc2InstanceDetails x -> AwsEc2InstanceDetails)
-> Generic AwsEc2InstanceDetails
forall x. Rep AwsEc2InstanceDetails x -> AwsEc2InstanceDetails
forall x. AwsEc2InstanceDetails -> Rep AwsEc2InstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsEc2InstanceDetails x -> AwsEc2InstanceDetails
$cfrom :: forall x. AwsEc2InstanceDetails -> Rep AwsEc2InstanceDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2InstanceDetails' 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:
--
-- 'iamInstanceProfileArn', 'awsEc2InstanceDetails_iamInstanceProfileArn' - The IAM profile ARN of the instance.
--
-- 'vpcId', 'awsEc2InstanceDetails_vpcId' - The identifier of the VPC that the instance was launched in.
--
-- 'keyName', 'awsEc2InstanceDetails_keyName' - The key name associated with the instance.
--
-- 'networkInterfaces', 'awsEc2InstanceDetails_networkInterfaces' - The identifiers of the network interfaces for the EC2 instance. The
-- details for each network interface are in a corresponding
-- @AwsEc2NetworkInterfacesDetails@ object.
--
-- 'ipV4Addresses', 'awsEc2InstanceDetails_ipV4Addresses' - The IPv4 addresses associated with the instance.
--
-- 'subnetId', 'awsEc2InstanceDetails_subnetId' - The identifier of the subnet that the instance was launched in.
--
-- 'imageId', 'awsEc2InstanceDetails_imageId' - The Amazon Machine Image (AMI) ID of the instance.
--
-- 'type'', 'awsEc2InstanceDetails_type' - The instance type of the instance.
--
-- 'ipV6Addresses', 'awsEc2InstanceDetails_ipV6Addresses' - The IPv6 addresses associated with the instance.
--
-- 'launchedAt', 'awsEc2InstanceDetails_launchedAt' - Indicates when the instance was launched.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
newAwsEc2InstanceDetails ::
  AwsEc2InstanceDetails
newAwsEc2InstanceDetails :: AwsEc2InstanceDetails
newAwsEc2InstanceDetails =
  AwsEc2InstanceDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> AwsEc2InstanceDetails
AwsEc2InstanceDetails'
    { $sel:iamInstanceProfileArn:AwsEc2InstanceDetails' :: Maybe Text
iamInstanceProfileArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:AwsEc2InstanceDetails' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keyName:AwsEc2InstanceDetails' :: Maybe Text
keyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:AwsEc2InstanceDetails' :: Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces = Maybe [AwsEc2InstanceNetworkInterfacesDetails]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipV4Addresses:AwsEc2InstanceDetails' :: Maybe [Text]
ipV4Addresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:AwsEc2InstanceDetails' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageId:AwsEc2InstanceDetails' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AwsEc2InstanceDetails' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipV6Addresses:AwsEc2InstanceDetails' :: Maybe [Text]
ipV6Addresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:launchedAt:AwsEc2InstanceDetails' :: Maybe Text
launchedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The IAM profile ARN of the instance.
awsEc2InstanceDetails_iamInstanceProfileArn :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_iamInstanceProfileArn :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_iamInstanceProfileArn = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
iamInstanceProfileArn :: Maybe Text
$sel:iamInstanceProfileArn:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
iamInstanceProfileArn} -> Maybe Text
iamInstanceProfileArn) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:iamInstanceProfileArn:AwsEc2InstanceDetails' :: Maybe Text
iamInstanceProfileArn = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The identifier of the VPC that the instance was launched in.
awsEc2InstanceDetails_vpcId :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_vpcId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_vpcId = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:vpcId:AwsEc2InstanceDetails' :: Maybe Text
vpcId = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The key name associated with the instance.
awsEc2InstanceDetails_keyName :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_keyName :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_keyName = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
keyName :: Maybe Text
$sel:keyName:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
keyName} -> Maybe Text
keyName) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:keyName:AwsEc2InstanceDetails' :: Maybe Text
keyName = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The identifiers of the network interfaces for the EC2 instance. The
-- details for each network interface are in a corresponding
-- @AwsEc2NetworkInterfacesDetails@ object.
awsEc2InstanceDetails_networkInterfaces :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe [AwsEc2InstanceNetworkInterfacesDetails])
awsEc2InstanceDetails_networkInterfaces :: (Maybe [AwsEc2InstanceNetworkInterfacesDetails]
 -> f (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_networkInterfaces = (AwsEc2InstanceDetails
 -> Maybe [AwsEc2InstanceNetworkInterfacesDetails])
-> (AwsEc2InstanceDetails
    -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
    -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces :: Maybe [AwsEc2InstanceNetworkInterfacesDetails]
$sel:networkInterfaces:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces} -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe [AwsEc2InstanceNetworkInterfacesDetails]
a -> AwsEc2InstanceDetails
s {$sel:networkInterfaces:AwsEc2InstanceDetails' :: Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces = Maybe [AwsEc2InstanceNetworkInterfacesDetails]
a} :: AwsEc2InstanceDetails) ((Maybe [AwsEc2InstanceNetworkInterfacesDetails]
  -> f (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
 -> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails)
-> ((Maybe [AwsEc2InstanceNetworkInterfacesDetails]
     -> f (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
    -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
    -> f (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
-> (Maybe [AwsEc2InstanceNetworkInterfacesDetails]
    -> f (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
-> AwsEc2InstanceDetails
-> f AwsEc2InstanceDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
-> Iso
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
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
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
  [AwsEc2InstanceNetworkInterfacesDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IPv4 addresses associated with the instance.
awsEc2InstanceDetails_ipV4Addresses :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe [Prelude.Text])
awsEc2InstanceDetails_ipV4Addresses :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_ipV4Addresses = (AwsEc2InstanceDetails -> Maybe [Text])
-> (AwsEc2InstanceDetails -> Maybe [Text] -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe [Text]
ipV4Addresses :: Maybe [Text]
$sel:ipV4Addresses:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe [Text]
ipV4Addresses} -> Maybe [Text]
ipV4Addresses) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe [Text]
a -> AwsEc2InstanceDetails
s {$sel:ipV4Addresses:AwsEc2InstanceDetails' :: Maybe [Text]
ipV4Addresses = Maybe [Text]
a} :: AwsEc2InstanceDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEc2InstanceDetails
-> f AwsEc2InstanceDetails
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 identifier of the subnet that the instance was launched in.
awsEc2InstanceDetails_subnetId :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_subnetId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_subnetId = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:subnetId:AwsEc2InstanceDetails' :: Maybe Text
subnetId = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The Amazon Machine Image (AMI) ID of the instance.
awsEc2InstanceDetails_imageId :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_imageId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_imageId = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
imageId :: Maybe Text
$sel:imageId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:imageId:AwsEc2InstanceDetails' :: Maybe Text
imageId = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The instance type of the instance.
awsEc2InstanceDetails_type :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_type :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_type = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
type' :: Maybe Text
$sel:type':AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:type':AwsEc2InstanceDetails' :: Maybe Text
type' = Maybe Text
a} :: AwsEc2InstanceDetails)

-- | The IPv6 addresses associated with the instance.
awsEc2InstanceDetails_ipV6Addresses :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe [Prelude.Text])
awsEc2InstanceDetails_ipV6Addresses :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_ipV6Addresses = (AwsEc2InstanceDetails -> Maybe [Text])
-> (AwsEc2InstanceDetails -> Maybe [Text] -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe [Text]
ipV6Addresses :: Maybe [Text]
$sel:ipV6Addresses:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe [Text]
ipV6Addresses} -> Maybe [Text]
ipV6Addresses) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe [Text]
a -> AwsEc2InstanceDetails
s {$sel:ipV6Addresses:AwsEc2InstanceDetails' :: Maybe [Text]
ipV6Addresses = Maybe [Text]
a} :: AwsEc2InstanceDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEc2InstanceDetails
-> f AwsEc2InstanceDetails
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

-- | Indicates when the instance was launched.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsEc2InstanceDetails_launchedAt :: Lens.Lens' AwsEc2InstanceDetails (Prelude.Maybe Prelude.Text)
awsEc2InstanceDetails_launchedAt :: (Maybe Text -> f (Maybe Text))
-> AwsEc2InstanceDetails -> f AwsEc2InstanceDetails
awsEc2InstanceDetails_launchedAt = (AwsEc2InstanceDetails -> Maybe Text)
-> (AwsEc2InstanceDetails -> Maybe Text -> AwsEc2InstanceDetails)
-> Lens
     AwsEc2InstanceDetails
     AwsEc2InstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2InstanceDetails' {Maybe Text
launchedAt :: Maybe Text
$sel:launchedAt:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
launchedAt} -> Maybe Text
launchedAt) (\s :: AwsEc2InstanceDetails
s@AwsEc2InstanceDetails' {} Maybe Text
a -> AwsEc2InstanceDetails
s {$sel:launchedAt:AwsEc2InstanceDetails' :: Maybe Text
launchedAt = Maybe Text
a} :: AwsEc2InstanceDetails)

instance Core.FromJSON AwsEc2InstanceDetails where
  parseJSON :: Value -> Parser AwsEc2InstanceDetails
parseJSON =
    String
-> (Object -> Parser AwsEc2InstanceDetails)
-> Value
-> Parser AwsEc2InstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2InstanceDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> AwsEc2InstanceDetails
AwsEc2InstanceDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
forall (f :: * -> *) a b. Functor 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
"IamInstanceProfileArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
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
"VpcId")
            Parser
  (Maybe Text
   -> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsEc2InstanceNetworkInterfacesDetails]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
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
"KeyName")
            Parser
  (Maybe [AwsEc2InstanceNetworkInterfacesDetails]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NetworkInterfaces"
                            Parser (Maybe (Maybe [AwsEc2InstanceNetworkInterfacesDetails]))
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
-> Parser (Maybe [AwsEc2InstanceNetworkInterfacesDetails])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsEc2InstanceNetworkInterfacesDetails]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
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
"IpV4Addresses" 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
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> AwsEc2InstanceDetails)
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
"SubnetId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe [Text] -> Maybe Text -> AwsEc2InstanceDetails)
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
"ImageId")
            Parser
  (Maybe Text -> Maybe [Text] -> Maybe Text -> AwsEc2InstanceDetails)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> AwsEc2InstanceDetails)
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
"Type")
            Parser (Maybe [Text] -> Maybe Text -> AwsEc2InstanceDetails)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> AwsEc2InstanceDetails)
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
"IpV6Addresses" 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 -> AwsEc2InstanceDetails)
-> Parser (Maybe Text) -> Parser AwsEc2InstanceDetails
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
"LaunchedAt")
      )

instance Prelude.Hashable AwsEc2InstanceDetails

instance Prelude.NFData AwsEc2InstanceDetails

instance Core.ToJSON AwsEc2InstanceDetails where
  toJSON :: AwsEc2InstanceDetails -> Value
toJSON AwsEc2InstanceDetails' {Maybe [Text]
Maybe [AwsEc2InstanceNetworkInterfacesDetails]
Maybe Text
launchedAt :: Maybe Text
ipV6Addresses :: Maybe [Text]
type' :: Maybe Text
imageId :: Maybe Text
subnetId :: Maybe Text
ipV4Addresses :: Maybe [Text]
networkInterfaces :: Maybe [AwsEc2InstanceNetworkInterfacesDetails]
keyName :: Maybe Text
vpcId :: Maybe Text
iamInstanceProfileArn :: Maybe Text
$sel:launchedAt:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:ipV6Addresses:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe [Text]
$sel:type':AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:imageId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:subnetId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:ipV4Addresses:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe [Text]
$sel:networkInterfaces:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
$sel:keyName:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:vpcId:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
$sel:iamInstanceProfileArn:AwsEc2InstanceDetails' :: AwsEc2InstanceDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IamInstanceProfileArn" 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
iamInstanceProfileArn,
            (Text
"VpcId" 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
vpcId,
            (Text
"KeyName" 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
keyName,
            (Text
"NetworkInterfaces" Text -> [AwsEc2InstanceNetworkInterfacesDetails] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsEc2InstanceNetworkInterfacesDetails] -> Pair)
-> Maybe [AwsEc2InstanceNetworkInterfacesDetails] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsEc2InstanceNetworkInterfacesDetails]
networkInterfaces,
            (Text
"IpV4Addresses" 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]
ipV4Addresses,
            (Text
"SubnetId" 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
subnetId,
            (Text
"ImageId" 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
imageId,
            (Text
"Type" 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
type',
            (Text
"IpV6Addresses" 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]
ipV6Addresses,
            (Text
"LaunchedAt" 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
launchedAt
          ]
      )