{-# 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.DAX.CreateCluster
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a DAX cluster. All nodes in the cluster run the same DAX caching
-- software.
module Amazonka.DAX.CreateCluster
  ( -- * Creating a Request
    CreateCluster (..),
    newCreateCluster,

    -- * Request Lenses
    createCluster_securityGroupIds,
    createCluster_sSESpecification,
    createCluster_subnetGroupName,
    createCluster_clusterEndpointEncryptionType,
    createCluster_preferredMaintenanceWindow,
    createCluster_availabilityZones,
    createCluster_description,
    createCluster_notificationTopicArn,
    createCluster_tags,
    createCluster_parameterGroupName,
    createCluster_clusterName,
    createCluster_nodeType,
    createCluster_replicationFactor,
    createCluster_iamRoleArn,

    -- * Destructuring the Response
    CreateClusterResponse (..),
    newCreateClusterResponse,

    -- * Response Lenses
    createClusterResponse_cluster,
    createClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DAX.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:/ 'newCreateCluster' smart constructor.
data CreateCluster = CreateCluster'
  { -- | A list of security group IDs to be assigned to each node in the DAX
    -- cluster. (Each of the security group ID is system-generated.)
    --
    -- If this parameter is not specified, DAX assigns the default VPC security
    -- group to each node.
    CreateCluster -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Represents the settings used to enable server-side encryption on the
    -- cluster.
    CreateCluster -> Maybe SSESpecification
sSESpecification :: Prelude.Maybe SSESpecification,
    -- | The name of the subnet group to be used for the replication group.
    --
    -- DAX clusters can only run in an Amazon VPC environment. All of the
    -- subnets that you specify in a subnet group must exist in the same VPC.
    CreateCluster -> Maybe Text
subnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The type of encryption the cluster\'s endpoint should support. Values
    -- are:
    --
    -- -   @NONE@ for no encryption
    --
    -- -   @TLS@ for Transport Layer Security
    CreateCluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Prelude.Maybe ClusterEndpointEncryptionType,
    -- | Specifies the weekly time range during which maintenance on the DAX
    -- cluster is performed. It is specified as a range in the format
    -- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
    -- is a 60 minute period. Valid values for @ddd@ are:
    --
    -- -   @sun@
    --
    -- -   @mon@
    --
    -- -   @tue@
    --
    -- -   @wed@
    --
    -- -   @thu@
    --
    -- -   @fri@
    --
    -- -   @sat@
    --
    -- Example: @sun:05:00-sun:09:00@
    --
    -- If you don\'t specify a preferred maintenance window when you create or
    -- modify a cache cluster, DAX assigns a 60-minute maintenance window on a
    -- randomly selected day of the week.
    CreateCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zones (AZs) in which the cluster nodes will reside
    -- after the cluster has been created or updated. If provided, the length
    -- of this list must equal the @ReplicationFactor@ parameter. If you omit
    -- this parameter, DAX will spread the nodes across Availability Zones for
    -- the highest availability.
    CreateCluster -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text],
    -- | A description of the cluster.
    CreateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon SNS topic to which
    -- notifications will be sent.
    --
    -- The Amazon SNS topic owner must be same as the DAX cluster owner.
    CreateCluster -> Maybe Text
notificationTopicArn :: Prelude.Maybe Prelude.Text,
    -- | A set of tags to associate with the DAX cluster.
    CreateCluster -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The parameter group to be associated with the DAX cluster.
    CreateCluster -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The cluster identifier. This parameter is stored as a lowercase string.
    --
    -- __Constraints:__
    --
    -- -   A name must contain from 1 to 20 alphanumeric characters or hyphens.
    --
    -- -   The first character must be a letter.
    --
    -- -   A name cannot end with a hyphen or contain two consecutive hyphens.
    CreateCluster -> Text
clusterName :: Prelude.Text,
    -- | The compute and memory capacity of the nodes in the cluster.
    CreateCluster -> Text
nodeType :: Prelude.Text,
    -- | The number of nodes in the DAX cluster. A replication factor of 1 will
    -- create a single-node cluster, without any read replicas. For additional
    -- fault tolerance, you can create a multiple node cluster with one or more
    -- read replicas. To do this, set @ReplicationFactor@ to a number between 3
    -- (one primary and two read replicas) and 10 (one primary and nine read
    -- replicas). @If the AvailabilityZones@ parameter is provided, its length
    -- must equal the @ReplicationFactor@.
    --
    -- AWS recommends that you have at least two read replicas per cluster.
    CreateCluster -> Int
replicationFactor :: Prelude.Int,
    -- | A valid Amazon Resource Name (ARN) that identifies an IAM role. At
    -- runtime, DAX will assume this role and use the role\'s permissions to
    -- access DynamoDB on your behalf.
    CreateCluster -> Text
iamRoleArn :: Prelude.Text
  }
  deriving (CreateCluster -> CreateCluster -> Bool
(CreateCluster -> CreateCluster -> Bool)
-> (CreateCluster -> CreateCluster -> Bool) -> Eq CreateCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCluster -> CreateCluster -> Bool
$c/= :: CreateCluster -> CreateCluster -> Bool
== :: CreateCluster -> CreateCluster -> Bool
$c== :: CreateCluster -> CreateCluster -> Bool
Prelude.Eq, ReadPrec [CreateCluster]
ReadPrec CreateCluster
Int -> ReadS CreateCluster
ReadS [CreateCluster]
(Int -> ReadS CreateCluster)
-> ReadS [CreateCluster]
-> ReadPrec CreateCluster
-> ReadPrec [CreateCluster]
-> Read CreateCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCluster]
$creadListPrec :: ReadPrec [CreateCluster]
readPrec :: ReadPrec CreateCluster
$creadPrec :: ReadPrec CreateCluster
readList :: ReadS [CreateCluster]
$creadList :: ReadS [CreateCluster]
readsPrec :: Int -> ReadS CreateCluster
$creadsPrec :: Int -> ReadS CreateCluster
Prelude.Read, Int -> CreateCluster -> ShowS
[CreateCluster] -> ShowS
CreateCluster -> String
(Int -> CreateCluster -> ShowS)
-> (CreateCluster -> String)
-> ([CreateCluster] -> ShowS)
-> Show CreateCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCluster] -> ShowS
$cshowList :: [CreateCluster] -> ShowS
show :: CreateCluster -> String
$cshow :: CreateCluster -> String
showsPrec :: Int -> CreateCluster -> ShowS
$cshowsPrec :: Int -> CreateCluster -> ShowS
Prelude.Show, (forall x. CreateCluster -> Rep CreateCluster x)
-> (forall x. Rep CreateCluster x -> CreateCluster)
-> Generic CreateCluster
forall x. Rep CreateCluster x -> CreateCluster
forall x. CreateCluster -> Rep CreateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCluster x -> CreateCluster
$cfrom :: forall x. CreateCluster -> Rep CreateCluster x
Prelude.Generic)

-- |
-- Create a value of 'CreateCluster' 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:
--
-- 'securityGroupIds', 'createCluster_securityGroupIds' - A list of security group IDs to be assigned to each node in the DAX
-- cluster. (Each of the security group ID is system-generated.)
--
-- If this parameter is not specified, DAX assigns the default VPC security
-- group to each node.
--
-- 'sSESpecification', 'createCluster_sSESpecification' - Represents the settings used to enable server-side encryption on the
-- cluster.
--
-- 'subnetGroupName', 'createCluster_subnetGroupName' - The name of the subnet group to be used for the replication group.
--
-- DAX clusters can only run in an Amazon VPC environment. All of the
-- subnets that you specify in a subnet group must exist in the same VPC.
--
-- 'clusterEndpointEncryptionType', 'createCluster_clusterEndpointEncryptionType' - The type of encryption the cluster\'s endpoint should support. Values
-- are:
--
-- -   @NONE@ for no encryption
--
-- -   @TLS@ for Transport Layer Security
--
-- 'preferredMaintenanceWindow', 'createCluster_preferredMaintenanceWindow' - Specifies the weekly time range during which maintenance on the DAX
-- cluster is performed. It is specified as a range in the format
-- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
-- is a 60 minute period. Valid values for @ddd@ are:
--
-- -   @sun@
--
-- -   @mon@
--
-- -   @tue@
--
-- -   @wed@
--
-- -   @thu@
--
-- -   @fri@
--
-- -   @sat@
--
-- Example: @sun:05:00-sun:09:00@
--
-- If you don\'t specify a preferred maintenance window when you create or
-- modify a cache cluster, DAX assigns a 60-minute maintenance window on a
-- randomly selected day of the week.
--
-- 'availabilityZones', 'createCluster_availabilityZones' - The Availability Zones (AZs) in which the cluster nodes will reside
-- after the cluster has been created or updated. If provided, the length
-- of this list must equal the @ReplicationFactor@ parameter. If you omit
-- this parameter, DAX will spread the nodes across Availability Zones for
-- the highest availability.
--
-- 'description', 'createCluster_description' - A description of the cluster.
--
-- 'notificationTopicArn', 'createCluster_notificationTopicArn' - The Amazon Resource Name (ARN) of the Amazon SNS topic to which
-- notifications will be sent.
--
-- The Amazon SNS topic owner must be same as the DAX cluster owner.
--
-- 'tags', 'createCluster_tags' - A set of tags to associate with the DAX cluster.
--
-- 'parameterGroupName', 'createCluster_parameterGroupName' - The parameter group to be associated with the DAX cluster.
--
-- 'clusterName', 'createCluster_clusterName' - The cluster identifier. This parameter is stored as a lowercase string.
--
-- __Constraints:__
--
-- -   A name must contain from 1 to 20 alphanumeric characters or hyphens.
--
-- -   The first character must be a letter.
--
-- -   A name cannot end with a hyphen or contain two consecutive hyphens.
--
-- 'nodeType', 'createCluster_nodeType' - The compute and memory capacity of the nodes in the cluster.
--
-- 'replicationFactor', 'createCluster_replicationFactor' - The number of nodes in the DAX cluster. A replication factor of 1 will
-- create a single-node cluster, without any read replicas. For additional
-- fault tolerance, you can create a multiple node cluster with one or more
-- read replicas. To do this, set @ReplicationFactor@ to a number between 3
-- (one primary and two read replicas) and 10 (one primary and nine read
-- replicas). @If the AvailabilityZones@ parameter is provided, its length
-- must equal the @ReplicationFactor@.
--
-- AWS recommends that you have at least two read replicas per cluster.
--
-- 'iamRoleArn', 'createCluster_iamRoleArn' - A valid Amazon Resource Name (ARN) that identifies an IAM role. At
-- runtime, DAX will assume this role and use the role\'s permissions to
-- access DynamoDB on your behalf.
newCreateCluster ::
  -- | 'clusterName'
  Prelude.Text ->
  -- | 'nodeType'
  Prelude.Text ->
  -- | 'replicationFactor'
  Prelude.Int ->
  -- | 'iamRoleArn'
  Prelude.Text ->
  CreateCluster
newCreateCluster :: Text -> Text -> Int -> Text -> CreateCluster
newCreateCluster
  Text
pClusterName_
  Text
pNodeType_
  Int
pReplicationFactor_
  Text
pIamRoleArn_ =
    CreateCluster' :: Maybe [Text]
-> Maybe SSESpecification
-> Maybe Text
-> Maybe ClusterEndpointEncryptionType
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Text
-> Text
-> Int
-> Text
-> CreateCluster
CreateCluster'
      { $sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:sSESpecification:CreateCluster' :: Maybe SSESpecification
sSESpecification = Maybe SSESpecification
forall a. Maybe a
Prelude.Nothing,
        $sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clusterEndpointEncryptionType:CreateCluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = Maybe ClusterEndpointEncryptionType
forall a. Maybe a
Prelude.Nothing,
        $sel:preferredMaintenanceWindow:CreateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:availabilityZones:CreateCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:notificationTopicArn:CreateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateCluster' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clusterName:CreateCluster' :: Text
clusterName = Text
pClusterName_,
        $sel:nodeType:CreateCluster' :: Text
nodeType = Text
pNodeType_,
        $sel:replicationFactor:CreateCluster' :: Int
replicationFactor = Int
pReplicationFactor_,
        $sel:iamRoleArn:CreateCluster' :: Text
iamRoleArn = Text
pIamRoleArn_
      }

-- | A list of security group IDs to be assigned to each node in the DAX
-- cluster. (Each of the security group ID is system-generated.)
--
-- If this parameter is not specified, DAX assigns the default VPC security
-- group to each node.
createCluster_securityGroupIds :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster
createCluster_securityGroupIds = (CreateCluster -> Maybe [Text])
-> (CreateCluster -> Maybe [Text] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateCluster -> f CreateCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster
-> f CreateCluster
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

-- | Represents the settings used to enable server-side encryption on the
-- cluster.
createCluster_sSESpecification :: Lens.Lens' CreateCluster (Prelude.Maybe SSESpecification)
createCluster_sSESpecification :: (Maybe SSESpecification -> f (Maybe SSESpecification))
-> CreateCluster -> f CreateCluster
createCluster_sSESpecification = (CreateCluster -> Maybe SSESpecification)
-> (CreateCluster -> Maybe SSESpecification -> CreateCluster)
-> Lens
     CreateCluster
     CreateCluster
     (Maybe SSESpecification)
     (Maybe SSESpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe SSESpecification
sSESpecification :: Maybe SSESpecification
$sel:sSESpecification:CreateCluster' :: CreateCluster -> Maybe SSESpecification
sSESpecification} -> Maybe SSESpecification
sSESpecification) (\s :: CreateCluster
s@CreateCluster' {} Maybe SSESpecification
a -> CreateCluster
s {$sel:sSESpecification:CreateCluster' :: Maybe SSESpecification
sSESpecification = Maybe SSESpecification
a} :: CreateCluster)

-- | The name of the subnet group to be used for the replication group.
--
-- DAX clusters can only run in an Amazon VPC environment. All of the
-- subnets that you specify in a subnet group must exist in the same VPC.
createCluster_subnetGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_subnetGroupName :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_subnetGroupName = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
subnetGroupName :: Maybe Text
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
subnetGroupName} -> Maybe Text
subnetGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = Maybe Text
a} :: CreateCluster)

-- | The type of encryption the cluster\'s endpoint should support. Values
-- are:
--
-- -   @NONE@ for no encryption
--
-- -   @TLS@ for Transport Layer Security
createCluster_clusterEndpointEncryptionType :: Lens.Lens' CreateCluster (Prelude.Maybe ClusterEndpointEncryptionType)
createCluster_clusterEndpointEncryptionType :: (Maybe ClusterEndpointEncryptionType
 -> f (Maybe ClusterEndpointEncryptionType))
-> CreateCluster -> f CreateCluster
createCluster_clusterEndpointEncryptionType = (CreateCluster -> Maybe ClusterEndpointEncryptionType)
-> (CreateCluster
    -> Maybe ClusterEndpointEncryptionType -> CreateCluster)
-> Lens
     CreateCluster
     CreateCluster
     (Maybe ClusterEndpointEncryptionType)
     (Maybe ClusterEndpointEncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
$sel:clusterEndpointEncryptionType:CreateCluster' :: CreateCluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType} -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType) (\s :: CreateCluster
s@CreateCluster' {} Maybe ClusterEndpointEncryptionType
a -> CreateCluster
s {$sel:clusterEndpointEncryptionType:CreateCluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = Maybe ClusterEndpointEncryptionType
a} :: CreateCluster)

-- | Specifies the weekly time range during which maintenance on the DAX
-- cluster is performed. It is specified as a range in the format
-- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
-- is a 60 minute period. Valid values for @ddd@ are:
--
-- -   @sun@
--
-- -   @mon@
--
-- -   @tue@
--
-- -   @wed@
--
-- -   @thu@
--
-- -   @fri@
--
-- -   @sat@
--
-- Example: @sun:05:00-sun:09:00@
--
-- If you don\'t specify a preferred maintenance window when you create or
-- modify a cache cluster, DAX assigns a 60-minute maintenance window on a
-- randomly selected day of the week.
createCluster_preferredMaintenanceWindow :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_preferredMaintenanceWindow = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:preferredMaintenanceWindow:CreateCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: CreateCluster)

-- | The Availability Zones (AZs) in which the cluster nodes will reside
-- after the cluster has been created or updated. If provided, the length
-- of this list must equal the @ReplicationFactor@ parameter. If you omit
-- this parameter, DAX will spread the nodes across Availability Zones for
-- the highest availability.
createCluster_availabilityZones :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster -> f CreateCluster
createCluster_availabilityZones = (CreateCluster -> Maybe [Text])
-> (CreateCluster -> Maybe [Text] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:CreateCluster' :: CreateCluster -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:availabilityZones:CreateCluster' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: CreateCluster) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateCluster -> f CreateCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCluster
-> f CreateCluster
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

-- | A description of the cluster.
createCluster_description :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_description :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_description = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
description :: Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
a} :: CreateCluster)

-- | The Amazon Resource Name (ARN) of the Amazon SNS topic to which
-- notifications will be sent.
--
-- The Amazon SNS topic owner must be same as the DAX cluster owner.
createCluster_notificationTopicArn :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_notificationTopicArn :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_notificationTopicArn = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
notificationTopicArn} -> Maybe Text
notificationTopicArn) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:notificationTopicArn:CreateCluster' :: Maybe Text
notificationTopicArn = Maybe Text
a} :: CreateCluster)

-- | A set of tags to associate with the DAX cluster.
createCluster_tags :: Lens.Lens' CreateCluster (Prelude.Maybe [Tag])
createCluster_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCluster -> f CreateCluster
createCluster_tags = (CreateCluster -> Maybe [Tag])
-> (CreateCluster -> Maybe [Tag] -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Tag]
a -> CreateCluster
s {$sel:tags:CreateCluster' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCluster) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateCluster -> f CreateCluster)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCluster
-> f CreateCluster
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 parameter group to be associated with the DAX cluster.
createCluster_parameterGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_parameterGroupName :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_parameterGroupName = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = Maybe Text
a} :: CreateCluster)

-- | The cluster identifier. This parameter is stored as a lowercase string.
--
-- __Constraints:__
--
-- -   A name must contain from 1 to 20 alphanumeric characters or hyphens.
--
-- -   The first character must be a letter.
--
-- -   A name cannot end with a hyphen or contain two consecutive hyphens.
createCluster_clusterName :: Lens.Lens' CreateCluster Prelude.Text
createCluster_clusterName :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_clusterName = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
clusterName :: Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
clusterName} -> Text
clusterName) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:clusterName:CreateCluster' :: Text
clusterName = Text
a} :: CreateCluster)

-- | The compute and memory capacity of the nodes in the cluster.
createCluster_nodeType :: Lens.Lens' CreateCluster Prelude.Text
createCluster_nodeType :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_nodeType = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
nodeType :: Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
nodeType} -> Text
nodeType) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:nodeType:CreateCluster' :: Text
nodeType = Text
a} :: CreateCluster)

-- | The number of nodes in the DAX cluster. A replication factor of 1 will
-- create a single-node cluster, without any read replicas. For additional
-- fault tolerance, you can create a multiple node cluster with one or more
-- read replicas. To do this, set @ReplicationFactor@ to a number between 3
-- (one primary and two read replicas) and 10 (one primary and nine read
-- replicas). @If the AvailabilityZones@ parameter is provided, its length
-- must equal the @ReplicationFactor@.
--
-- AWS recommends that you have at least two read replicas per cluster.
createCluster_replicationFactor :: Lens.Lens' CreateCluster Prelude.Int
createCluster_replicationFactor :: (Int -> f Int) -> CreateCluster -> f CreateCluster
createCluster_replicationFactor = (CreateCluster -> Int)
-> (CreateCluster -> Int -> CreateCluster)
-> Lens CreateCluster CreateCluster Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Int
replicationFactor :: Int
$sel:replicationFactor:CreateCluster' :: CreateCluster -> Int
replicationFactor} -> Int
replicationFactor) (\s :: CreateCluster
s@CreateCluster' {} Int
a -> CreateCluster
s {$sel:replicationFactor:CreateCluster' :: Int
replicationFactor = Int
a} :: CreateCluster)

-- | A valid Amazon Resource Name (ARN) that identifies an IAM role. At
-- runtime, DAX will assume this role and use the role\'s permissions to
-- access DynamoDB on your behalf.
createCluster_iamRoleArn :: Lens.Lens' CreateCluster Prelude.Text
createCluster_iamRoleArn :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_iamRoleArn = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
iamRoleArn :: Text
$sel:iamRoleArn:CreateCluster' :: CreateCluster -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:iamRoleArn:CreateCluster' :: Text
iamRoleArn = Text
a} :: CreateCluster)

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

instance Prelude.NFData CreateCluster

instance Core.ToHeaders CreateCluster where
  toHeaders :: CreateCluster -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCluster -> 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
"AmazonDAXV3.CreateCluster" :: 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 CreateCluster where
  toJSON :: CreateCluster -> Value
toJSON CreateCluster' {Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe ClusterEndpointEncryptionType
Maybe SSESpecification
Text
iamRoleArn :: Text
replicationFactor :: Int
nodeType :: Text
clusterName :: Text
parameterGroupName :: Maybe Text
tags :: Maybe [Tag]
notificationTopicArn :: Maybe Text
description :: Maybe Text
availabilityZones :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
subnetGroupName :: Maybe Text
sSESpecification :: Maybe SSESpecification
securityGroupIds :: Maybe [Text]
$sel:iamRoleArn:CreateCluster' :: CreateCluster -> Text
$sel:replicationFactor:CreateCluster' :: CreateCluster -> Int
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
$sel:notificationTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:availabilityZones:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:clusterEndpointEncryptionType:CreateCluster' :: CreateCluster -> Maybe ClusterEndpointEncryptionType
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:sSESpecification:CreateCluster' :: CreateCluster -> Maybe SSESpecification
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SecurityGroupIds" 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]
securityGroupIds,
            (Text
"SSESpecification" Text -> SSESpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SSESpecification -> Pair) -> Maybe SSESpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SSESpecification
sSESpecification,
            (Text
"SubnetGroupName" 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
subnetGroupName,
            (Text
"ClusterEndpointEncryptionType" Text -> ClusterEndpointEncryptionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ClusterEndpointEncryptionType -> Pair)
-> Maybe ClusterEndpointEncryptionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType,
            (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
"AvailabilityZones" 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]
availabilityZones,
            (Text
"Description" 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
description,
            (Text
"NotificationTopicArn" 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
notificationTopicArn,
            (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,
            (Text
"ParameterGroupName" 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
parameterGroupName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClusterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NodeType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
nodeType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ReplicationFactor" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
replicationFactor),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iamRoleArn)
          ]
      )

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

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

-- | /See:/ 'newCreateClusterResponse' smart constructor.
data CreateClusterResponse = CreateClusterResponse'
  { -- | A description of the DAX cluster that you have created.
    CreateClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
    -- | The response's http status code.
    CreateClusterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateClusterResponse -> CreateClusterResponse -> Bool
(CreateClusterResponse -> CreateClusterResponse -> Bool)
-> (CreateClusterResponse -> CreateClusterResponse -> Bool)
-> Eq CreateClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
== :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c== :: CreateClusterResponse -> CreateClusterResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterResponse]
ReadPrec CreateClusterResponse
Int -> ReadS CreateClusterResponse
ReadS [CreateClusterResponse]
(Int -> ReadS CreateClusterResponse)
-> ReadS [CreateClusterResponse]
-> ReadPrec CreateClusterResponse
-> ReadPrec [CreateClusterResponse]
-> Read CreateClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterResponse]
$creadListPrec :: ReadPrec [CreateClusterResponse]
readPrec :: ReadPrec CreateClusterResponse
$creadPrec :: ReadPrec CreateClusterResponse
readList :: ReadS [CreateClusterResponse]
$creadList :: ReadS [CreateClusterResponse]
readsPrec :: Int -> ReadS CreateClusterResponse
$creadsPrec :: Int -> ReadS CreateClusterResponse
Prelude.Read, Int -> CreateClusterResponse -> ShowS
[CreateClusterResponse] -> ShowS
CreateClusterResponse -> String
(Int -> CreateClusterResponse -> ShowS)
-> (CreateClusterResponse -> String)
-> ([CreateClusterResponse] -> ShowS)
-> Show CreateClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterResponse] -> ShowS
$cshowList :: [CreateClusterResponse] -> ShowS
show :: CreateClusterResponse -> String
$cshow :: CreateClusterResponse -> String
showsPrec :: Int -> CreateClusterResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterResponse -> ShowS
Prelude.Show, (forall x. CreateClusterResponse -> Rep CreateClusterResponse x)
-> (forall x. Rep CreateClusterResponse x -> CreateClusterResponse)
-> Generic CreateClusterResponse
forall x. Rep CreateClusterResponse x -> CreateClusterResponse
forall x. CreateClusterResponse -> Rep CreateClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClusterResponse x -> CreateClusterResponse
$cfrom :: forall x. CreateClusterResponse -> Rep CreateClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateClusterResponse' 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:
--
-- 'cluster', 'createClusterResponse_cluster' - A description of the DAX cluster that you have created.
--
-- 'httpStatus', 'createClusterResponse_httpStatus' - The response's http status code.
newCreateClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateClusterResponse
newCreateClusterResponse :: Int -> CreateClusterResponse
newCreateClusterResponse Int
pHttpStatus_ =
  CreateClusterResponse' :: Maybe Cluster -> Int -> CreateClusterResponse
CreateClusterResponse'
    { $sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A description of the DAX cluster that you have created.
createClusterResponse_cluster :: Lens.Lens' CreateClusterResponse (Prelude.Maybe Cluster)
createClusterResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> CreateClusterResponse -> f CreateClusterResponse
createClusterResponse_cluster = (CreateClusterResponse -> Maybe Cluster)
-> (CreateClusterResponse
    -> Maybe Cluster -> CreateClusterResponse)
-> Lens
     CreateClusterResponse
     CreateClusterResponse
     (Maybe Cluster)
     (Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:CreateClusterResponse' :: CreateClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Maybe Cluster
a -> CreateClusterResponse
s {$sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: CreateClusterResponse)

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

instance Prelude.NFData CreateClusterResponse