{-# 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.FSx.Types.CreateOpenZFSVolumeConfiguration
-- 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.FSx.Types.CreateOpenZFSVolumeConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FSx.Types.CreateOpenZFSOriginSnapshotConfiguration
import Amazonka.FSx.Types.OpenZFSDataCompressionType
import Amazonka.FSx.Types.OpenZFSNfsExport
import Amazonka.FSx.Types.OpenZFSUserOrGroupQuota
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration of the Amazon FSx for OpenZFS volume that
-- you are creating.
--
-- /See:/ 'newCreateOpenZFSVolumeConfiguration' smart constructor.
data CreateOpenZFSVolumeConfiguration = CreateOpenZFSVolumeConfiguration'
  { -- | A Boolean value indicating whether tags for the volume should be copied
    -- to snapshots. This value defaults to @false@. If it\'s set to @true@,
    -- all tags for the volume are copied to snapshots where the user doesn\'t
    -- specify tags. If this value is @true@, and you specify one or more tags,
    -- only the specified tags are copied to snapshots. If you specify one or
    -- more tags when creating the snapshot, no tags are copied from the
    -- volume, regardless of this value.
    CreateOpenZFSVolumeConfiguration -> Maybe Bool
copyTagsToSnapshots :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the method used to compress the data on the volume. The
    -- compression type is @NONE@ by default.
    --
    -- -   @NONE@ - Doesn\'t compress the data on the volume. @NONE@ is the
    --     default.
    --
    -- -   @ZSTD@ - Compresses the data in the volume using the Zstandard
    --     (ZSTD) compression algorithm. ZSTD compression provides a higher
    --     level of data compression and higher read throughput performance
    --     than LZ4 compression.
    --
    -- -   @LZ4@ - Compresses the data in the volume using the LZ4 compression
    --     algorithm. LZ4 compression provides a lower level of compression and
    --     higher write throughput performance than ZSTD compression.
    --
    -- For more information about volume compression types and the performance
    -- of your Amazon FSx for OpenZFS file system, see
    -- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#performance-tips-zfs Tips for maximizing performance>
    -- File system and volume settings in the /Amazon FSx for OpenZFS User
    -- Guide/.
    CreateOpenZFSVolumeConfiguration
-> Maybe OpenZFSDataCompressionType
dataCompressionType :: Prelude.Maybe OpenZFSDataCompressionType,
    -- | The configuration object for mounting a Network File System (NFS) file
    -- system.
    CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSNfsExport]
nfsExports :: Prelude.Maybe [OpenZFSNfsExport],
    -- | The configuration object that specifies the snapshot to use as the
    -- origin of the data for the volume.
    CreateOpenZFSVolumeConfiguration
-> Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot :: Prelude.Maybe CreateOpenZFSOriginSnapshotConfiguration,
    -- | A Boolean value indicating whether the volume is read-only.
    CreateOpenZFSVolumeConfiguration -> Maybe Bool
readOnly :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the suggested block size for a volume in a ZFS dataset, in
    -- kibibytes (KiB). Valid values are 4, 8, 16, 32, 64, 128, 256, 512, or
    -- 1024 KiB. The default is 128 KiB. We recommend using the default setting
    -- for the majority of use cases. Generally, workloads that write in fixed
    -- small or large record sizes may benefit from setting a custom record
    -- size, like database workloads (small record size) or media streaming
    -- workloads (large record size). For additional guidance on when to set a
    -- custom record size, see
    -- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#record-size-performance ZFS Record size>
    -- in the /Amazon FSx for OpenZFS User Guide/.
    CreateOpenZFSVolumeConfiguration -> Maybe Natural
recordSizeKiB :: Prelude.Maybe Prelude.Natural,
    -- | Sets the maximum storage size in gibibytes (GiB) for the volume. You can
    -- specify a quota that is larger than the storage on the parent volume. A
    -- volume quota limits the amount of storage that the volume can consume to
    -- the configured amount, but does not guarantee the space will be
    -- available on the parent volume. To guarantee quota space, you must also
    -- set @StorageCapacityReservationGiB@. To /not/ specify a storage capacity
    -- quota, set this to @-1@.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
    -- in the /Amazon FSx for OpenZFS User Guide/.
    CreateOpenZFSVolumeConfiguration -> Maybe Int
storageCapacityQuotaGiB :: Prelude.Maybe Prelude.Int,
    -- | Specifies the amount of storage in gibibytes (GiB) to reserve from the
    -- parent volume. Setting @StorageCapacityReservationGiB@ guarantees that
    -- the specified amount of storage space on the parent volume will always
    -- be available for the volume. You can\'t reserve more storage than the
    -- parent volume has. To /not/ specify a storage capacity reservation, set
    -- this to @0@ or @-1@. For more information, see
    -- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
    -- in the /Amazon FSx for OpenZFS User Guide/.
    CreateOpenZFSVolumeConfiguration -> Maybe Int
storageCapacityReservationGiB :: Prelude.Maybe Prelude.Int,
    -- | An object specifying how much storage users or groups can use on the
    -- volume.
    CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas :: Prelude.Maybe [OpenZFSUserOrGroupQuota],
    -- | The ID of the volume to use as the parent volume of the volume that you
    -- are creating.
    CreateOpenZFSVolumeConfiguration -> Text
parentVolumeId :: Prelude.Text
  }
  deriving (CreateOpenZFSVolumeConfiguration
-> CreateOpenZFSVolumeConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOpenZFSVolumeConfiguration
-> CreateOpenZFSVolumeConfiguration -> Bool
$c/= :: CreateOpenZFSVolumeConfiguration
-> CreateOpenZFSVolumeConfiguration -> Bool
== :: CreateOpenZFSVolumeConfiguration
-> CreateOpenZFSVolumeConfiguration -> Bool
$c== :: CreateOpenZFSVolumeConfiguration
-> CreateOpenZFSVolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateOpenZFSVolumeConfiguration]
ReadPrec CreateOpenZFSVolumeConfiguration
Int -> ReadS CreateOpenZFSVolumeConfiguration
ReadS [CreateOpenZFSVolumeConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOpenZFSVolumeConfiguration]
$creadListPrec :: ReadPrec [CreateOpenZFSVolumeConfiguration]
readPrec :: ReadPrec CreateOpenZFSVolumeConfiguration
$creadPrec :: ReadPrec CreateOpenZFSVolumeConfiguration
readList :: ReadS [CreateOpenZFSVolumeConfiguration]
$creadList :: ReadS [CreateOpenZFSVolumeConfiguration]
readsPrec :: Int -> ReadS CreateOpenZFSVolumeConfiguration
$creadsPrec :: Int -> ReadS CreateOpenZFSVolumeConfiguration
Prelude.Read, Int -> CreateOpenZFSVolumeConfiguration -> ShowS
[CreateOpenZFSVolumeConfiguration] -> ShowS
CreateOpenZFSVolumeConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOpenZFSVolumeConfiguration] -> ShowS
$cshowList :: [CreateOpenZFSVolumeConfiguration] -> ShowS
show :: CreateOpenZFSVolumeConfiguration -> String
$cshow :: CreateOpenZFSVolumeConfiguration -> String
showsPrec :: Int -> CreateOpenZFSVolumeConfiguration -> ShowS
$cshowsPrec :: Int -> CreateOpenZFSVolumeConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateOpenZFSVolumeConfiguration x
-> CreateOpenZFSVolumeConfiguration
forall x.
CreateOpenZFSVolumeConfiguration
-> Rep CreateOpenZFSVolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateOpenZFSVolumeConfiguration x
-> CreateOpenZFSVolumeConfiguration
$cfrom :: forall x.
CreateOpenZFSVolumeConfiguration
-> Rep CreateOpenZFSVolumeConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateOpenZFSVolumeConfiguration' 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:
--
-- 'copyTagsToSnapshots', 'createOpenZFSVolumeConfiguration_copyTagsToSnapshots' - A Boolean value indicating whether tags for the volume should be copied
-- to snapshots. This value defaults to @false@. If it\'s set to @true@,
-- all tags for the volume are copied to snapshots where the user doesn\'t
-- specify tags. If this value is @true@, and you specify one or more tags,
-- only the specified tags are copied to snapshots. If you specify one or
-- more tags when creating the snapshot, no tags are copied from the
-- volume, regardless of this value.
--
-- 'dataCompressionType', 'createOpenZFSVolumeConfiguration_dataCompressionType' - Specifies the method used to compress the data on the volume. The
-- compression type is @NONE@ by default.
--
-- -   @NONE@ - Doesn\'t compress the data on the volume. @NONE@ is the
--     default.
--
-- -   @ZSTD@ - Compresses the data in the volume using the Zstandard
--     (ZSTD) compression algorithm. ZSTD compression provides a higher
--     level of data compression and higher read throughput performance
--     than LZ4 compression.
--
-- -   @LZ4@ - Compresses the data in the volume using the LZ4 compression
--     algorithm. LZ4 compression provides a lower level of compression and
--     higher write throughput performance than ZSTD compression.
--
-- For more information about volume compression types and the performance
-- of your Amazon FSx for OpenZFS file system, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#performance-tips-zfs Tips for maximizing performance>
-- File system and volume settings in the /Amazon FSx for OpenZFS User
-- Guide/.
--
-- 'nfsExports', 'createOpenZFSVolumeConfiguration_nfsExports' - The configuration object for mounting a Network File System (NFS) file
-- system.
--
-- 'originSnapshot', 'createOpenZFSVolumeConfiguration_originSnapshot' - The configuration object that specifies the snapshot to use as the
-- origin of the data for the volume.
--
-- 'readOnly', 'createOpenZFSVolumeConfiguration_readOnly' - A Boolean value indicating whether the volume is read-only.
--
-- 'recordSizeKiB', 'createOpenZFSVolumeConfiguration_recordSizeKiB' - Specifies the suggested block size for a volume in a ZFS dataset, in
-- kibibytes (KiB). Valid values are 4, 8, 16, 32, 64, 128, 256, 512, or
-- 1024 KiB. The default is 128 KiB. We recommend using the default setting
-- for the majority of use cases. Generally, workloads that write in fixed
-- small or large record sizes may benefit from setting a custom record
-- size, like database workloads (small record size) or media streaming
-- workloads (large record size). For additional guidance on when to set a
-- custom record size, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#record-size-performance ZFS Record size>
-- in the /Amazon FSx for OpenZFS User Guide/.
--
-- 'storageCapacityQuotaGiB', 'createOpenZFSVolumeConfiguration_storageCapacityQuotaGiB' - Sets the maximum storage size in gibibytes (GiB) for the volume. You can
-- specify a quota that is larger than the storage on the parent volume. A
-- volume quota limits the amount of storage that the volume can consume to
-- the configured amount, but does not guarantee the space will be
-- available on the parent volume. To guarantee quota space, you must also
-- set @StorageCapacityReservationGiB@. To /not/ specify a storage capacity
-- quota, set this to @-1@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
-- in the /Amazon FSx for OpenZFS User Guide/.
--
-- 'storageCapacityReservationGiB', 'createOpenZFSVolumeConfiguration_storageCapacityReservationGiB' - Specifies the amount of storage in gibibytes (GiB) to reserve from the
-- parent volume. Setting @StorageCapacityReservationGiB@ guarantees that
-- the specified amount of storage space on the parent volume will always
-- be available for the volume. You can\'t reserve more storage than the
-- parent volume has. To /not/ specify a storage capacity reservation, set
-- this to @0@ or @-1@. For more information, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
-- in the /Amazon FSx for OpenZFS User Guide/.
--
-- 'userAndGroupQuotas', 'createOpenZFSVolumeConfiguration_userAndGroupQuotas' - An object specifying how much storage users or groups can use on the
-- volume.
--
-- 'parentVolumeId', 'createOpenZFSVolumeConfiguration_parentVolumeId' - The ID of the volume to use as the parent volume of the volume that you
-- are creating.
newCreateOpenZFSVolumeConfiguration ::
  -- | 'parentVolumeId'
  Prelude.Text ->
  CreateOpenZFSVolumeConfiguration
newCreateOpenZFSVolumeConfiguration :: Text -> CreateOpenZFSVolumeConfiguration
newCreateOpenZFSVolumeConfiguration Text
pParentVolumeId_ =
  CreateOpenZFSVolumeConfiguration'
    { $sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: Maybe Bool
copyTagsToSnapshots =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: Maybe OpenZFSDataCompressionType
dataCompressionType = forall a. Maybe a
Prelude.Nothing,
      $sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: Maybe [OpenZFSNfsExport]
nfsExports = forall a. Maybe a
Prelude.Nothing,
      $sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot = forall a. Maybe a
Prelude.Nothing,
      $sel:readOnly:CreateOpenZFSVolumeConfiguration' :: Maybe Bool
readOnly = forall a. Maybe a
Prelude.Nothing,
      $sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: Maybe Natural
recordSizeKiB = forall a. Maybe a
Prelude.Nothing,
      $sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: Maybe Int
storageCapacityQuotaGiB = forall a. Maybe a
Prelude.Nothing,
      $sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: Maybe Int
storageCapacityReservationGiB =
        forall a. Maybe a
Prelude.Nothing,
      $sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas = forall a. Maybe a
Prelude.Nothing,
      $sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: Text
parentVolumeId = Text
pParentVolumeId_
    }

-- | A Boolean value indicating whether tags for the volume should be copied
-- to snapshots. This value defaults to @false@. If it\'s set to @true@,
-- all tags for the volume are copied to snapshots where the user doesn\'t
-- specify tags. If this value is @true@, and you specify one or more tags,
-- only the specified tags are copied to snapshots. If you specify one or
-- more tags when creating the snapshot, no tags are copied from the
-- volume, regardless of this value.
createOpenZFSVolumeConfiguration_copyTagsToSnapshots :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe Prelude.Bool)
createOpenZFSVolumeConfiguration_copyTagsToSnapshots :: Lens' CreateOpenZFSVolumeConfiguration (Maybe Bool)
createOpenZFSVolumeConfiguration_copyTagsToSnapshots = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe Bool
copyTagsToSnapshots :: Maybe Bool
$sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
copyTagsToSnapshots} -> Maybe Bool
copyTagsToSnapshots) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe Bool
a -> CreateOpenZFSVolumeConfiguration
s {$sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: Maybe Bool
copyTagsToSnapshots = Maybe Bool
a} :: CreateOpenZFSVolumeConfiguration)

-- | Specifies the method used to compress the data on the volume. The
-- compression type is @NONE@ by default.
--
-- -   @NONE@ - Doesn\'t compress the data on the volume. @NONE@ is the
--     default.
--
-- -   @ZSTD@ - Compresses the data in the volume using the Zstandard
--     (ZSTD) compression algorithm. ZSTD compression provides a higher
--     level of data compression and higher read throughput performance
--     than LZ4 compression.
--
-- -   @LZ4@ - Compresses the data in the volume using the LZ4 compression
--     algorithm. LZ4 compression provides a lower level of compression and
--     higher write throughput performance than ZSTD compression.
--
-- For more information about volume compression types and the performance
-- of your Amazon FSx for OpenZFS file system, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#performance-tips-zfs Tips for maximizing performance>
-- File system and volume settings in the /Amazon FSx for OpenZFS User
-- Guide/.
createOpenZFSVolumeConfiguration_dataCompressionType :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe OpenZFSDataCompressionType)
createOpenZFSVolumeConfiguration_dataCompressionType :: Lens'
  CreateOpenZFSVolumeConfiguration (Maybe OpenZFSDataCompressionType)
createOpenZFSVolumeConfiguration_dataCompressionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe OpenZFSDataCompressionType
dataCompressionType :: Maybe OpenZFSDataCompressionType
$sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe OpenZFSDataCompressionType
dataCompressionType} -> Maybe OpenZFSDataCompressionType
dataCompressionType) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe OpenZFSDataCompressionType
a -> CreateOpenZFSVolumeConfiguration
s {$sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: Maybe OpenZFSDataCompressionType
dataCompressionType = Maybe OpenZFSDataCompressionType
a} :: CreateOpenZFSVolumeConfiguration)

-- | The configuration object for mounting a Network File System (NFS) file
-- system.
createOpenZFSVolumeConfiguration_nfsExports :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe [OpenZFSNfsExport])
createOpenZFSVolumeConfiguration_nfsExports :: Lens' CreateOpenZFSVolumeConfiguration (Maybe [OpenZFSNfsExport])
createOpenZFSVolumeConfiguration_nfsExports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe [OpenZFSNfsExport]
nfsExports :: Maybe [OpenZFSNfsExport]
$sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSNfsExport]
nfsExports} -> Maybe [OpenZFSNfsExport]
nfsExports) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe [OpenZFSNfsExport]
a -> CreateOpenZFSVolumeConfiguration
s {$sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: Maybe [OpenZFSNfsExport]
nfsExports = Maybe [OpenZFSNfsExport]
a} :: CreateOpenZFSVolumeConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The configuration object that specifies the snapshot to use as the
-- origin of the data for the volume.
createOpenZFSVolumeConfiguration_originSnapshot :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe CreateOpenZFSOriginSnapshotConfiguration)
createOpenZFSVolumeConfiguration_originSnapshot :: Lens'
  CreateOpenZFSVolumeConfiguration
  (Maybe CreateOpenZFSOriginSnapshotConfiguration)
createOpenZFSVolumeConfiguration_originSnapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot :: Maybe CreateOpenZFSOriginSnapshotConfiguration
$sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot} -> Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe CreateOpenZFSOriginSnapshotConfiguration
a -> CreateOpenZFSVolumeConfiguration
s {$sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot = Maybe CreateOpenZFSOriginSnapshotConfiguration
a} :: CreateOpenZFSVolumeConfiguration)

-- | A Boolean value indicating whether the volume is read-only.
createOpenZFSVolumeConfiguration_readOnly :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe Prelude.Bool)
createOpenZFSVolumeConfiguration_readOnly :: Lens' CreateOpenZFSVolumeConfiguration (Maybe Bool)
createOpenZFSVolumeConfiguration_readOnly = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe Bool
readOnly :: Maybe Bool
$sel:readOnly:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
readOnly} -> Maybe Bool
readOnly) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe Bool
a -> CreateOpenZFSVolumeConfiguration
s {$sel:readOnly:CreateOpenZFSVolumeConfiguration' :: Maybe Bool
readOnly = Maybe Bool
a} :: CreateOpenZFSVolumeConfiguration)

-- | Specifies the suggested block size for a volume in a ZFS dataset, in
-- kibibytes (KiB). Valid values are 4, 8, 16, 32, 64, 128, 256, 512, or
-- 1024 KiB. The default is 128 KiB. We recommend using the default setting
-- for the majority of use cases. Generally, workloads that write in fixed
-- small or large record sizes may benefit from setting a custom record
-- size, like database workloads (small record size) or media streaming
-- workloads (large record size). For additional guidance on when to set a
-- custom record size, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance.html#record-size-performance ZFS Record size>
-- in the /Amazon FSx for OpenZFS User Guide/.
createOpenZFSVolumeConfiguration_recordSizeKiB :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe Prelude.Natural)
createOpenZFSVolumeConfiguration_recordSizeKiB :: Lens' CreateOpenZFSVolumeConfiguration (Maybe Natural)
createOpenZFSVolumeConfiguration_recordSizeKiB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe Natural
recordSizeKiB :: Maybe Natural
$sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Natural
recordSizeKiB} -> Maybe Natural
recordSizeKiB) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe Natural
a -> CreateOpenZFSVolumeConfiguration
s {$sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: Maybe Natural
recordSizeKiB = Maybe Natural
a} :: CreateOpenZFSVolumeConfiguration)

-- | Sets the maximum storage size in gibibytes (GiB) for the volume. You can
-- specify a quota that is larger than the storage on the parent volume. A
-- volume quota limits the amount of storage that the volume can consume to
-- the configured amount, but does not guarantee the space will be
-- available on the parent volume. To guarantee quota space, you must also
-- set @StorageCapacityReservationGiB@. To /not/ specify a storage capacity
-- quota, set this to @-1@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
-- in the /Amazon FSx for OpenZFS User Guide/.
createOpenZFSVolumeConfiguration_storageCapacityQuotaGiB :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe Prelude.Int)
createOpenZFSVolumeConfiguration_storageCapacityQuotaGiB :: Lens' CreateOpenZFSVolumeConfiguration (Maybe Int)
createOpenZFSVolumeConfiguration_storageCapacityQuotaGiB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe Int
storageCapacityQuotaGiB :: Maybe Int
$sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
storageCapacityQuotaGiB} -> Maybe Int
storageCapacityQuotaGiB) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe Int
a -> CreateOpenZFSVolumeConfiguration
s {$sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: Maybe Int
storageCapacityQuotaGiB = Maybe Int
a} :: CreateOpenZFSVolumeConfiguration)

-- | Specifies the amount of storage in gibibytes (GiB) to reserve from the
-- parent volume. Setting @StorageCapacityReservationGiB@ guarantees that
-- the specified amount of storage space on the parent volume will always
-- be available for the volume. You can\'t reserve more storage than the
-- parent volume has. To /not/ specify a storage capacity reservation, set
-- this to @0@ or @-1@. For more information, see
-- <https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/managing-volumes.html#volume-properties Volume properties>
-- in the /Amazon FSx for OpenZFS User Guide/.
createOpenZFSVolumeConfiguration_storageCapacityReservationGiB :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe Prelude.Int)
createOpenZFSVolumeConfiguration_storageCapacityReservationGiB :: Lens' CreateOpenZFSVolumeConfiguration (Maybe Int)
createOpenZFSVolumeConfiguration_storageCapacityReservationGiB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe Int
storageCapacityReservationGiB :: Maybe Int
$sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
storageCapacityReservationGiB} -> Maybe Int
storageCapacityReservationGiB) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe Int
a -> CreateOpenZFSVolumeConfiguration
s {$sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: Maybe Int
storageCapacityReservationGiB = Maybe Int
a} :: CreateOpenZFSVolumeConfiguration)

-- | An object specifying how much storage users or groups can use on the
-- volume.
createOpenZFSVolumeConfiguration_userAndGroupQuotas :: Lens.Lens' CreateOpenZFSVolumeConfiguration (Prelude.Maybe [OpenZFSUserOrGroupQuota])
createOpenZFSVolumeConfiguration_userAndGroupQuotas :: Lens'
  CreateOpenZFSVolumeConfiguration (Maybe [OpenZFSUserOrGroupQuota])
createOpenZFSVolumeConfiguration_userAndGroupQuotas = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas :: Maybe [OpenZFSUserOrGroupQuota]
$sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas} -> Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Maybe [OpenZFSUserOrGroupQuota]
a -> CreateOpenZFSVolumeConfiguration
s {$sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas = Maybe [OpenZFSUserOrGroupQuota]
a} :: CreateOpenZFSVolumeConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the volume to use as the parent volume of the volume that you
-- are creating.
createOpenZFSVolumeConfiguration_parentVolumeId :: Lens.Lens' CreateOpenZFSVolumeConfiguration Prelude.Text
createOpenZFSVolumeConfiguration_parentVolumeId :: Lens' CreateOpenZFSVolumeConfiguration Text
createOpenZFSVolumeConfiguration_parentVolumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOpenZFSVolumeConfiguration' {Text
parentVolumeId :: Text
$sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Text
parentVolumeId} -> Text
parentVolumeId) (\s :: CreateOpenZFSVolumeConfiguration
s@CreateOpenZFSVolumeConfiguration' {} Text
a -> CreateOpenZFSVolumeConfiguration
s {$sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: Text
parentVolumeId = Text
a} :: CreateOpenZFSVolumeConfiguration)

instance
  Prelude.Hashable
    CreateOpenZFSVolumeConfiguration
  where
  hashWithSalt :: Int -> CreateOpenZFSVolumeConfiguration -> Int
hashWithSalt
    Int
_salt
    CreateOpenZFSVolumeConfiguration' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [OpenZFSNfsExport]
Maybe [OpenZFSUserOrGroupQuota]
Maybe CreateOpenZFSOriginSnapshotConfiguration
Maybe OpenZFSDataCompressionType
Text
parentVolumeId :: Text
userAndGroupQuotas :: Maybe [OpenZFSUserOrGroupQuota]
storageCapacityReservationGiB :: Maybe Int
storageCapacityQuotaGiB :: Maybe Int
recordSizeKiB :: Maybe Natural
readOnly :: Maybe Bool
originSnapshot :: Maybe CreateOpenZFSOriginSnapshotConfiguration
nfsExports :: Maybe [OpenZFSNfsExport]
dataCompressionType :: Maybe OpenZFSDataCompressionType
copyTagsToSnapshots :: Maybe Bool
$sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Text
$sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSUserOrGroupQuota]
$sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Natural
$sel:readOnly:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
$sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe CreateOpenZFSOriginSnapshotConfiguration
$sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSNfsExport]
$sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe OpenZFSDataCompressionType
$sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
copyTagsToSnapshots
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpenZFSDataCompressionType
dataCompressionType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [OpenZFSNfsExport]
nfsExports
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
readOnly
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
recordSizeKiB
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
storageCapacityQuotaGiB
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
storageCapacityReservationGiB
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parentVolumeId

instance
  Prelude.NFData
    CreateOpenZFSVolumeConfiguration
  where
  rnf :: CreateOpenZFSVolumeConfiguration -> ()
rnf CreateOpenZFSVolumeConfiguration' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [OpenZFSNfsExport]
Maybe [OpenZFSUserOrGroupQuota]
Maybe CreateOpenZFSOriginSnapshotConfiguration
Maybe OpenZFSDataCompressionType
Text
parentVolumeId :: Text
userAndGroupQuotas :: Maybe [OpenZFSUserOrGroupQuota]
storageCapacityReservationGiB :: Maybe Int
storageCapacityQuotaGiB :: Maybe Int
recordSizeKiB :: Maybe Natural
readOnly :: Maybe Bool
originSnapshot :: Maybe CreateOpenZFSOriginSnapshotConfiguration
nfsExports :: Maybe [OpenZFSNfsExport]
dataCompressionType :: Maybe OpenZFSDataCompressionType
copyTagsToSnapshots :: Maybe Bool
$sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Text
$sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSUserOrGroupQuota]
$sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Natural
$sel:readOnly:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
$sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe CreateOpenZFSOriginSnapshotConfiguration
$sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSNfsExport]
$sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe OpenZFSDataCompressionType
$sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
copyTagsToSnapshots
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OpenZFSDataCompressionType
dataCompressionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [OpenZFSNfsExport]
nfsExports
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
readOnly
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
recordSizeKiB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
storageCapacityQuotaGiB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
storageCapacityReservationGiB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parentVolumeId

instance Data.ToJSON CreateOpenZFSVolumeConfiguration where
  toJSON :: CreateOpenZFSVolumeConfiguration -> Value
toJSON CreateOpenZFSVolumeConfiguration' {Maybe Bool
Maybe Int
Maybe Natural
Maybe [OpenZFSNfsExport]
Maybe [OpenZFSUserOrGroupQuota]
Maybe CreateOpenZFSOriginSnapshotConfiguration
Maybe OpenZFSDataCompressionType
Text
parentVolumeId :: Text
userAndGroupQuotas :: Maybe [OpenZFSUserOrGroupQuota]
storageCapacityReservationGiB :: Maybe Int
storageCapacityQuotaGiB :: Maybe Int
recordSizeKiB :: Maybe Natural
readOnly :: Maybe Bool
originSnapshot :: Maybe CreateOpenZFSOriginSnapshotConfiguration
nfsExports :: Maybe [OpenZFSNfsExport]
dataCompressionType :: Maybe OpenZFSDataCompressionType
copyTagsToSnapshots :: Maybe Bool
$sel:parentVolumeId:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Text
$sel:userAndGroupQuotas:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSUserOrGroupQuota]
$sel:storageCapacityReservationGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:storageCapacityQuotaGiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Int
$sel:recordSizeKiB:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Natural
$sel:readOnly:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
$sel:originSnapshot:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe CreateOpenZFSOriginSnapshotConfiguration
$sel:nfsExports:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe [OpenZFSNfsExport]
$sel:dataCompressionType:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration
-> Maybe OpenZFSDataCompressionType
$sel:copyTagsToSnapshots:CreateOpenZFSVolumeConfiguration' :: CreateOpenZFSVolumeConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CopyTagsToSnapshots" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
copyTagsToSnapshots,
            (Key
"DataCompressionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OpenZFSDataCompressionType
dataCompressionType,
            (Key
"NfsExports" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OpenZFSNfsExport]
nfsExports,
            (Key
"OriginSnapshot" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateOpenZFSOriginSnapshotConfiguration
originSnapshot,
            (Key
"ReadOnly" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
readOnly,
            (Key
"RecordSizeKiB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
recordSizeKiB,
            (Key
"StorageCapacityQuotaGiB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
storageCapacityQuotaGiB,
            (Key
"StorageCapacityReservationGiB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
storageCapacityReservationGiB,
            (Key
"UserAndGroupQuotas" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OpenZFSUserOrGroupQuota]
userAndGroupQuotas,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ParentVolumeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
parentVolumeId)
          ]
      )