{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DocumentDB.CreateDBCluster
-- 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)
--
-- Creates a new Amazon DocumentDB cluster.
module Amazonka.DocumentDB.CreateDBCluster
  ( -- * Creating a Request
    CreateDBCluster (..),
    newCreateDBCluster,

    -- * Request Lenses
    createDBCluster_engineVersion,
    createDBCluster_deletionProtection,
    createDBCluster_storageEncrypted,
    createDBCluster_masterUserPassword,
    createDBCluster_globalClusterIdentifier,
    createDBCluster_masterUsername,
    createDBCluster_dbSubnetGroupName,
    createDBCluster_preSignedUrl,
    createDBCluster_preferredMaintenanceWindow,
    createDBCluster_availabilityZones,
    createDBCluster_kmsKeyId,
    createDBCluster_preferredBackupWindow,
    createDBCluster_backupRetentionPeriod,
    createDBCluster_vpcSecurityGroupIds,
    createDBCluster_dbClusterParameterGroupName,
    createDBCluster_tags,
    createDBCluster_port,
    createDBCluster_enableCloudwatchLogsExports,
    createDBCluster_dbClusterIdentifier,
    createDBCluster_engine,

    -- * Destructuring the Response
    CreateDBClusterResponse (..),
    newCreateDBClusterResponse,

    -- * Response Lenses
    createDBClusterResponse_dbCluster,
    createDBClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DocumentDB.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input to CreateDBCluster.
--
-- /See:/ 'newCreateDBCluster' smart constructor.
data CreateDBCluster = CreateDBCluster'
  { -- | The version number of the database engine to use. The @--engine-version@
    -- will default to the latest major engine version. For production
    -- workloads, we recommend explicitly declaring this parameter with the
    -- intended major engine version.
    CreateDBCluster -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether this cluster can be deleted. If @DeletionProtection@
    -- is enabled, the cluster cannot be deleted unless it is modified and
    -- @DeletionProtection@ is disabled. @DeletionProtection@ protects clusters
    -- from being accidentally deleted.
    CreateDBCluster -> Maybe Bool
deletionProtection :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether the cluster is encrypted.
    CreateDBCluster -> Maybe Bool
storageEncrypted :: Prelude.Maybe Prelude.Bool,
    -- | The password for the master database user. This password can contain any
    -- printable ASCII character except forward slash (\/), double quote (\"),
    -- or the \"at\" symbol (\@).
    --
    -- Constraints: Must contain from 8 to 100 characters.
    CreateDBCluster -> Maybe Text
masterUserPassword :: Prelude.Maybe Prelude.Text,
    -- | The cluster identifier of the new global cluster.
    CreateDBCluster -> Maybe Text
globalClusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The name of the master user for the cluster.
    --
    -- Constraints:
    --
    -- -   Must be from 1 to 63 letters or numbers.
    --
    -- -   The first character must be a letter.
    --
    -- -   Cannot be a reserved word for the chosen database engine.
    CreateDBCluster -> Maybe Text
masterUsername :: Prelude.Maybe Prelude.Text,
    -- | A subnet group to associate with this cluster.
    --
    -- Constraints: Must match the name of an existing @DBSubnetGroup@. Must
    -- not be default.
    --
    -- Example: @mySubnetgroup@
    CreateDBCluster -> Maybe Text
dbSubnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | Not currently supported.
    CreateDBCluster -> Maybe Text
preSignedUrl :: Prelude.Maybe Prelude.Text,
    -- | The weekly time range during which system maintenance can occur, in
    -- Universal Coordinated Time (UTC).
    --
    -- Format: @ddd:hh24:mi-ddd:hh24:mi@
    --
    -- The default is a 30-minute window selected at random from an 8-hour
    -- block of time for each Region, occurring on a random day of the week.
    --
    -- Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
    --
    -- Constraints: Minimum 30-minute window.
    CreateDBCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | A list of Amazon EC2 Availability Zones that instances in the cluster
    -- can be created in.
    CreateDBCluster -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text],
    -- | The KMS key identifier for an encrypted cluster.
    --
    -- The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
    -- encryption key. If you are creating a cluster using the same account
    -- that owns the KMS encryption key that is used to encrypt the new
    -- cluster, you can use the KMS key alias instead of the ARN for the KMS
    -- encryption key.
    --
    -- If an encryption key is not specified in @KmsKeyId@:
    --
    -- -   If the @StorageEncrypted@ parameter is @true@, Amazon DocumentDB
    --     uses your default encryption key.
    --
    -- KMS creates the default encryption key for your account. Your account
    -- has a different default encryption key for each Regions.
    CreateDBCluster -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The daily time range during which automated backups are created if
    -- automated backups are enabled using the @BackupRetentionPeriod@
    -- parameter.
    --
    -- The default is a 30-minute window selected at random from an 8-hour
    -- block of time for each Region.
    --
    -- Constraints:
    --
    -- -   Must be in the format @hh24:mi-hh24:mi@.
    --
    -- -   Must be in Universal Coordinated Time (UTC).
    --
    -- -   Must not conflict with the preferred maintenance window.
    --
    -- -   Must be at least 30 minutes.
    CreateDBCluster -> Maybe Text
preferredBackupWindow :: Prelude.Maybe Prelude.Text,
    -- | The number of days for which automated backups are retained. You must
    -- specify a minimum value of 1.
    --
    -- Default: 1
    --
    -- Constraints:
    --
    -- -   Must be a value from 1 to 35.
    CreateDBCluster -> Maybe Int
backupRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | A list of EC2 VPC security groups to associate with this cluster.
    CreateDBCluster -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The name of the cluster parameter group to associate with this cluster.
    CreateDBCluster -> Maybe Text
dbClusterParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The tags to be assigned to the cluster.
    CreateDBCluster -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The port number on which the instances in the cluster accept
    -- connections.
    CreateDBCluster -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | A list of log types that need to be enabled for exporting to Amazon
    -- CloudWatch Logs. You can enable audit logs or profiler logs. For more
    -- information, see
    -- <https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html Auditing Amazon DocumentDB Events>
    -- and
    -- <https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html Profiling Amazon DocumentDB Operations>.
    CreateDBCluster -> Maybe [Text]
enableCloudwatchLogsExports :: Prelude.Maybe [Prelude.Text],
    -- | The cluster identifier. This parameter is stored as a lowercase string.
    --
    -- Constraints:
    --
    -- -   Must contain from 1 to 63 letters, numbers, or hyphens.
    --
    -- -   The first character must be a letter.
    --
    -- -   Cannot end with a hyphen or contain two consecutive hyphens.
    --
    -- Example: @my-cluster@
    CreateDBCluster -> Text
dbClusterIdentifier :: Prelude.Text,
    -- | The name of the database engine to be used for this cluster.
    --
    -- Valid values: @docdb@
    CreateDBCluster -> Text
engine :: Prelude.Text
  }
  deriving (CreateDBCluster -> CreateDBCluster -> Bool
(CreateDBCluster -> CreateDBCluster -> Bool)
-> (CreateDBCluster -> CreateDBCluster -> Bool)
-> Eq CreateDBCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDBCluster -> CreateDBCluster -> Bool
$c/= :: CreateDBCluster -> CreateDBCluster -> Bool
== :: CreateDBCluster -> CreateDBCluster -> Bool
$c== :: CreateDBCluster -> CreateDBCluster -> Bool
Prelude.Eq, ReadPrec [CreateDBCluster]
ReadPrec CreateDBCluster
Int -> ReadS CreateDBCluster
ReadS [CreateDBCluster]
(Int -> ReadS CreateDBCluster)
-> ReadS [CreateDBCluster]
-> ReadPrec CreateDBCluster
-> ReadPrec [CreateDBCluster]
-> Read CreateDBCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDBCluster]
$creadListPrec :: ReadPrec [CreateDBCluster]
readPrec :: ReadPrec CreateDBCluster
$creadPrec :: ReadPrec CreateDBCluster
readList :: ReadS [CreateDBCluster]
$creadList :: ReadS [CreateDBCluster]
readsPrec :: Int -> ReadS CreateDBCluster
$creadsPrec :: Int -> ReadS CreateDBCluster
Prelude.Read, Int -> CreateDBCluster -> ShowS
[CreateDBCluster] -> ShowS
CreateDBCluster -> String
(Int -> CreateDBCluster -> ShowS)
-> (CreateDBCluster -> String)
-> ([CreateDBCluster] -> ShowS)
-> Show CreateDBCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDBCluster] -> ShowS
$cshowList :: [CreateDBCluster] -> ShowS
show :: CreateDBCluster -> String
$cshow :: CreateDBCluster -> String
showsPrec :: Int -> CreateDBCluster -> ShowS
$cshowsPrec :: Int -> CreateDBCluster -> ShowS
Prelude.Show, (forall x. CreateDBCluster -> Rep CreateDBCluster x)
-> (forall x. Rep CreateDBCluster x -> CreateDBCluster)
-> Generic CreateDBCluster
forall x. Rep CreateDBCluster x -> CreateDBCluster
forall x. CreateDBCluster -> Rep CreateDBCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDBCluster x -> CreateDBCluster
$cfrom :: forall x. CreateDBCluster -> Rep CreateDBCluster x
Prelude.Generic)

-- |
-- Create a value of 'CreateDBCluster' 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:
--
-- 'engineVersion', 'createDBCluster_engineVersion' - The version number of the database engine to use. The @--engine-version@
-- will default to the latest major engine version. For production
-- workloads, we recommend explicitly declaring this parameter with the
-- intended major engine version.
--
-- 'deletionProtection', 'createDBCluster_deletionProtection' - Specifies whether this cluster can be deleted. If @DeletionProtection@
-- is enabled, the cluster cannot be deleted unless it is modified and
-- @DeletionProtection@ is disabled. @DeletionProtection@ protects clusters
-- from being accidentally deleted.
--
-- 'storageEncrypted', 'createDBCluster_storageEncrypted' - Specifies whether the cluster is encrypted.
--
-- 'masterUserPassword', 'createDBCluster_masterUserPassword' - The password for the master database user. This password can contain any
-- printable ASCII character except forward slash (\/), double quote (\"),
-- or the \"at\" symbol (\@).
--
-- Constraints: Must contain from 8 to 100 characters.
--
-- 'globalClusterIdentifier', 'createDBCluster_globalClusterIdentifier' - The cluster identifier of the new global cluster.
--
-- 'masterUsername', 'createDBCluster_masterUsername' - The name of the master user for the cluster.
--
-- Constraints:
--
-- -   Must be from 1 to 63 letters or numbers.
--
-- -   The first character must be a letter.
--
-- -   Cannot be a reserved word for the chosen database engine.
--
-- 'dbSubnetGroupName', 'createDBCluster_dbSubnetGroupName' - A subnet group to associate with this cluster.
--
-- Constraints: Must match the name of an existing @DBSubnetGroup@. Must
-- not be default.
--
-- Example: @mySubnetgroup@
--
-- 'preSignedUrl', 'createDBCluster_preSignedUrl' - Not currently supported.
--
-- 'preferredMaintenanceWindow', 'createDBCluster_preferredMaintenanceWindow' - The weekly time range during which system maintenance can occur, in
-- Universal Coordinated Time (UTC).
--
-- Format: @ddd:hh24:mi-ddd:hh24:mi@
--
-- The default is a 30-minute window selected at random from an 8-hour
-- block of time for each Region, occurring on a random day of the week.
--
-- Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
--
-- Constraints: Minimum 30-minute window.
--
-- 'availabilityZones', 'createDBCluster_availabilityZones' - A list of Amazon EC2 Availability Zones that instances in the cluster
-- can be created in.
--
-- 'kmsKeyId', 'createDBCluster_kmsKeyId' - The KMS key identifier for an encrypted cluster.
--
-- The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
-- encryption key. If you are creating a cluster using the same account
-- that owns the KMS encryption key that is used to encrypt the new
-- cluster, you can use the KMS key alias instead of the ARN for the KMS
-- encryption key.
--
-- If an encryption key is not specified in @KmsKeyId@:
--
-- -   If the @StorageEncrypted@ parameter is @true@, Amazon DocumentDB
--     uses your default encryption key.
--
-- KMS creates the default encryption key for your account. Your account
-- has a different default encryption key for each Regions.
--
-- 'preferredBackupWindow', 'createDBCluster_preferredBackupWindow' - The daily time range during which automated backups are created if
-- automated backups are enabled using the @BackupRetentionPeriod@
-- parameter.
--
-- The default is a 30-minute window selected at random from an 8-hour
-- block of time for each Region.
--
-- Constraints:
--
-- -   Must be in the format @hh24:mi-hh24:mi@.
--
-- -   Must be in Universal Coordinated Time (UTC).
--
-- -   Must not conflict with the preferred maintenance window.
--
-- -   Must be at least 30 minutes.
--
-- 'backupRetentionPeriod', 'createDBCluster_backupRetentionPeriod' - The number of days for which automated backups are retained. You must
-- specify a minimum value of 1.
--
-- Default: 1
--
-- Constraints:
--
-- -   Must be a value from 1 to 35.
--
-- 'vpcSecurityGroupIds', 'createDBCluster_vpcSecurityGroupIds' - A list of EC2 VPC security groups to associate with this cluster.
--
-- 'dbClusterParameterGroupName', 'createDBCluster_dbClusterParameterGroupName' - The name of the cluster parameter group to associate with this cluster.
--
-- 'tags', 'createDBCluster_tags' - The tags to be assigned to the cluster.
--
-- 'port', 'createDBCluster_port' - The port number on which the instances in the cluster accept
-- connections.
--
-- 'enableCloudwatchLogsExports', 'createDBCluster_enableCloudwatchLogsExports' - A list of log types that need to be enabled for exporting to Amazon
-- CloudWatch Logs. You can enable audit logs or profiler logs. For more
-- information, see
-- <https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html Auditing Amazon DocumentDB Events>
-- and
-- <https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html Profiling Amazon DocumentDB Operations>.
--
-- 'dbClusterIdentifier', 'createDBCluster_dbClusterIdentifier' - The cluster identifier. This parameter is stored as a lowercase string.
--
-- Constraints:
--
-- -   Must contain from 1 to 63 letters, numbers, or hyphens.
--
-- -   The first character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
--
-- Example: @my-cluster@
--
-- 'engine', 'createDBCluster_engine' - The name of the database engine to be used for this cluster.
--
-- Valid values: @docdb@
newCreateDBCluster ::
  -- | 'dbClusterIdentifier'
  Prelude.Text ->
  -- | 'engine'
  Prelude.Text ->
  CreateDBCluster
newCreateDBCluster :: Text -> Text -> CreateDBCluster
newCreateDBCluster Text
pDBClusterIdentifier_ Text
pEngine_ =
  CreateDBCluster' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [Tag]
-> Maybe Int
-> Maybe [Text]
-> Text
-> Text
-> CreateDBCluster
CreateDBCluster'
    { $sel:engineVersion:CreateDBCluster' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deletionProtection:CreateDBCluster' :: Maybe Bool
deletionProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:storageEncrypted:CreateDBCluster' :: Maybe Bool
storageEncrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:masterUserPassword:CreateDBCluster' :: Maybe Text
masterUserPassword = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:globalClusterIdentifier:CreateDBCluster' :: Maybe Text
globalClusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:masterUsername:CreateDBCluster' :: Maybe Text
masterUsername = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbSubnetGroupName:CreateDBCluster' :: Maybe Text
dbSubnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preSignedUrl:CreateDBCluster' :: Maybe Text
preSignedUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:CreateDBCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZones:CreateDBCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:CreateDBCluster' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredBackupWindow:CreateDBCluster' :: Maybe Text
preferredBackupWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupRetentionPeriod:CreateDBCluster' :: Maybe Int
backupRetentionPeriod = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcSecurityGroupIds:CreateDBCluster' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterParameterGroupName:CreateDBCluster' :: Maybe Text
dbClusterParameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDBCluster' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:port:CreateDBCluster' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:enableCloudwatchLogsExports:CreateDBCluster' :: Maybe [Text]
enableCloudwatchLogsExports = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterIdentifier:CreateDBCluster' :: Text
dbClusterIdentifier = Text
pDBClusterIdentifier_,
      $sel:engine:CreateDBCluster' :: Text
engine = Text
pEngine_
    }

-- | The version number of the database engine to use. The @--engine-version@
-- will default to the latest major engine version. For production
-- workloads, we recommend explicitly declaring this parameter with the
-- intended major engine version.
createDBCluster_engineVersion :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_engineVersion :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_engineVersion = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:CreateDBCluster' :: CreateDBCluster -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:engineVersion:CreateDBCluster' :: Maybe Text
engineVersion = Maybe Text
a} :: CreateDBCluster)

-- | Specifies whether this cluster can be deleted. If @DeletionProtection@
-- is enabled, the cluster cannot be deleted unless it is modified and
-- @DeletionProtection@ is disabled. @DeletionProtection@ protects clusters
-- from being accidentally deleted.
createDBCluster_deletionProtection :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Bool)
createDBCluster_deletionProtection :: (Maybe Bool -> f (Maybe Bool))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_deletionProtection = (CreateDBCluster -> Maybe Bool)
-> (CreateDBCluster -> Maybe Bool -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Bool
deletionProtection :: Maybe Bool
$sel:deletionProtection:CreateDBCluster' :: CreateDBCluster -> Maybe Bool
deletionProtection} -> Maybe Bool
deletionProtection) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Bool
a -> CreateDBCluster
s {$sel:deletionProtection:CreateDBCluster' :: Maybe Bool
deletionProtection = Maybe Bool
a} :: CreateDBCluster)

-- | Specifies whether the cluster is encrypted.
createDBCluster_storageEncrypted :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Bool)
createDBCluster_storageEncrypted :: (Maybe Bool -> f (Maybe Bool))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_storageEncrypted = (CreateDBCluster -> Maybe Bool)
-> (CreateDBCluster -> Maybe Bool -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Bool
storageEncrypted :: Maybe Bool
$sel:storageEncrypted:CreateDBCluster' :: CreateDBCluster -> Maybe Bool
storageEncrypted} -> Maybe Bool
storageEncrypted) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Bool
a -> CreateDBCluster
s {$sel:storageEncrypted:CreateDBCluster' :: Maybe Bool
storageEncrypted = Maybe Bool
a} :: CreateDBCluster)

-- | The password for the master database user. This password can contain any
-- printable ASCII character except forward slash (\/), double quote (\"),
-- or the \"at\" symbol (\@).
--
-- Constraints: Must contain from 8 to 100 characters.
createDBCluster_masterUserPassword :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_masterUserPassword :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_masterUserPassword = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
masterUserPassword :: Maybe Text
$sel:masterUserPassword:CreateDBCluster' :: CreateDBCluster -> Maybe Text
masterUserPassword} -> Maybe Text
masterUserPassword) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:masterUserPassword:CreateDBCluster' :: Maybe Text
masterUserPassword = Maybe Text
a} :: CreateDBCluster)

-- | The cluster identifier of the new global cluster.
createDBCluster_globalClusterIdentifier :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_globalClusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_globalClusterIdentifier = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
globalClusterIdentifier :: Maybe Text
$sel:globalClusterIdentifier:CreateDBCluster' :: CreateDBCluster -> Maybe Text
globalClusterIdentifier} -> Maybe Text
globalClusterIdentifier) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:globalClusterIdentifier:CreateDBCluster' :: Maybe Text
globalClusterIdentifier = Maybe Text
a} :: CreateDBCluster)

-- | The name of the master user for the cluster.
--
-- Constraints:
--
-- -   Must be from 1 to 63 letters or numbers.
--
-- -   The first character must be a letter.
--
-- -   Cannot be a reserved word for the chosen database engine.
createDBCluster_masterUsername :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_masterUsername :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_masterUsername = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
masterUsername :: Maybe Text
$sel:masterUsername:CreateDBCluster' :: CreateDBCluster -> Maybe Text
masterUsername} -> Maybe Text
masterUsername) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:masterUsername:CreateDBCluster' :: Maybe Text
masterUsername = Maybe Text
a} :: CreateDBCluster)

-- | A subnet group to associate with this cluster.
--
-- Constraints: Must match the name of an existing @DBSubnetGroup@. Must
-- not be default.
--
-- Example: @mySubnetgroup@
createDBCluster_dbSubnetGroupName :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_dbSubnetGroupName :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_dbSubnetGroupName = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
dbSubnetGroupName :: Maybe Text
$sel:dbSubnetGroupName:CreateDBCluster' :: CreateDBCluster -> Maybe Text
dbSubnetGroupName} -> Maybe Text
dbSubnetGroupName) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:dbSubnetGroupName:CreateDBCluster' :: Maybe Text
dbSubnetGroupName = Maybe Text
a} :: CreateDBCluster)

-- | Not currently supported.
createDBCluster_preSignedUrl :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_preSignedUrl :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_preSignedUrl = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
preSignedUrl :: Maybe Text
$sel:preSignedUrl:CreateDBCluster' :: CreateDBCluster -> Maybe Text
preSignedUrl} -> Maybe Text
preSignedUrl) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:preSignedUrl:CreateDBCluster' :: Maybe Text
preSignedUrl = Maybe Text
a} :: CreateDBCluster)

-- | The weekly time range during which system maintenance can occur, in
-- Universal Coordinated Time (UTC).
--
-- Format: @ddd:hh24:mi-ddd:hh24:mi@
--
-- The default is a 30-minute window selected at random from an 8-hour
-- block of time for each Region, occurring on a random day of the week.
--
-- Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
--
-- Constraints: Minimum 30-minute window.
createDBCluster_preferredMaintenanceWindow :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_preferredMaintenanceWindow = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:CreateDBCluster' :: CreateDBCluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:preferredMaintenanceWindow:CreateDBCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: CreateDBCluster)

-- | A list of Amazon EC2 Availability Zones that instances in the cluster
-- can be created in.
createDBCluster_availabilityZones :: Lens.Lens' CreateDBCluster (Prelude.Maybe [Prelude.Text])
createDBCluster_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_availabilityZones = (CreateDBCluster -> Maybe [Text])
-> (CreateDBCluster -> Maybe [Text] -> CreateDBCluster)
-> Lens
     CreateDBCluster CreateDBCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe [Text]
a -> CreateDBCluster
s {$sel:availabilityZones:CreateDBCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: CreateDBCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateDBCluster -> f CreateDBCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster
-> f CreateDBCluster
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 KMS key identifier for an encrypted cluster.
--
-- The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
-- encryption key. If you are creating a cluster using the same account
-- that owns the KMS encryption key that is used to encrypt the new
-- cluster, you can use the KMS key alias instead of the ARN for the KMS
-- encryption key.
--
-- If an encryption key is not specified in @KmsKeyId@:
--
-- -   If the @StorageEncrypted@ parameter is @true@, Amazon DocumentDB
--     uses your default encryption key.
--
-- KMS creates the default encryption key for your account. Your account
-- has a different default encryption key for each Regions.
createDBCluster_kmsKeyId :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_kmsKeyId = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateDBCluster' :: CreateDBCluster -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:kmsKeyId:CreateDBCluster' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateDBCluster)

-- | The daily time range during which automated backups are created if
-- automated backups are enabled using the @BackupRetentionPeriod@
-- parameter.
--
-- The default is a 30-minute window selected at random from an 8-hour
-- block of time for each Region.
--
-- Constraints:
--
-- -   Must be in the format @hh24:mi-hh24:mi@.
--
-- -   Must be in Universal Coordinated Time (UTC).
--
-- -   Must not conflict with the preferred maintenance window.
--
-- -   Must be at least 30 minutes.
createDBCluster_preferredBackupWindow :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_preferredBackupWindow :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_preferredBackupWindow = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
preferredBackupWindow :: Maybe Text
$sel:preferredBackupWindow:CreateDBCluster' :: CreateDBCluster -> Maybe Text
preferredBackupWindow} -> Maybe Text
preferredBackupWindow) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:preferredBackupWindow:CreateDBCluster' :: Maybe Text
preferredBackupWindow = Maybe Text
a} :: CreateDBCluster)

-- | The number of days for which automated backups are retained. You must
-- specify a minimum value of 1.
--
-- Default: 1
--
-- Constraints:
--
-- -   Must be a value from 1 to 35.
createDBCluster_backupRetentionPeriod :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Int)
createDBCluster_backupRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_backupRetentionPeriod = (CreateDBCluster -> Maybe Int)
-> (CreateDBCluster -> Maybe Int -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Int
backupRetentionPeriod :: Maybe Int
$sel:backupRetentionPeriod:CreateDBCluster' :: CreateDBCluster -> Maybe Int
backupRetentionPeriod} -> Maybe Int
backupRetentionPeriod) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Int
a -> CreateDBCluster
s {$sel:backupRetentionPeriod:CreateDBCluster' :: Maybe Int
backupRetentionPeriod = Maybe Int
a} :: CreateDBCluster)

-- | A list of EC2 VPC security groups to associate with this cluster.
createDBCluster_vpcSecurityGroupIds :: Lens.Lens' CreateDBCluster (Prelude.Maybe [Prelude.Text])
createDBCluster_vpcSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_vpcSecurityGroupIds = (CreateDBCluster -> Maybe [Text])
-> (CreateDBCluster -> Maybe [Text] -> CreateDBCluster)
-> Lens
     CreateDBCluster CreateDBCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe [Text]
a -> CreateDBCluster
s {$sel:vpcSecurityGroupIds:CreateDBCluster' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: CreateDBCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateDBCluster -> f CreateDBCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster
-> f CreateDBCluster
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 name of the cluster parameter group to associate with this cluster.
createDBCluster_dbClusterParameterGroupName :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Text)
createDBCluster_dbClusterParameterGroupName :: (Maybe Text -> f (Maybe Text))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_dbClusterParameterGroupName = (CreateDBCluster -> Maybe Text)
-> (CreateDBCluster -> Maybe Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Text
dbClusterParameterGroupName :: Maybe Text
$sel:dbClusterParameterGroupName:CreateDBCluster' :: CreateDBCluster -> Maybe Text
dbClusterParameterGroupName} -> Maybe Text
dbClusterParameterGroupName) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Text
a -> CreateDBCluster
s {$sel:dbClusterParameterGroupName:CreateDBCluster' :: Maybe Text
dbClusterParameterGroupName = Maybe Text
a} :: CreateDBCluster)

-- | The tags to be assigned to the cluster.
createDBCluster_tags :: Lens.Lens' CreateDBCluster (Prelude.Maybe [Tag])
createDBCluster_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_tags = (CreateDBCluster -> Maybe [Tag])
-> (CreateDBCluster -> Maybe [Tag] -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDBCluster' :: CreateDBCluster -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe [Tag]
a -> CreateDBCluster
s {$sel:tags:CreateDBCluster' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDBCluster) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateDBCluster -> f CreateDBCluster)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDBCluster
-> f CreateDBCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The port number on which the instances in the cluster accept
-- connections.
createDBCluster_port :: Lens.Lens' CreateDBCluster (Prelude.Maybe Prelude.Int)
createDBCluster_port :: (Maybe Int -> f (Maybe Int))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_port = (CreateDBCluster -> Maybe Int)
-> (CreateDBCluster -> Maybe Int -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe Int
port :: Maybe Int
$sel:port:CreateDBCluster' :: CreateDBCluster -> Maybe Int
port} -> Maybe Int
port) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe Int
a -> CreateDBCluster
s {$sel:port:CreateDBCluster' :: Maybe Int
port = Maybe Int
a} :: CreateDBCluster)

-- | A list of log types that need to be enabled for exporting to Amazon
-- CloudWatch Logs. You can enable audit logs or profiler logs. For more
-- information, see
-- <https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html Auditing Amazon DocumentDB Events>
-- and
-- <https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html Profiling Amazon DocumentDB Operations>.
createDBCluster_enableCloudwatchLogsExports :: Lens.Lens' CreateDBCluster (Prelude.Maybe [Prelude.Text])
createDBCluster_enableCloudwatchLogsExports :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster -> f CreateDBCluster
createDBCluster_enableCloudwatchLogsExports = (CreateDBCluster -> Maybe [Text])
-> (CreateDBCluster -> Maybe [Text] -> CreateDBCluster)
-> Lens
     CreateDBCluster CreateDBCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Maybe [Text]
enableCloudwatchLogsExports :: Maybe [Text]
$sel:enableCloudwatchLogsExports:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
enableCloudwatchLogsExports} -> Maybe [Text]
enableCloudwatchLogsExports) (\s :: CreateDBCluster
s@CreateDBCluster' {} Maybe [Text]
a -> CreateDBCluster
s {$sel:enableCloudwatchLogsExports:CreateDBCluster' :: Maybe [Text]
enableCloudwatchLogsExports = Maybe [Text]
a} :: CreateDBCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateDBCluster -> f CreateDBCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateDBCluster
-> f CreateDBCluster
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 cluster identifier. This parameter is stored as a lowercase string.
--
-- Constraints:
--
-- -   Must contain from 1 to 63 letters, numbers, or hyphens.
--
-- -   The first character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
--
-- Example: @my-cluster@
createDBCluster_dbClusterIdentifier :: Lens.Lens' CreateDBCluster Prelude.Text
createDBCluster_dbClusterIdentifier :: (Text -> f Text) -> CreateDBCluster -> f CreateDBCluster
createDBCluster_dbClusterIdentifier = (CreateDBCluster -> Text)
-> (CreateDBCluster -> Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:CreateDBCluster' :: CreateDBCluster -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: CreateDBCluster
s@CreateDBCluster' {} Text
a -> CreateDBCluster
s {$sel:dbClusterIdentifier:CreateDBCluster' :: Text
dbClusterIdentifier = Text
a} :: CreateDBCluster)

-- | The name of the database engine to be used for this cluster.
--
-- Valid values: @docdb@
createDBCluster_engine :: Lens.Lens' CreateDBCluster Prelude.Text
createDBCluster_engine :: (Text -> f Text) -> CreateDBCluster -> f CreateDBCluster
createDBCluster_engine = (CreateDBCluster -> Text)
-> (CreateDBCluster -> Text -> CreateDBCluster)
-> Lens CreateDBCluster CreateDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBCluster' {Text
engine :: Text
$sel:engine:CreateDBCluster' :: CreateDBCluster -> Text
engine} -> Text
engine) (\s :: CreateDBCluster
s@CreateDBCluster' {} Text
a -> CreateDBCluster
s {$sel:engine:CreateDBCluster' :: Text
engine = Text
a} :: CreateDBCluster)

instance Core.AWSRequest CreateDBCluster where
  type
    AWSResponse CreateDBCluster =
      CreateDBClusterResponse
  request :: CreateDBCluster -> Request CreateDBCluster
request = Service -> CreateDBCluster -> Request CreateDBCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDBCluster)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateDBCluster))
-> Logger
-> Service
-> Proxy CreateDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDBCluster)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateDBClusterResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBCluster -> Int -> CreateDBClusterResponse
CreateDBClusterResponse'
            (Maybe DBCluster -> Int -> CreateDBClusterResponse)
-> Either String (Maybe DBCluster)
-> Either String (Int -> CreateDBClusterResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBCluster)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBCluster")
            Either String (Int -> CreateDBClusterResponse)
-> Either String Int -> Either String CreateDBClusterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateDBCluster

instance Prelude.NFData CreateDBCluster

instance Core.ToHeaders CreateDBCluster where
  toHeaders :: CreateDBCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateDBCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath CreateDBCluster where
  toPath :: CreateDBCluster -> ByteString
toPath = ByteString -> CreateDBCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateDBCluster where
  toQuery :: CreateDBCluster -> QueryString
toQuery CreateDBCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
engine :: Text
dbClusterIdentifier :: Text
enableCloudwatchLogsExports :: Maybe [Text]
port :: Maybe Int
tags :: Maybe [Tag]
dbClusterParameterGroupName :: Maybe Text
vpcSecurityGroupIds :: Maybe [Text]
backupRetentionPeriod :: Maybe Int
preferredBackupWindow :: Maybe Text
kmsKeyId :: Maybe Text
availabilityZones :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
preSignedUrl :: Maybe Text
dbSubnetGroupName :: Maybe Text
masterUsername :: Maybe Text
globalClusterIdentifier :: Maybe Text
masterUserPassword :: Maybe Text
storageEncrypted :: Maybe Bool
deletionProtection :: Maybe Bool
engineVersion :: Maybe Text
$sel:engine:CreateDBCluster' :: CreateDBCluster -> Text
$sel:dbClusterIdentifier:CreateDBCluster' :: CreateDBCluster -> Text
$sel:enableCloudwatchLogsExports:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
$sel:port:CreateDBCluster' :: CreateDBCluster -> Maybe Int
$sel:tags:CreateDBCluster' :: CreateDBCluster -> Maybe [Tag]
$sel:dbClusterParameterGroupName:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:vpcSecurityGroupIds:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
$sel:backupRetentionPeriod:CreateDBCluster' :: CreateDBCluster -> Maybe Int
$sel:preferredBackupWindow:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:kmsKeyId:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:availabilityZones:CreateDBCluster' :: CreateDBCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:preSignedUrl:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:dbSubnetGroupName:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:masterUsername:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:globalClusterIdentifier:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:masterUserPassword:CreateDBCluster' :: CreateDBCluster -> Maybe Text
$sel:storageEncrypted:CreateDBCluster' :: CreateDBCluster -> Maybe Bool
$sel:deletionProtection:CreateDBCluster' :: CreateDBCluster -> Maybe Bool
$sel:engineVersion:CreateDBCluster' :: CreateDBCluster -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateDBCluster" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"EngineVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engineVersion,
        ByteString
"DeletionProtection" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
deletionProtection,
        ByteString
"StorageEncrypted" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
storageEncrypted,
        ByteString
"MasterUserPassword" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
masterUserPassword,
        ByteString
"GlobalClusterIdentifier"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
globalClusterIdentifier,
        ByteString
"MasterUsername" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
masterUsername,
        ByteString
"DBSubnetGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbSubnetGroupName,
        ByteString
"PreSignedUrl" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preSignedUrl,
        ByteString
"PreferredMaintenanceWindow"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preferredMaintenanceWindow,
        ByteString
"AvailabilityZones"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"AvailabilityZone"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
availabilityZones
            ),
        ByteString
"KmsKeyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
kmsKeyId,
        ByteString
"PreferredBackupWindow"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preferredBackupWindow,
        ByteString
"BackupRetentionPeriod"
          ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
backupRetentionPeriod,
        ByteString
"VpcSecurityGroupIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"VpcSecurityGroupId"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpcSecurityGroupIds
            ),
        ByteString
"DBClusterParameterGroupName"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbClusterParameterGroupName,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"Port" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
port,
        ByteString
"EnableCloudwatchLogsExports"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
enableCloudwatchLogsExports
            ),
        ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier,
        ByteString
"Engine" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
engine
      ]

-- | /See:/ 'newCreateDBClusterResponse' smart constructor.
data CreateDBClusterResponse = CreateDBClusterResponse'
  { CreateDBClusterResponse -> Maybe DBCluster
dbCluster :: Prelude.Maybe DBCluster,
    -- | The response's http status code.
    CreateDBClusterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDBClusterResponse -> CreateDBClusterResponse -> Bool
(CreateDBClusterResponse -> CreateDBClusterResponse -> Bool)
-> (CreateDBClusterResponse -> CreateDBClusterResponse -> Bool)
-> Eq CreateDBClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDBClusterResponse -> CreateDBClusterResponse -> Bool
$c/= :: CreateDBClusterResponse -> CreateDBClusterResponse -> Bool
== :: CreateDBClusterResponse -> CreateDBClusterResponse -> Bool
$c== :: CreateDBClusterResponse -> CreateDBClusterResponse -> Bool
Prelude.Eq, ReadPrec [CreateDBClusterResponse]
ReadPrec CreateDBClusterResponse
Int -> ReadS CreateDBClusterResponse
ReadS [CreateDBClusterResponse]
(Int -> ReadS CreateDBClusterResponse)
-> ReadS [CreateDBClusterResponse]
-> ReadPrec CreateDBClusterResponse
-> ReadPrec [CreateDBClusterResponse]
-> Read CreateDBClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDBClusterResponse]
$creadListPrec :: ReadPrec [CreateDBClusterResponse]
readPrec :: ReadPrec CreateDBClusterResponse
$creadPrec :: ReadPrec CreateDBClusterResponse
readList :: ReadS [CreateDBClusterResponse]
$creadList :: ReadS [CreateDBClusterResponse]
readsPrec :: Int -> ReadS CreateDBClusterResponse
$creadsPrec :: Int -> ReadS CreateDBClusterResponse
Prelude.Read, Int -> CreateDBClusterResponse -> ShowS
[CreateDBClusterResponse] -> ShowS
CreateDBClusterResponse -> String
(Int -> CreateDBClusterResponse -> ShowS)
-> (CreateDBClusterResponse -> String)
-> ([CreateDBClusterResponse] -> ShowS)
-> Show CreateDBClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDBClusterResponse] -> ShowS
$cshowList :: [CreateDBClusterResponse] -> ShowS
show :: CreateDBClusterResponse -> String
$cshow :: CreateDBClusterResponse -> String
showsPrec :: Int -> CreateDBClusterResponse -> ShowS
$cshowsPrec :: Int -> CreateDBClusterResponse -> ShowS
Prelude.Show, (forall x.
 CreateDBClusterResponse -> Rep CreateDBClusterResponse x)
-> (forall x.
    Rep CreateDBClusterResponse x -> CreateDBClusterResponse)
-> Generic CreateDBClusterResponse
forall x. Rep CreateDBClusterResponse x -> CreateDBClusterResponse
forall x. CreateDBClusterResponse -> Rep CreateDBClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDBClusterResponse x -> CreateDBClusterResponse
$cfrom :: forall x. CreateDBClusterResponse -> Rep CreateDBClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDBClusterResponse' 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:
--
-- 'dbCluster', 'createDBClusterResponse_dbCluster' - Undocumented member.
--
-- 'httpStatus', 'createDBClusterResponse_httpStatus' - The response's http status code.
newCreateDBClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDBClusterResponse
newCreateDBClusterResponse :: Int -> CreateDBClusterResponse
newCreateDBClusterResponse Int
pHttpStatus_ =
  CreateDBClusterResponse' :: Maybe DBCluster -> Int -> CreateDBClusterResponse
CreateDBClusterResponse'
    { $sel:dbCluster:CreateDBClusterResponse' :: Maybe DBCluster
dbCluster =
        Maybe DBCluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDBClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createDBClusterResponse_dbCluster :: Lens.Lens' CreateDBClusterResponse (Prelude.Maybe DBCluster)
createDBClusterResponse_dbCluster :: (Maybe DBCluster -> f (Maybe DBCluster))
-> CreateDBClusterResponse -> f CreateDBClusterResponse
createDBClusterResponse_dbCluster = (CreateDBClusterResponse -> Maybe DBCluster)
-> (CreateDBClusterResponse
    -> Maybe DBCluster -> CreateDBClusterResponse)
-> Lens
     CreateDBClusterResponse
     CreateDBClusterResponse
     (Maybe DBCluster)
     (Maybe DBCluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBClusterResponse' {Maybe DBCluster
dbCluster :: Maybe DBCluster
$sel:dbCluster:CreateDBClusterResponse' :: CreateDBClusterResponse -> Maybe DBCluster
dbCluster} -> Maybe DBCluster
dbCluster) (\s :: CreateDBClusterResponse
s@CreateDBClusterResponse' {} Maybe DBCluster
a -> CreateDBClusterResponse
s {$sel:dbCluster:CreateDBClusterResponse' :: Maybe DBCluster
dbCluster = Maybe DBCluster
a} :: CreateDBClusterResponse)

-- | The response's http status code.
createDBClusterResponse_httpStatus :: Lens.Lens' CreateDBClusterResponse Prelude.Int
createDBClusterResponse_httpStatus :: (Int -> f Int)
-> CreateDBClusterResponse -> f CreateDBClusterResponse
createDBClusterResponse_httpStatus = (CreateDBClusterResponse -> Int)
-> (CreateDBClusterResponse -> Int -> CreateDBClusterResponse)
-> Lens CreateDBClusterResponse CreateDBClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDBClusterResponse' :: CreateDBClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDBClusterResponse
s@CreateDBClusterResponse' {} Int
a -> CreateDBClusterResponse
s {$sel:httpStatus:CreateDBClusterResponse' :: Int
httpStatus = Int
a} :: CreateDBClusterResponse)

instance Prelude.NFData CreateDBClusterResponse