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

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

-- | Parameters that are used to automatically set up EBS volumes when an
-- instance is launched.
--
-- /See:/ 'newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' smart constructor.
data AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails = AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails'
  { -- | Whether to delete the volume when the instance is terminated.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
    -- | The volume size, in GiBs. The following are the supported volumes sizes
    -- for each volume type:
    --
    -- -   gp2 and gp3: 1-16,384
    --
    -- -   io1: 4-16,384
    --
    -- -   st1 and sc1: 125-16,384
    --
    -- -   standard: 1-1,024
    --
    -- You must specify either @SnapshotId@ or @VolumeSize@. If you specify
    -- both @SnapshotId@ and @VolumeSize@, the volume size must be equal or
    -- greater than the size of the snapshot.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
volumeSize :: Prelude.Maybe Prelude.Int,
    -- | The number of input\/output (I\/O) operations per second (IOPS) to
    -- provision for the volume.
    --
    -- Only supported for @gp3@ or @io1@ volumes. Required for @io1@ volumes.
    -- Not used with @standard@, @gp2@, @st1@, or @sc1@ volumes.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
    -- | Whether to encrypt the volume.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | The volume type.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
    -- | The snapshot ID of the volume to use.
    --
    -- You must specify either @VolumeSize@ or @SnapshotId@.
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Bool
(AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Bool)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Bool)
-> Eq
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Bool
$c/= :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Bool
== :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Bool
$c== :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
ReadS
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
(Int
 -> ReadS
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> ReadS
     [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
-> ReadPrec
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> ReadPrec
     [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
-> Read
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
$creadListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
readPrec :: ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
$creadPrec :: ReadPrec
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
readList :: ReadS
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
$creadList :: ReadS
  [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
readsPrec :: Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
$creadsPrec :: Int
-> ReadS
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
Prelude.Read, Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> ShowS
[AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
-> ShowS
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> String
(Int
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> ShowS)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> String)
-> ([AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
    -> ShowS)
-> Show
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
-> ShowS
$cshowList :: [AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails]
-> ShowS
show :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> String
$cshow :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> String
showsPrec :: Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> ShowS
$cshowsPrec :: Int
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> ShowS
Prelude.Show, (forall x.
 AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Rep
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x)
-> (forall x.
    Rep
      AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Generic
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall x.
Rep
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall x.
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Rep
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
$cfrom :: forall x.
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Rep
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' 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:
--
-- 'deleteOnTermination', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_deleteOnTermination' - Whether to delete the volume when the instance is terminated.
--
-- 'volumeSize', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeSize' - The volume size, in GiBs. The following are the supported volumes sizes
-- for each volume type:
--
-- -   gp2 and gp3: 1-16,384
--
-- -   io1: 4-16,384
--
-- -   st1 and sc1: 125-16,384
--
-- -   standard: 1-1,024
--
-- You must specify either @SnapshotId@ or @VolumeSize@. If you specify
-- both @SnapshotId@ and @VolumeSize@, the volume size must be equal or
-- greater than the size of the snapshot.
--
-- 'iops', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_iops' - The number of input\/output (I\/O) operations per second (IOPS) to
-- provision for the volume.
--
-- Only supported for @gp3@ or @io1@ volumes. Required for @io1@ volumes.
-- Not used with @standard@, @gp2@, @st1@, or @sc1@ volumes.
--
-- 'encrypted', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_encrypted' - Whether to encrypt the volume.
--
-- 'volumeType', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeType' - The volume type.
--
-- 'snapshotId', 'awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_snapshotId' - The snapshot ID of the volume to use.
--
-- You must specify either @VolumeSize@ or @SnapshotId@.
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails ::
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
newAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails =
  AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails'
    { $sel:deleteOnTermination:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Bool
deleteOnTermination =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Int
volumeSize =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:iops:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Int
iops =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Bool
encrypted =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Text
volumeType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Text
snapshotId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether to delete the volume when the instance is terminated.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_deleteOnTermination :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Bool)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_deleteOnTermination :: (Maybe Bool -> f (Maybe Bool))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_deleteOnTermination = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Bool)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Bool
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Bool
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:deleteOnTermination:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

-- | The volume size, in GiBs. The following are the supported volumes sizes
-- for each volume type:
--
-- -   gp2 and gp3: 1-16,384
--
-- -   io1: 4-16,384
--
-- -   st1 and sc1: 125-16,384
--
-- -   standard: 1-1,024
--
-- You must specify either @SnapshotId@ or @VolumeSize@. If you specify
-- both @SnapshotId@ and @VolumeSize@, the volume size must be equal or
-- greater than the size of the snapshot.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeSize :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Int)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeSize :: (Maybe Int -> f (Maybe Int))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeSize = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Int)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Int
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Int
volumeSize :: Maybe Int
$sel:volumeSize:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
volumeSize} -> Maybe Int
volumeSize) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Int
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:volumeSize:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Int
volumeSize = Maybe Int
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

-- | The number of input\/output (I\/O) operations per second (IOPS) to
-- provision for the volume.
--
-- Only supported for @gp3@ or @io1@ volumes. Required for @io1@ volumes.
-- Not used with @standard@, @gp2@, @st1@, or @sc1@ volumes.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_iops :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Int)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_iops :: (Maybe Int -> f (Maybe Int))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_iops = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Int)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Int
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Int
iops :: Maybe Int
$sel:iops:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
iops} -> Maybe Int
iops) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Int
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:iops:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Int
iops = Maybe Int
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

-- | Whether to encrypt the volume.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_encrypted :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Bool)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_encrypted :: (Maybe Bool -> f (Maybe Bool))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_encrypted = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Bool)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Bool
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Bool
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:encrypted:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Bool
encrypted = Maybe Bool
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

-- | The volume type.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeType :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Text)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeType :: (Maybe Text -> f (Maybe Text))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_volumeType = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Text)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Text
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Text
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:volumeType:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Text
volumeType = Maybe Text
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

-- | The snapshot ID of the volume to use.
--
-- You must specify either @VolumeSize@ or @SnapshotId@.
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_snapshotId :: Lens.Lens' AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails (Prelude.Maybe Prelude.Text)
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_snapshotId :: (Maybe Text -> f (Maybe Text))
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> f AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
awsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails_snapshotId = (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
 -> Maybe Text)
-> (AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
    -> Maybe Text
    -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s@AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {} Maybe Text
a -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
s {$sel:snapshotId:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: Maybe Text
snapshotId = Maybe Text
a} :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)

instance
  Core.FromJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
  where
  parseJSON :: Value
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Value
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails'
            (Maybe Bool
 -> Maybe Int
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeleteOnTermination")
              Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeSize")
              Parser
  (Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Iops")
              Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Encrypted")
              Parser
  (Maybe Text
   -> Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
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
"VolumeType")
              Parser
  (Maybe Text
   -> AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails)
-> Parser (Maybe Text)
-> Parser
     AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
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
"SnapshotId")
      )

instance
  Prelude.Hashable
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails

instance
  Prelude.NFData
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails

instance
  Core.ToJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
  where
  toJSON :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Value
toJSON
    AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' {Maybe Bool
Maybe Int
Maybe Text
snapshotId :: Maybe Text
volumeType :: Maybe Text
encrypted :: Maybe Bool
iops :: Maybe Int
volumeSize :: Maybe Int
deleteOnTermination :: Maybe Bool
$sel:snapshotId:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
$sel:volumeType:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Text
$sel:encrypted:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
$sel:iops:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
$sel:volumeSize:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Int
$sel:deleteOnTermination:AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails' :: AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails
-> Maybe Bool
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"DeleteOnTermination" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteOnTermination,
              (Text
"VolumeSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
volumeSize,
              (Text
"Iops" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
iops,
              (Text
"Encrypted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encrypted,
              (Text
"VolumeType" 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
volumeType,
              (Text
"SnapshotId" 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
snapshotId
            ]
        )