{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_allocatedStorage,
    createReplicationInstance_autoMinorVersionUpgrade,
    createReplicationInstance_availabilityZone,
    createReplicationInstance_dnsNameServers,
    createReplicationInstance_engineVersion,
    createReplicationInstance_kmsKeyId,
    createReplicationInstance_multiAZ,
    createReplicationInstance_networkType,
    createReplicationInstance_preferredMaintenanceWindow,
    createReplicationInstance_publiclyAccessible,
    createReplicationInstance_replicationSubnetGroupIdentifier,
    createReplicationInstance_resourceIdentifier,
    createReplicationInstance_tags,
    createReplicationInstance_vpcSecurityGroupIds,
    createReplicationInstance_replicationInstanceIdentifier,
    createReplicationInstance_replicationInstanceClass,

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

    -- * Response Lenses
    createReplicationInstanceResponse_replicationInstance,
    createReplicationInstanceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types
import qualified Amazonka.Data as Data
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 amount of storage (in gigabytes) to be initially allocated for the
    -- replication instance.
    CreateReplicationInstance -> Maybe Int
allocatedStorage :: Prelude.Maybe Prelude.Int,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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 type of IP address protocol used by a replication instance, such as
    -- IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing.
    -- IPv6 only is not yet supported.
    CreateReplicationInstance -> Maybe Text
networkType :: 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,
    -- | 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 subnet group to associate with the replication instance.
    CreateReplicationInstance -> Maybe Text
replicationSubnetGroupIdentifier :: 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],
    -- | 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],
    -- | 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
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]
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
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.
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:
--
-- 'allocatedStorage', 'createReplicationInstance_allocatedStorage' - The amount of storage (in gigabytes) to be initially allocated for the
-- replication instance.
--
-- '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@
--
-- '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@
--
-- '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\"@
--
-- '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.
--
-- '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.
--
-- '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@.
--
-- 'networkType', 'createReplicationInstance_networkType' - The type of IP address protocol used by a replication instance, such as
-- IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing.
-- IPv6 only is not yet supported.
--
-- '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.
--
-- '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@.
--
-- 'replicationSubnetGroupIdentifier', 'createReplicationInstance_replicationSubnetGroupIdentifier' - A subnet group to associate with the replication instance.
--
-- '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.
--
-- '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.
--
-- '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'
      { $sel:allocatedStorage:CreateReplicationInstance' :: Maybe Int
allocatedStorage =
          forall a. Maybe a
Prelude.Nothing,
        $sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: Maybe Bool
autoMinorVersionUpgrade = forall a. Maybe a
Prelude.Nothing,
        $sel:availabilityZone:CreateReplicationInstance' :: Maybe Text
availabilityZone = forall a. Maybe a
Prelude.Nothing,
        $sel:dnsNameServers:CreateReplicationInstance' :: Maybe Text
dnsNameServers = forall a. Maybe a
Prelude.Nothing,
        $sel:engineVersion:CreateReplicationInstance' :: Maybe Text
engineVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateReplicationInstance' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
        $sel:multiAZ:CreateReplicationInstance' :: Maybe Bool
multiAZ = forall a. Maybe a
Prelude.Nothing,
        $sel:networkType:CreateReplicationInstance' :: Maybe Text
networkType = forall a. Maybe a
Prelude.Nothing,
        $sel:preferredMaintenanceWindow:CreateReplicationInstance' :: Maybe Text
preferredMaintenanceWindow = forall a. Maybe a
Prelude.Nothing,
        $sel:publiclyAccessible:CreateReplicationInstance' :: Maybe Bool
publiclyAccessible = forall a. Maybe a
Prelude.Nothing,
        $sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: Maybe Text
replicationSubnetGroupIdentifier =
          forall a. Maybe a
Prelude.Nothing,
        $sel:resourceIdentifier:CreateReplicationInstance' :: Maybe Text
resourceIdentifier = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateReplicationInstance' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcSecurityGroupIds:CreateReplicationInstance' :: Maybe [Text]
vpcSecurityGroupIds = forall a. Maybe a
Prelude.Nothing,
        $sel:replicationInstanceIdentifier:CreateReplicationInstance' :: Text
replicationInstanceIdentifier =
          Text
pReplicationInstanceIdentifier_,
        $sel:replicationInstanceClass:CreateReplicationInstance' :: Text
replicationInstanceClass =
          Text
pReplicationInstanceClass_
      }

-- | 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 :: Lens' CreateReplicationInstance (Maybe Int)
createReplicationInstance_allocatedStorage = 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 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 :: Lens' CreateReplicationInstance (Maybe Bool)
createReplicationInstance_autoMinorVersionUpgrade = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_availabilityZone = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_dnsNameServers = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_engineVersion = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_kmsKeyId = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Bool)
createReplicationInstance_multiAZ = 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 type of IP address protocol used by a replication instance, such as
-- IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing.
-- IPv6 only is not yet supported.
createReplicationInstance_networkType :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_networkType :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_networkType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateReplicationInstance' {Maybe Text
networkType :: Maybe Text
$sel:networkType:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
networkType} -> Maybe Text
networkType) (\s :: CreateReplicationInstance
s@CreateReplicationInstance' {} Maybe Text
a -> CreateReplicationInstance
s {$sel:networkType:CreateReplicationInstance' :: Maybe Text
networkType = 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_preferredMaintenanceWindow = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Bool)
createReplicationInstance_publiclyAccessible = 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 subnet group to associate with the replication instance.
createReplicationInstance_replicationSubnetGroupIdentifier :: Lens.Lens' CreateReplicationInstance (Prelude.Maybe Prelude.Text)
createReplicationInstance_replicationSubnetGroupIdentifier :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_replicationSubnetGroupIdentifier = 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)

-- | 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 :: Lens' CreateReplicationInstance (Maybe Text)
createReplicationInstance_resourceIdentifier = 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 :: Lens' CreateReplicationInstance (Maybe [Tag])
createReplicationInstance_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' CreateReplicationInstance (Maybe [Text])
createReplicationInstance_vpcSecurityGroupIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' CreateReplicationInstance Text
createReplicationInstance_replicationInstanceIdentifier = 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 :: Lens' CreateReplicationInstance Text
createReplicationInstance_replicationInstanceClass = 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 :: (Service -> Service)
-> CreateReplicationInstance -> Request CreateReplicationInstance
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateReplicationInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateReplicationInstance)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ReplicationInstance
-> Int -> CreateReplicationInstanceResponse
CreateReplicationInstanceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplicationInstance")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateReplicationInstance where
  hashWithSalt :: Int -> CreateReplicationInstance -> Int
hashWithSalt Int
_salt CreateReplicationInstance' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
replicationInstanceClass :: Text
replicationInstanceIdentifier :: Text
vpcSecurityGroupIds :: Maybe [Text]
tags :: Maybe [Tag]
resourceIdentifier :: Maybe Text
replicationSubnetGroupIdentifier :: Maybe Text
publiclyAccessible :: Maybe Bool
preferredMaintenanceWindow :: Maybe Text
networkType :: Maybe Text
multiAZ :: Maybe Bool
kmsKeyId :: Maybe Text
engineVersion :: Maybe Text
dnsNameServers :: Maybe Text
availabilityZone :: Maybe Text
autoMinorVersionUpgrade :: Maybe Bool
allocatedStorage :: Maybe Int
$sel:replicationInstanceClass:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:replicationInstanceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:vpcSecurityGroupIds:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Text]
$sel:tags:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Tag]
$sel:resourceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:publiclyAccessible:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:preferredMaintenanceWindow:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:networkType:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:multiAZ:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:kmsKeyId:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:engineVersion:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:dnsNameServers:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:availabilityZone:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:allocatedStorage:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
allocatedStorage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoMinorVersionUpgrade
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dnsNameServers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
multiAZ
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preferredMaintenanceWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
publiclyAccessible
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationSubnetGroupIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
vpcSecurityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
replicationInstanceIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
replicationInstanceClass

instance Prelude.NFData CreateReplicationInstance where
  rnf :: CreateReplicationInstance -> ()
rnf CreateReplicationInstance' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
replicationInstanceClass :: Text
replicationInstanceIdentifier :: Text
vpcSecurityGroupIds :: Maybe [Text]
tags :: Maybe [Tag]
resourceIdentifier :: Maybe Text
replicationSubnetGroupIdentifier :: Maybe Text
publiclyAccessible :: Maybe Bool
preferredMaintenanceWindow :: Maybe Text
networkType :: Maybe Text
multiAZ :: Maybe Bool
kmsKeyId :: Maybe Text
engineVersion :: Maybe Text
dnsNameServers :: Maybe Text
availabilityZone :: Maybe Text
autoMinorVersionUpgrade :: Maybe Bool
allocatedStorage :: Maybe Int
$sel:replicationInstanceClass:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:replicationInstanceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Text
$sel:vpcSecurityGroupIds:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Text]
$sel:tags:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe [Tag]
$sel:resourceIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:replicationSubnetGroupIdentifier:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:publiclyAccessible:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:preferredMaintenanceWindow:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:networkType:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:multiAZ:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:kmsKeyId:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:engineVersion:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:dnsNameServers:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:availabilityZone:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Text
$sel:autoMinorVersionUpgrade:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Bool
$sel:allocatedStorage:CreateReplicationInstance' :: CreateReplicationInstance -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
allocatedStorage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoMinorVersionUpgrade
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dnsNameServers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
multiAZ
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
preferredMaintenanceWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
publiclyAccessible
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationSubnetGroupIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
vpcSecurityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Text
replicationInstanceIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
replicationInstanceClass

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

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

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

instance Data.ToQuery CreateReplicationInstance where
  toQuery :: CreateReplicationInstance -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:replicationInstance:CreateReplicationInstanceResponse' :: Maybe ReplicationInstance
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 :: Lens' CreateReplicationInstanceResponse (Maybe ReplicationInstance)
createReplicationInstanceResponse_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 :: Lens' CreateReplicationInstanceResponse Int
createReplicationInstanceResponse_httpStatus = 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
  where
  rnf :: CreateReplicationInstanceResponse -> ()
rnf CreateReplicationInstanceResponse' {Int
Maybe ReplicationInstance
httpStatus :: Int
replicationInstance :: Maybe ReplicationInstance
$sel:httpStatus:CreateReplicationInstanceResponse' :: CreateReplicationInstanceResponse -> Int
$sel:replicationInstance:CreateReplicationInstanceResponse' :: CreateReplicationInstanceResponse -> Maybe ReplicationInstance
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplicationInstance
replicationInstance
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus