{-# 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.ScheduledInstancesEbs
-- 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.ScheduledInstancesEbs 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

-- | Describes an EBS volume for a Scheduled Instance.
--
-- /See:/ 'newScheduledInstancesEbs' smart constructor.
data ScheduledInstancesEbs = ScheduledInstancesEbs'
  { -- | Indicates whether the volume is deleted on instance termination.
    ScheduledInstancesEbs -> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether the volume is encrypted. You can attached encrypted
    -- volumes only to instances that support them.
    ScheduledInstancesEbs -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | The number of I\/O operations per second (IOPS) to provision for an
    -- @io1@ or @io2@ volume, with a maximum ratio of 50 IOPS\/GiB for @io1@,
    -- and 500 IOPS\/GiB for @io2@. Range is 100 to 64,000 IOPS for volumes in
    -- most Regions. Maximum IOPS of 64,000 is guaranteed only on
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances instances built on the Nitro System>.
    -- Other instance families guarantee performance up to 32,000 IOPS. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS volume types>
    -- in the /Amazon EC2 User Guide/.
    --
    -- This parameter is valid only for Provisioned IOPS SSD (@io1@ and @io2@)
    -- volumes.
    ScheduledInstancesEbs -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
    -- | The ID of the snapshot.
    ScheduledInstancesEbs -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | The size of the volume, in GiB.
    --
    -- Default: If you\'re creating the volume from a snapshot and don\'t
    -- specify a volume size, the default is the snapshot size.
    ScheduledInstancesEbs -> Maybe Int
volumeSize :: Prelude.Maybe Prelude.Int,
    -- | The volume type. @gp2@ for General Purpose SSD, @io1@ or @ io2@ for
    -- Provisioned IOPS SSD, Throughput Optimized HDD for @st1@, Cold HDD for
    -- @sc1@, or @standard@ for Magnetic.
    --
    -- Default: @gp2@
    ScheduledInstancesEbs -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text
  }
  deriving (ScheduledInstancesEbs -> ScheduledInstancesEbs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduledInstancesEbs -> ScheduledInstancesEbs -> Bool
$c/= :: ScheduledInstancesEbs -> ScheduledInstancesEbs -> Bool
== :: ScheduledInstancesEbs -> ScheduledInstancesEbs -> Bool
$c== :: ScheduledInstancesEbs -> ScheduledInstancesEbs -> Bool
Prelude.Eq, ReadPrec [ScheduledInstancesEbs]
ReadPrec ScheduledInstancesEbs
Int -> ReadS ScheduledInstancesEbs
ReadS [ScheduledInstancesEbs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduledInstancesEbs]
$creadListPrec :: ReadPrec [ScheduledInstancesEbs]
readPrec :: ReadPrec ScheduledInstancesEbs
$creadPrec :: ReadPrec ScheduledInstancesEbs
readList :: ReadS [ScheduledInstancesEbs]
$creadList :: ReadS [ScheduledInstancesEbs]
readsPrec :: Int -> ReadS ScheduledInstancesEbs
$creadsPrec :: Int -> ReadS ScheduledInstancesEbs
Prelude.Read, Int -> ScheduledInstancesEbs -> ShowS
[ScheduledInstancesEbs] -> ShowS
ScheduledInstancesEbs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduledInstancesEbs] -> ShowS
$cshowList :: [ScheduledInstancesEbs] -> ShowS
show :: ScheduledInstancesEbs -> String
$cshow :: ScheduledInstancesEbs -> String
showsPrec :: Int -> ScheduledInstancesEbs -> ShowS
$cshowsPrec :: Int -> ScheduledInstancesEbs -> ShowS
Prelude.Show, forall x. Rep ScheduledInstancesEbs x -> ScheduledInstancesEbs
forall x. ScheduledInstancesEbs -> Rep ScheduledInstancesEbs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScheduledInstancesEbs x -> ScheduledInstancesEbs
$cfrom :: forall x. ScheduledInstancesEbs -> Rep ScheduledInstancesEbs x
Prelude.Generic)

-- |
-- Create a value of 'ScheduledInstancesEbs' 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', 'scheduledInstancesEbs_deleteOnTermination' - Indicates whether the volume is deleted on instance termination.
--
-- 'encrypted', 'scheduledInstancesEbs_encrypted' - Indicates whether the volume is encrypted. You can attached encrypted
-- volumes only to instances that support them.
--
-- 'iops', 'scheduledInstancesEbs_iops' - The number of I\/O operations per second (IOPS) to provision for an
-- @io1@ or @io2@ volume, with a maximum ratio of 50 IOPS\/GiB for @io1@,
-- and 500 IOPS\/GiB for @io2@. Range is 100 to 64,000 IOPS for volumes in
-- most Regions. Maximum IOPS of 64,000 is guaranteed only on
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances instances built on the Nitro System>.
-- Other instance families guarantee performance up to 32,000 IOPS. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS volume types>
-- in the /Amazon EC2 User Guide/.
--
-- This parameter is valid only for Provisioned IOPS SSD (@io1@ and @io2@)
-- volumes.
--
-- 'snapshotId', 'scheduledInstancesEbs_snapshotId' - The ID of the snapshot.
--
-- 'volumeSize', 'scheduledInstancesEbs_volumeSize' - The size of the volume, in GiB.
--
-- Default: If you\'re creating the volume from a snapshot and don\'t
-- specify a volume size, the default is the snapshot size.
--
-- 'volumeType', 'scheduledInstancesEbs_volumeType' - The volume type. @gp2@ for General Purpose SSD, @io1@ or @ io2@ for
-- Provisioned IOPS SSD, Throughput Optimized HDD for @st1@, Cold HDD for
-- @sc1@, or @standard@ for Magnetic.
--
-- Default: @gp2@
newScheduledInstancesEbs ::
  ScheduledInstancesEbs
newScheduledInstancesEbs :: ScheduledInstancesEbs
newScheduledInstancesEbs =
  ScheduledInstancesEbs'
    { $sel:deleteOnTermination:ScheduledInstancesEbs' :: Maybe Bool
deleteOnTermination =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:ScheduledInstancesEbs' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:iops:ScheduledInstancesEbs' :: Maybe Int
iops = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:ScheduledInstancesEbs' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:ScheduledInstancesEbs' :: Maybe Int
volumeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:ScheduledInstancesEbs' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the volume is deleted on instance termination.
scheduledInstancesEbs_deleteOnTermination :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Bool)
scheduledInstancesEbs_deleteOnTermination :: Lens' ScheduledInstancesEbs (Maybe Bool)
scheduledInstancesEbs_deleteOnTermination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Bool
a -> ScheduledInstancesEbs
s {$sel:deleteOnTermination:ScheduledInstancesEbs' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: ScheduledInstancesEbs)

-- | Indicates whether the volume is encrypted. You can attached encrypted
-- volumes only to instances that support them.
scheduledInstancesEbs_encrypted :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Bool)
scheduledInstancesEbs_encrypted :: Lens' ScheduledInstancesEbs (Maybe Bool)
scheduledInstancesEbs_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Bool
a -> ScheduledInstancesEbs
s {$sel:encrypted:ScheduledInstancesEbs' :: Maybe Bool
encrypted = Maybe Bool
a} :: ScheduledInstancesEbs)

-- | The number of I\/O operations per second (IOPS) to provision for an
-- @io1@ or @io2@ volume, with a maximum ratio of 50 IOPS\/GiB for @io1@,
-- and 500 IOPS\/GiB for @io2@. Range is 100 to 64,000 IOPS for volumes in
-- most Regions. Maximum IOPS of 64,000 is guaranteed only on
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances instances built on the Nitro System>.
-- Other instance families guarantee performance up to 32,000 IOPS. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS volume types>
-- in the /Amazon EC2 User Guide/.
--
-- This parameter is valid only for Provisioned IOPS SSD (@io1@ and @io2@)
-- volumes.
scheduledInstancesEbs_iops :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Int)
scheduledInstancesEbs_iops :: Lens' ScheduledInstancesEbs (Maybe Int)
scheduledInstancesEbs_iops = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Int
iops :: Maybe Int
$sel:iops:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
iops} -> Maybe Int
iops) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Int
a -> ScheduledInstancesEbs
s {$sel:iops:ScheduledInstancesEbs' :: Maybe Int
iops = Maybe Int
a} :: ScheduledInstancesEbs)

-- | The ID of the snapshot.
scheduledInstancesEbs_snapshotId :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Text)
scheduledInstancesEbs_snapshotId :: Lens' ScheduledInstancesEbs (Maybe Text)
scheduledInstancesEbs_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Text
a -> ScheduledInstancesEbs
s {$sel:snapshotId:ScheduledInstancesEbs' :: Maybe Text
snapshotId = Maybe Text
a} :: ScheduledInstancesEbs)

-- | The size of the volume, in GiB.
--
-- Default: If you\'re creating the volume from a snapshot and don\'t
-- specify a volume size, the default is the snapshot size.
scheduledInstancesEbs_volumeSize :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Int)
scheduledInstancesEbs_volumeSize :: Lens' ScheduledInstancesEbs (Maybe Int)
scheduledInstancesEbs_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Int
volumeSize :: Maybe Int
$sel:volumeSize:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
volumeSize} -> Maybe Int
volumeSize) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Int
a -> ScheduledInstancesEbs
s {$sel:volumeSize:ScheduledInstancesEbs' :: Maybe Int
volumeSize = Maybe Int
a} :: ScheduledInstancesEbs)

-- | The volume type. @gp2@ for General Purpose SSD, @io1@ or @ io2@ for
-- Provisioned IOPS SSD, Throughput Optimized HDD for @st1@, Cold HDD for
-- @sc1@, or @standard@ for Magnetic.
--
-- Default: @gp2@
scheduledInstancesEbs_volumeType :: Lens.Lens' ScheduledInstancesEbs (Prelude.Maybe Prelude.Text)
scheduledInstancesEbs_volumeType :: Lens' ScheduledInstancesEbs (Maybe Text)
scheduledInstancesEbs_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledInstancesEbs' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: ScheduledInstancesEbs
s@ScheduledInstancesEbs' {} Maybe Text
a -> ScheduledInstancesEbs
s {$sel:volumeType:ScheduledInstancesEbs' :: Maybe Text
volumeType = Maybe Text
a} :: ScheduledInstancesEbs)

instance Prelude.Hashable ScheduledInstancesEbs where
  hashWithSalt :: Int -> ScheduledInstancesEbs -> Int
hashWithSalt Int
_salt ScheduledInstancesEbs' {Maybe Bool
Maybe Int
Maybe Text
volumeType :: Maybe Text
volumeSize :: Maybe Int
snapshotId :: Maybe Text
iops :: Maybe Int
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:volumeSize:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:snapshotId:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:iops:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:encrypted:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
$sel:deleteOnTermination:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteOnTermination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
iops
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType

instance Prelude.NFData ScheduledInstancesEbs where
  rnf :: ScheduledInstancesEbs -> ()
rnf ScheduledInstancesEbs' {Maybe Bool
Maybe Int
Maybe Text
volumeType :: Maybe Text
volumeSize :: Maybe Int
snapshotId :: Maybe Text
iops :: Maybe Int
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:volumeSize:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:snapshotId:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:iops:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:encrypted:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
$sel:deleteOnTermination:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteOnTermination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
iops
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeType

instance Data.ToQuery ScheduledInstancesEbs where
  toQuery :: ScheduledInstancesEbs -> QueryString
toQuery ScheduledInstancesEbs' {Maybe Bool
Maybe Int
Maybe Text
volumeType :: Maybe Text
volumeSize :: Maybe Int
snapshotId :: Maybe Text
iops :: Maybe Int
encrypted :: Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:volumeType:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:volumeSize:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:snapshotId:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Text
$sel:iops:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Int
$sel:encrypted:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
$sel:deleteOnTermination:ScheduledInstancesEbs' :: ScheduledInstancesEbs -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"DeleteOnTermination" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
deleteOnTermination,
        ByteString
"Encrypted" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
encrypted,
        ByteString
"Iops" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
iops,
        ByteString
"SnapshotId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotId,
        ByteString
"VolumeSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
volumeSize,
        ByteString
"VolumeType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
volumeType
      ]