{-# 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.DMS.CreateReplicationInstance
-- 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 the replication instance using the specified parameters.
--
-- DMS requires that your account have certain roles with appropriate
-- permissions before you can create a replication instance. For
-- information on the required roles, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.APIRole Creating the IAM Roles to Use With the CLI and DMS API>.
-- For information on the required permissions, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.IAMPermissions IAM Permissions Needed to Use DMS>.
module Amazonka.DMS.CreateReplicationInstance
  ( -- * Creating a Request
    CreateReplicationInstance (..),
    newCreateReplicationInstance,

    -- * Request Lenses
    createReplicationInstance_engineVersion,
    createReplicationInstance_publiclyAccessible,
    createReplicationInstance_autoMinorVersionUpgrade,
    createReplicationInstance_replicationSubnetGroupIdentifier,
    createReplicationInstance_preferredMaintenanceWindow,
    createReplicationInstance_kmsKeyId,
    createReplicationInstance_availabilityZone,
    createReplicationInstance_vpcSecurityGroupIds,
    createReplicationInstance_multiAZ,
    createReplicationInstance_allocatedStorage,
    createReplicationInstance_dnsNameServers,
    createReplicationInstance_resourceIdentifier,
    createReplicationInstance_tags,
    createReplicationInstance_replicationInstanceIdentifier,
    createReplicationInstance_replicationInstanceClass,

    -- * Destructuring the Response
    CreateReplicationInstanceResponse (..),
    newCreateReplicationInstanceResponse,

    -- * Response Lenses
    createReplicationInstanceResponse_replicationInstance,
    createReplicationInstanceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DMS.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

-- |
--
-- /See:/ 'newCreateReplicationInstance' smart constructor.
data CreateReplicationInstance = CreateReplicationInstance'
  { -- | The engine version number of the replication instance.
    --
    -- If an engine version number is not specified when a replication instance
    -- is created, the default is the latest engine version available.
    CreateReplicationInstance -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies the accessibility options for the replication instance. A
    -- value of @true@ represents an instance with a public IP address. A value
    -- of @false@ represents an instance with a private IP address. The default
    -- value is @true@.
    CreateReplicationInstance -> Maybe Bool
publiclyAccessible :: Prelude.Maybe Prelude.Bool,
    -- | A value that indicates whether minor engine upgrades are applied
    -- automatically to the replication instance during the maintenance window.
    -- This parameter defaults to @true@.
    --
    -- Default: @true@
    CreateReplicationInstance -> Maybe Bool
autoMinorVersionUpgrade :: Prelude.Maybe Prelude.Bool,
    -- | A subnet group to associate with the replication instance.
    CreateReplicationInstance -> Maybe Text
replicationSubnetGroupIdentifier :: 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@
    --
    -- Default: A 30-minute window selected at random from an 8-hour block of
    -- time per Amazon Web Services Region, occurring on a random day of the
    -- week.
    --
    -- Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
    --
    -- Constraints: Minimum 30-minute window.
    CreateReplicationInstance -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | An KMS key identifier that is used to encrypt the data on the
    -- replication instance.
    --
    -- If you don\'t specify a value for the @KmsKeyId@ parameter, then DMS
    -- uses your default encryption key.
    --
    -- KMS creates the default encryption key for your Amazon Web Services
    -- account. Your Amazon Web Services account has a different default
    -- encryption key for each Amazon Web Services Region.
    CreateReplicationInstance -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone where the replication instance will be created.
    -- The default value is a random, system-chosen Availability Zone in the
    -- endpoint\'s Amazon Web Services Region, for example: @us-east-1d@
    CreateReplicationInstance -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | Specifies the VPC security group to be used with the replication
    -- instance. The VPC security group must work with the VPC containing the
    -- replication instance.
    CreateReplicationInstance -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Specifies whether the replication instance is a Multi-AZ deployment. You
    -- can\'t set the @AvailabilityZone@ parameter if the Multi-AZ parameter is
    -- set to @true@.
    CreateReplicationInstance -> Maybe Bool
multiAZ :: Prelude.Maybe Prelude.Bool,
    -- | The amount of storage (in gigabytes) to be initially allocated for the
    -- replication instance.
    CreateReplicationInstance -> Maybe Int
allocatedStorage :: Prelude.Maybe Prelude.Int,
    -- | A list of custom DNS name servers supported for the replication instance
    -- to access your on-premise source or target database. This list overrides
    -- the default name servers supported by the replication instance. You can
    -- specify a comma-separated list of internet addresses for up to four
    -- on-premise DNS name servers. For example:
    -- @\"1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4\"@
    CreateReplicationInstance -> Maybe Text
dnsNameServers :: Prelude.Maybe Prelude.Text,
    -- | A friendly name for the resource identifier at the end of the
    -- @EndpointArn@ response parameter that is returned in the created
    -- @Endpoint@ object. The value for this parameter can have up to 31
    -- characters. It can contain only ASCII letters, digits, and hyphen
    -- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
    -- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
    -- For example, this value might result in the @EndpointArn@ value
    -- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
    -- specify a @ResourceIdentifier@ value, DMS generates a default identifier
    -- value for the end of @EndpointArn@.
    CreateReplicationInstance -> Maybe Text
resourceIdentifier :: Prelude.Maybe Prelude.Text,
    -- | One or more tags to be assigned to the replication instance.
    CreateReplicationInstance -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The replication instance identifier. This parameter is stored as a
    -- lowercase string.
    --
    -- Constraints:
    --
    -- -   Must contain 1-63 alphanumeric characters or hyphens.
    --
    -- -   First character must be a letter.
    --
    -- -   Can\'t end with a hyphen or contain two consecutive hyphens.
    --
    -- Example: @myrepinstance@
    CreateReplicationInstance -> Text
replicationInstanceIdentifier :: Prelude.Text,
    -- | The compute and memory capacity of the replication instance as defined
    -- for the specified replication instance class. For example to specify the
    -- instance class dms.c4.large, set this parameter to @\"dms.c4.large\"@.
    --
    -- For more information on the settings and capacities for the available
    -- replication instance classes, see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth Selecting the right DMS replication instance for your migration>.
    CreateReplicationInstance -> Text
replicationInstanceClass :: Prelude.Text
  }
  deriving (CreateReplicationInstance -> CreateReplicationInstance -> Bool
(CreateReplicationInstance -> CreateReplicationInstance -> Bool)
-> (CreateReplicationInstance -> CreateReplicationInstance -> Bool)
-> Eq CreateReplicationInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateReplicationInstance -> CreateReplicationInstance -> Bool
$c/= :: CreateReplicationInstance -> CreateReplicationInstance -> Bool
== :: CreateReplicationInstance -> CreateReplicationInstance -> Bool
$c== :: CreateReplicationInstance -> CreateReplicationInstance -> Bool
Prelude.Eq, ReadPrec [CreateReplicationInstance]
ReadPrec CreateReplicationInstance
Int -> ReadS CreateReplicationInstance
ReadS [CreateReplicationInstance]
(Int -> ReadS CreateReplicationInstance)
-> ReadS [CreateReplicationInstance]
-> ReadPrec CreateReplicationInstance
-> ReadPrec [CreateReplicationInstance]
-> Read CreateReplicationInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateReplicationInstance]
$creadListPrec :: ReadPrec [CreateReplicationInstance]
readPrec :: ReadPrec CreateReplicationInstance
$creadPrec :: ReadPrec CreateReplicationInstance
readList :: ReadS [CreateReplicationInstance]
$creadList :: ReadS [CreateReplicationInstance]
readsPrec :: Int -> ReadS CreateReplicationInstance
$creadsPrec :: Int -> ReadS CreateReplicationInstance
Prelude.Read, Int -> CreateReplicationInstance -> ShowS
[CreateReplicationInstance] -> ShowS
CreateReplicationInstance -> String
(Int -> CreateReplicationInstance -> ShowS)
-> (CreateReplicationInstance -> String)
-> ([CreateReplicationInstance] -> ShowS)
-> Show CreateReplicationInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateReplicationInstance] -> ShowS
$cshowList :: [CreateReplicationInstance] -> ShowS
show :: CreateReplicationInstance -> String
$cshow :: CreateReplicationInstance -> String
showsPrec :: Int -> CreateReplicationInstance -> ShowS
$cshowsPrec :: Int -> CreateReplicationInstance -> ShowS
Prelude.Show, (forall x.
 CreateReplicationInstance -> Rep CreateReplicationInstance x)
-> (forall x.
    Rep CreateReplicationInstance x -> CreateReplicationInstance)
-> Generic CreateReplicationInstance
forall x.
Rep CreateReplicationInstance x -> CreateReplicationInstance
forall x.
CreateReplicationInstance -> Rep CreateReplicationInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateReplicationInstance x -> CreateReplicationInstance
$cfrom :: forall x.
CreateReplicationInstance -> Rep CreateReplicationInstance x
Prelude.Generic)

-- |
-- Create a value of 'CreateReplicationInstance' 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', 'createReplicationInstance_engineVersion' - The engine version number of the replication instance.
--
-- If an engine version number is not specified when a replication instance
-- is created, the default is the latest engine version available.
--
-- 'publiclyAccessible', 'createReplicationInstance_publiclyAccessible' - Specifies the accessibility options for the replication instance. A
-- value of @true@ represents an instance with a public IP address. A value
-- of @false@ represents an instance with a private IP address. The default
-- value is @true@.
--
-- 'autoMinorVersionUpgrade', 'createReplicationInstance_autoMinorVersionUpgrade' - A value that indicates whether minor engine upgrades are applied
-- automatically to the replication instance during the maintenance window.
-- This parameter defaults to @true@.
--
-- Default: @true@
--
-- 'replicationSubnetGroupIdentifier', 'createReplicationInstance_replicationSubnetGroupIdentifier' - A subnet group to associate with the replication instance.
--
-- 'preferredMaintenanceWindow', 'createReplicationInstance_preferredMaintenanceWindow' - The weekly time range during which system maintenance can occur, in
-- Universal Coordinated Time (UTC).
--
-- Format: @ddd:hh24:mi-ddd:hh24:mi@
--
-- Default: A 30-minute window selected at random from an 8-hour block of
-- time per Amazon Web Services Region, occurring on a random day of the
-- week.
--
-- Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
--
-- Constraints: Minimum 30-minute window.
--
-- 'kmsKeyId', 'createReplicationInstance_kmsKeyId' - An KMS key identifier that is used to encrypt the data on the
-- replication instance.
--
-- If you don\'t specify a value for the @KmsKeyId@ parameter, then DMS
-- uses your default encryption key.
--
-- KMS creates the default encryption key for your Amazon Web Services
-- account. Your Amazon Web Services account has a different default
-- encryption key for each Amazon Web Services Region.
--
-- 'availabilityZone', 'createReplicationInstance_availabilityZone' - The Availability Zone where the replication instance will be created.
-- The default value is a random, system-chosen Availability Zone in the
-- endpoint\'s Amazon Web Services Region, for example: @us-east-1d@
--
-- 'vpcSecurityGroupIds', 'createReplicationInstance_vpcSecurityGroupIds' - Specifies the VPC security group to be used with the replication
-- instance. The VPC security group must work with the VPC containing the
-- replication instance.
--
-- 'multiAZ', 'createReplicationInstance_multiAZ' - Specifies whether the replication instance is a Multi-AZ deployment. You
-- can\'t set the @AvailabilityZone@ parameter if the Multi-AZ parameter is
-- set to @true@.
--
-- 'allocatedStorage', 'createReplicationInstance_allocatedStorage' - The amount of storage (in gigabytes) to be initially allocated for the
-- replication instance.
--
-- 'dnsNameServers', 'createReplicationInstance_dnsNameServers' - A list of custom DNS name servers supported for the replication instance
-- to access your on-premise source or target database. This list overrides
-- the default name servers supported by the replication instance. You can
-- specify a comma-separated list of internet addresses for up to four
-- on-premise DNS name servers. For example:
-- @\"1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4\"@
--
-- 'resourceIdentifier', 'createReplicationInstance_resourceIdentifier' - A friendly name for the resource identifier at the end of the
-- @EndpointArn@ response parameter that is returned in the created
-- @Endpoint@ object. The value for this parameter can have up to 31
-- characters. It can contain only ASCII letters, digits, and hyphen
-- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
-- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
-- For example, this value might result in the @EndpointArn@ value
-- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
-- specify a @ResourceIdentifier@ value, DMS generates a default identifier
-- value for the end of @EndpointArn@.
--
-- 'tags', 'createReplicationInstance_tags' - One or more tags to be assigned to the replication instance.
--
-- 'replicationInstanceIdentifier', 'createReplicationInstance_replicationInstanceIdentifier' - The replication instance identifier. This parameter is stored as a
-- lowercase string.
--
-- Constraints:
--
-- -   Must contain 1-63 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
--
-- Example: @myrepinstance@
--
-- 'replicationInstanceClass', 'createReplicationInstance_replicationInstanceClass' - The compute and memory capacity of the replication instance as defined
-- for the specified replication instance class. For example to specify the
-- instance class dms.c4.large, set this parameter to @\"dms.c4.large\"@.
--
-- For more information on the settings and capacities for the available
-- replication instance classes, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth Selecting the right DMS replication instance for your migration>.
newCreateReplicationInstance ::
  -- | 'replicationInstanceIdentifier'
  Prelude.Text ->
  -- | 'replicationInstanceClass'
  Prelude.Text ->
  CreateReplicationInstance
newCreateReplicationInstance :: Text -> Text -> CreateReplicationInstance
newCreateReplicationInstance
  Text
pReplicationInstanceIdentifier_
  Text
pReplicationInstanceClass_ =
    CreateReplicationInstance' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> CreateReplicationInstance
CreateReplicationInstance'
      { $sel:engineVersion:CreateReplicationInstance' :: Maybe Text
engineVersion =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:publiclyAccessible:CreateReplicationInstance' :: Maybe Bool
publiclyAccessible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: Maybe Bool
autoMinorVersionUpgrade = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: Maybe Text
replicationSubnetGroupIdentifier =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:preferredMaintenanceWindow:CreateReplicationInstance' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateReplicationInstance' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:availabilityZone:CreateReplicationInstance' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcSecurityGroupIds:CreateReplicationInstance' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:multiAZ:CreateReplicationInstance' :: Maybe Bool
multiAZ = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:allocatedStorage:CreateReplicationInstance' :: Maybe Int
allocatedStorage = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:dnsNameServers:CreateReplicationInstance' :: Maybe Text
dnsNameServers = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceIdentifier:CreateReplicationInstance' :: Maybe Text
resourceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateReplicationInstance' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:replicationInstanceIdentifier:CreateReplicationInstance' :: Text
replicationInstanceIdentifier =
          Text
pReplicationInstanceIdentifier_,
        $sel:replicationInstanceClass:CreateReplicationInstance' :: Text
replicationInstanceClass =
          Text
pReplicationInstanceClass_
      }

-- | The engine version number of the replication instance.
--
-- If an engine version number is not specified when a replication instance
-- is created, the default is the latest engine version available.
createReplicationInstance_engineVersion :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_engineVersion :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_engineVersion = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:engineVersion:CreateReplicationInstance' :: Maybe Text
engineVersion = Maybe Text
a} :: CreateReplicationInstance)

-- | Specifies the accessibility options for the replication instance. A
-- value of @true@ represents an instance with a public IP address. A value
-- of @false@ represents an instance with a private IP address. The default
-- value is @true@.
createReplicationInstance_publiclyAccessible :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Bool)
createReplicationInstance_publiclyAccessible :: (Maybe Bool -> f (Maybe Bool))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_publiclyAccessible = (CreateReplicationInstance -> Maybe Bool)
-> (CreateReplicationInstance
    -> Maybe Bool -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Bool
publiclyAccessible :: Maybe Bool
$sel:publiclyAccessible:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
publiclyAccessible} -> Maybe Bool
publiclyAccessible) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Bool
a -> CreateReplicationInstance
s {$sel:publiclyAccessible:CreateReplicationInstance' :: Maybe Bool
publiclyAccessible = Maybe Bool
a} :: CreateReplicationInstance)

-- | A value that indicates whether minor engine upgrades are applied
-- automatically to the replication instance during the maintenance window.
-- This parameter defaults to @true@.
--
-- Default: @true@
createReplicationInstance_autoMinorVersionUpgrade :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Bool)
createReplicationInstance_autoMinorVersionUpgrade :: (Maybe Bool -> f (Maybe Bool))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_autoMinorVersionUpgrade = (CreateReplicationInstance -> Maybe Bool)
-> (CreateReplicationInstance
    -> Maybe Bool -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
autoMinorVersionUpgrade} -> Maybe Bool
autoMinorVersionUpgrade) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Bool
a -> CreateReplicationInstance
s {$sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: Maybe Bool
autoMinorVersionUpgrade = Maybe Bool
a} :: CreateReplicationInstance)

-- | A subnet group to associate with the replication instance.
createReplicationInstance_replicationSubnetGroupIdentifier :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_replicationSubnetGroupIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_replicationSubnetGroupIdentifier = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
replicationSubnetGroupIdentifier :: Maybe Text
$sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
replicationSubnetGroupIdentifier} -> Maybe Text
replicationSubnetGroupIdentifier) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: Maybe Text
replicationSubnetGroupIdentifier = Maybe Text
a} :: CreateReplicationInstance)

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

-- | An KMS key identifier that is used to encrypt the data on the
-- replication instance.
--
-- If you don\'t specify a value for the @KmsKeyId@ parameter, then DMS
-- uses your default encryption key.
--
-- KMS creates the default encryption key for your Amazon Web Services
-- account. Your Amazon Web Services account has a different default
-- encryption key for each Amazon Web Services Region.
createReplicationInstance_kmsKeyId :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_kmsKeyId = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:kmsKeyId:CreateReplicationInstance' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateReplicationInstance)

-- | The Availability Zone where the replication instance will be created.
-- The default value is a random, system-chosen Availability Zone in the
-- endpoint\'s Amazon Web Services Region, for example: @us-east-1d@
createReplicationInstance_availabilityZone :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_availabilityZone = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:availabilityZone:CreateReplicationInstance' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateReplicationInstance)

-- | Specifies the VPC security group to be used with the replication
-- instance. The VPC security group must work with the VPC containing the
-- replication instance.
createReplicationInstance_vpcSecurityGroupIds :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe [Prelude.Text])
createReplicationInstance_vpcSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_vpcSecurityGroupIds = (CreateReplicationInstance -> Maybe [Text])
-> (CreateReplicationInstance
    -> Maybe [Text] -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe [Text]
a -> CreateReplicationInstance
s {$sel:vpcSecurityGroupIds:CreateReplicationInstance' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: CreateReplicationInstance) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateReplicationInstance -> f CreateReplicationInstance)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateReplicationInstance
-> f CreateReplicationInstance
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

-- | Specifies whether the replication instance is a Multi-AZ deployment. You
-- can\'t set the @AvailabilityZone@ parameter if the Multi-AZ parameter is
-- set to @true@.
createReplicationInstance_multiAZ :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Bool)
createReplicationInstance_multiAZ :: (Maybe Bool -> f (Maybe Bool))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_multiAZ = (CreateReplicationInstance -> Maybe Bool)
-> (CreateReplicationInstance
    -> Maybe Bool -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Bool
multiAZ :: Maybe Bool
$sel:multiAZ:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
multiAZ} -> Maybe Bool
multiAZ) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Bool
a -> CreateReplicationInstance
s {$sel:multiAZ:CreateReplicationInstance' :: Maybe Bool
multiAZ = Maybe Bool
a} :: CreateReplicationInstance)

-- | The amount of storage (in gigabytes) to be initially allocated for the
-- replication instance.
createReplicationInstance_allocatedStorage :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Int)
createReplicationInstance_allocatedStorage :: (Maybe Int -> f (Maybe Int))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_allocatedStorage = (CreateReplicationInstance -> Maybe Int)
-> (CreateReplicationInstance
    -> Maybe Int -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Int
allocatedStorage :: Maybe Int
$sel:allocatedStorage:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Int
allocatedStorage} -> Maybe Int
allocatedStorage) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Int
a -> CreateReplicationInstance
s {$sel:allocatedStorage:CreateReplicationInstance' :: Maybe Int
allocatedStorage = Maybe Int
a} :: CreateReplicationInstance)

-- | A list of custom DNS name servers supported for the replication instance
-- to access your on-premise source or target database. This list overrides
-- the default name servers supported by the replication instance. You can
-- specify a comma-separated list of internet addresses for up to four
-- on-premise DNS name servers. For example:
-- @\"1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4\"@
createReplicationInstance_dnsNameServers :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_dnsNameServers :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_dnsNameServers = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
dnsNameServers :: Maybe Text
$sel:dnsNameServers:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
dnsNameServers} -> Maybe Text
dnsNameServers) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:dnsNameServers:CreateReplicationInstance' :: Maybe Text
dnsNameServers = Maybe Text
a} :: CreateReplicationInstance)

-- | A friendly name for the resource identifier at the end of the
-- @EndpointArn@ response parameter that is returned in the created
-- @Endpoint@ object. The value for this parameter can have up to 31
-- characters. It can contain only ASCII letters, digits, and hyphen
-- (\'-\'). Also, it can\'t end with a hyphen or contain two consecutive
-- hyphens, and can only begin with a letter, such as @Example-App-ARN1@.
-- For example, this value might result in the @EndpointArn@ value
-- @arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1@. If you don\'t
-- specify a @ResourceIdentifier@ value, DMS generates a default identifier
-- value for the end of @EndpointArn@.
createReplicationInstance_resourceIdentifier :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_resourceIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_resourceIdentifier = (CreateReplicationInstance -> Maybe Text)
-> (CreateReplicationInstance
    -> Maybe Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
resourceIdentifier :: Maybe Text
$sel:resourceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
resourceIdentifier} -> Maybe Text
resourceIdentifier) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:resourceIdentifier:CreateReplicationInstance' :: Maybe Text
resourceIdentifier = Maybe Text
a} :: CreateReplicationInstance)

-- | One or more tags to be assigned to the replication instance.
createReplicationInstance_tags :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe [Tag])
createReplicationInstance_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_tags = (CreateReplicationInstance -> Maybe [Tag])
-> (CreateReplicationInstance
    -> Maybe [Tag] -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance
     CreateReplicationInstance
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe [Tag]
a -> CreateReplicationInstance
s {$sel:tags:CreateReplicationInstance' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateReplicationInstance) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateReplicationInstance -> f CreateReplicationInstance)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateReplicationInstance
-> f CreateReplicationInstance
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 replication instance identifier. This parameter is stored as a
-- lowercase string.
--
-- Constraints:
--
-- -   Must contain 1-63 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
--
-- Example: @myrepinstance@
createReplicationInstance_replicationInstanceIdentifier :: Lens.Lens' CreateReplicationInstance Prelude.Text
createReplicationInstance_replicationInstanceIdentifier :: (Text -> f Text)
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_replicationInstanceIdentifier = (CreateReplicationInstance -> Text)
-> (CreateReplicationInstance -> Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance CreateReplicationInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Text
replicationInstanceIdentifier :: Text
$sel:replicationInstanceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Text
replicationInstanceIdentifier} -> Text
replicationInstanceIdentifier) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Text
a -> CreateReplicationInstance
s {$sel:replicationInstanceIdentifier:CreateReplicationInstance' :: Text
replicationInstanceIdentifier = Text
a} :: CreateReplicationInstance)

-- | The compute and memory capacity of the replication instance as defined
-- for the specified replication instance class. For example to specify the
-- instance class dms.c4.large, set this parameter to @\"dms.c4.large\"@.
--
-- For more information on the settings and capacities for the available
-- replication instance classes, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth Selecting the right DMS replication instance for your migration>.
createReplicationInstance_replicationInstanceClass :: Lens.Lens' CreateReplicationInstance Prelude.Text
createReplicationInstance_replicationInstanceClass :: (Text -> f Text)
-> CreateReplicationInstance -> f CreateReplicationInstance
createReplicationInstance_replicationInstanceClass = (CreateReplicationInstance -> Text)
-> (CreateReplicationInstance -> Text -> CreateReplicationInstance)
-> Lens
     CreateReplicationInstance CreateReplicationInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Text
replicationInstanceClass :: Text
$sel:replicationInstanceClass:CreateReplicationInstance' :: CreateReplicationInstance -> Text
replicationInstanceClass} -> Text
replicationInstanceClass) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Text
a -> CreateReplicationInstance
s {$sel:replicationInstanceClass:CreateReplicationInstance' :: Text
replicationInstanceClass = Text
a} :: CreateReplicationInstance)

instance Core.AWSRequest CreateReplicationInstance where
  type
    AWSResponse CreateReplicationInstance =
      CreateReplicationInstanceResponse
  request :: CreateReplicationInstance -> Request CreateReplicationInstance
request = Service
-> CreateReplicationInstance -> Request CreateReplicationInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateReplicationInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateReplicationInstance)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateReplicationInstance))
-> Logger
-> Service
-> Proxy CreateReplicationInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateReplicationInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ReplicationInstance
-> Int -> CreateReplicationInstanceResponse
CreateReplicationInstanceResponse'
            (Maybe ReplicationInstance
 -> Int -> CreateReplicationInstanceResponse)
-> Either String (Maybe ReplicationInstance)
-> Either String (Int -> CreateReplicationInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReplicationInstance)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReplicationInstance")
            Either String (Int -> CreateReplicationInstanceResponse)
-> Either String Int
-> Either String CreateReplicationInstanceResponse
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 CreateReplicationInstance

instance Prelude.NFData CreateReplicationInstance

instance Core.ToHeaders CreateReplicationInstance where
  toHeaders :: CreateReplicationInstance -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateReplicationInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.CreateReplicationInstance" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateReplicationInstance where
  toJSON :: CreateReplicationInstance -> Value
toJSON CreateReplicationInstance' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
replicationInstanceClass :: Text
replicationInstanceIdentifier :: Text
tags :: Maybe [Tag]
resourceIdentifier :: Maybe Text
dnsNameServers :: Maybe Text
allocatedStorage :: Maybe Int
multiAZ :: Maybe Bool
vpcSecurityGroupIds :: Maybe [Text]
availabilityZone :: Maybe Text
kmsKeyId :: Maybe Text
preferredMaintenanceWindow :: Maybe Text
replicationSubnetGroupIdentifier :: Maybe Text
autoMinorVersionUpgrade :: Maybe Bool
publiclyAccessible :: Maybe Bool
engineVersion :: Maybe Text
$sel:replicationInstanceClass:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:replicationInstanceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:tags:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Tag]
$sel:resourceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:dnsNameServers:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:allocatedStorage:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Int
$sel:multiAZ:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:vpcSecurityGroupIds:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Text]
$sel:availabilityZone:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:kmsKeyId:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:preferredMaintenanceWindow:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:publiclyAccessible:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:engineVersion:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EngineVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
engineVersion,
            (Text
"PubliclyAccessible" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
publiclyAccessible,
            (Text
"AutoMinorVersionUpgrade" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoMinorVersionUpgrade,
            (Text
"ReplicationSubnetGroupIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replicationSubnetGroupIdentifier,
            (Text
"PreferredMaintenanceWindow" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
preferredMaintenanceWindow,
            (Text
"KmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Text
"AvailabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone,
            (Text
"VpcSecurityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpcSecurityGroupIds,
            (Text
"MultiAZ" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
multiAZ,
            (Text
"AllocatedStorage" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
allocatedStorage,
            (Text
"DnsNameServers" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dnsNameServers,
            (Text
"ResourceIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceIdentifier,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ReplicationInstanceIdentifier"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationInstanceIdentifier
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ReplicationInstanceClass"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationInstanceClass
              )
          ]
      )

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

instance Core.ToQuery CreateReplicationInstance where
  toQuery :: CreateReplicationInstance -> QueryString
toQuery = QueryString -> CreateReplicationInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'CreateReplicationInstanceResponse' 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:
--
-- 'replicationInstance', 'createReplicationInstanceResponse_replicationInstance' - The replication instance that was created.
--
-- 'httpStatus', 'createReplicationInstanceResponse_httpStatus' - The response's http status code.
newCreateReplicationInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateReplicationInstanceResponse
newCreateReplicationInstanceResponse :: Int -> CreateReplicationInstanceResponse
newCreateReplicationInstanceResponse Int
pHttpStatus_ =
  CreateReplicationInstanceResponse' :: Maybe ReplicationInstance
-> Int -> CreateReplicationInstanceResponse
CreateReplicationInstanceResponse'
    { $sel:replicationInstance:CreateReplicationInstanceResponse' :: Maybe ReplicationInstance
replicationInstance =
        Maybe ReplicationInstance
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateReplicationInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The replication instance that was created.
createReplicationInstanceResponse_replicationInstance :: Lens.Lens' CreateReplicationInstanceResponse (Prelude.Maybe ReplicationInstance)
createReplicationInstanceResponse_replicationInstance :: (Maybe ReplicationInstance -> f (Maybe ReplicationInstance))
-> CreateReplicationInstanceResponse
-> f CreateReplicationInstanceResponse
createReplicationInstanceResponse_replicationInstance = (CreateReplicationInstanceResponse -> Maybe ReplicationInstance)
-> (CreateReplicationInstanceResponse
    -> Maybe ReplicationInstance -> CreateReplicationInstanceResponse)
-> Lens
     CreateReplicationInstanceResponse
     CreateReplicationInstanceResponse
     (Maybe ReplicationInstance)
     (Maybe ReplicationInstance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstanceResponse' {Maybe ReplicationInstance
replicationInstance :: Maybe ReplicationInstance
$sel:replicationInstance:CreateReplicationInstanceResponse' :: CreateReplicationInstanceResponse -> Maybe ReplicationInstance
replicationInstance} -> Maybe ReplicationInstance
replicationInstance) (\s :: CreateReplicationInstanceResponse
s@CreateReplicationInstanceResponse' {} Maybe ReplicationInstance
a -> CreateReplicationInstanceResponse
s {$sel:replicationInstance:CreateReplicationInstanceResponse' :: Maybe ReplicationInstance
replicationInstance = Maybe ReplicationInstance
a} :: CreateReplicationInstanceResponse)

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

instance
  Prelude.NFData
    CreateReplicationInstanceResponse