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

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

-- |
-- Module      : Amazonka.ElasticSearch.Types.ElasticsearchClusterConfig
-- 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)
module Amazonka.ElasticSearch.Types.ElasticsearchClusterConfig where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.ColdStorageOptions
import Amazonka.ElasticSearch.Types.ESPartitionInstanceType
import Amazonka.ElasticSearch.Types.ESWarmPartitionInstanceType
import Amazonka.ElasticSearch.Types.ZoneAwarenessConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration for the domain cluster, such as the type and
-- number of instances.
--
-- /See:/ 'newElasticsearchClusterConfig' smart constructor.
data ElasticsearchClusterConfig = ElasticsearchClusterConfig'
  { -- | Total number of dedicated master nodes, active and on standby, for the
    -- cluster.
    ElasticsearchClusterConfig -> Maybe Int
dedicatedMasterCount :: Prelude.Maybe Prelude.Int,
    -- | The instance type for a dedicated master node.
    ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
dedicatedMasterType :: Prelude.Maybe ESPartitionInstanceType,
    -- | A boolean value to indicate whether a dedicated master node is enabled.
    -- See
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
    -- for more information.
    ElasticsearchClusterConfig -> Maybe Bool
dedicatedMasterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The number of instances in the specified domain cluster.
    ElasticsearchClusterConfig -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
    ElasticsearchClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions :: Prelude.Maybe ColdStorageOptions,
    -- | A boolean value to indicate whether zone awareness is enabled. See
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
    -- for more information.
    ElasticsearchClusterConfig -> Maybe Bool
zoneAwarenessEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The instance type for an Elasticsearch cluster. UltraWarm instance types
    -- are not supported for data instances.
    ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
instanceType :: Prelude.Maybe ESPartitionInstanceType,
    -- | True to enable warm storage.
    ElasticsearchClusterConfig -> Maybe Bool
warmEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the zone awareness configuration for a domain when zone
    -- awareness is enabled.
    ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Prelude.Maybe ZoneAwarenessConfig,
    -- | The number of warm nodes in the cluster.
    ElasticsearchClusterConfig -> Maybe Int
warmCount :: Prelude.Maybe Prelude.Int,
    -- | The instance type for the Elasticsearch cluster\'s warm nodes.
    ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
warmType :: Prelude.Maybe ESWarmPartitionInstanceType
  }
  deriving (ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
(ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool)
-> (ElasticsearchClusterConfig
    -> ElasticsearchClusterConfig -> Bool)
-> Eq ElasticsearchClusterConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
$c/= :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
== :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
$c== :: ElasticsearchClusterConfig -> ElasticsearchClusterConfig -> Bool
Prelude.Eq, ReadPrec [ElasticsearchClusterConfig]
ReadPrec ElasticsearchClusterConfig
Int -> ReadS ElasticsearchClusterConfig
ReadS [ElasticsearchClusterConfig]
(Int -> ReadS ElasticsearchClusterConfig)
-> ReadS [ElasticsearchClusterConfig]
-> ReadPrec ElasticsearchClusterConfig
-> ReadPrec [ElasticsearchClusterConfig]
-> Read ElasticsearchClusterConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticsearchClusterConfig]
$creadListPrec :: ReadPrec [ElasticsearchClusterConfig]
readPrec :: ReadPrec ElasticsearchClusterConfig
$creadPrec :: ReadPrec ElasticsearchClusterConfig
readList :: ReadS [ElasticsearchClusterConfig]
$creadList :: ReadS [ElasticsearchClusterConfig]
readsPrec :: Int -> ReadS ElasticsearchClusterConfig
$creadsPrec :: Int -> ReadS ElasticsearchClusterConfig
Prelude.Read, Int -> ElasticsearchClusterConfig -> ShowS
[ElasticsearchClusterConfig] -> ShowS
ElasticsearchClusterConfig -> String
(Int -> ElasticsearchClusterConfig -> ShowS)
-> (ElasticsearchClusterConfig -> String)
-> ([ElasticsearchClusterConfig] -> ShowS)
-> Show ElasticsearchClusterConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticsearchClusterConfig] -> ShowS
$cshowList :: [ElasticsearchClusterConfig] -> ShowS
show :: ElasticsearchClusterConfig -> String
$cshow :: ElasticsearchClusterConfig -> String
showsPrec :: Int -> ElasticsearchClusterConfig -> ShowS
$cshowsPrec :: Int -> ElasticsearchClusterConfig -> ShowS
Prelude.Show, (forall x.
 ElasticsearchClusterConfig -> Rep ElasticsearchClusterConfig x)
-> (forall x.
    Rep ElasticsearchClusterConfig x -> ElasticsearchClusterConfig)
-> Generic ElasticsearchClusterConfig
forall x.
Rep ElasticsearchClusterConfig x -> ElasticsearchClusterConfig
forall x.
ElasticsearchClusterConfig -> Rep ElasticsearchClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticsearchClusterConfig x -> ElasticsearchClusterConfig
$cfrom :: forall x.
ElasticsearchClusterConfig -> Rep ElasticsearchClusterConfig x
Prelude.Generic)

-- |
-- Create a value of 'ElasticsearchClusterConfig' 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:
--
-- 'dedicatedMasterCount', 'elasticsearchClusterConfig_dedicatedMasterCount' - Total number of dedicated master nodes, active and on standby, for the
-- cluster.
--
-- 'dedicatedMasterType', 'elasticsearchClusterConfig_dedicatedMasterType' - The instance type for a dedicated master node.
--
-- 'dedicatedMasterEnabled', 'elasticsearchClusterConfig_dedicatedMasterEnabled' - A boolean value to indicate whether a dedicated master node is enabled.
-- See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
-- for more information.
--
-- 'instanceCount', 'elasticsearchClusterConfig_instanceCount' - The number of instances in the specified domain cluster.
--
-- 'coldStorageOptions', 'elasticsearchClusterConfig_coldStorageOptions' - Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
--
-- 'zoneAwarenessEnabled', 'elasticsearchClusterConfig_zoneAwarenessEnabled' - A boolean value to indicate whether zone awareness is enabled. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
-- for more information.
--
-- 'instanceType', 'elasticsearchClusterConfig_instanceType' - The instance type for an Elasticsearch cluster. UltraWarm instance types
-- are not supported for data instances.
--
-- 'warmEnabled', 'elasticsearchClusterConfig_warmEnabled' - True to enable warm storage.
--
-- 'zoneAwarenessConfig', 'elasticsearchClusterConfig_zoneAwarenessConfig' - Specifies the zone awareness configuration for a domain when zone
-- awareness is enabled.
--
-- 'warmCount', 'elasticsearchClusterConfig_warmCount' - The number of warm nodes in the cluster.
--
-- 'warmType', 'elasticsearchClusterConfig_warmType' - The instance type for the Elasticsearch cluster\'s warm nodes.
newElasticsearchClusterConfig ::
  ElasticsearchClusterConfig
newElasticsearchClusterConfig :: ElasticsearchClusterConfig
newElasticsearchClusterConfig =
  ElasticsearchClusterConfig' :: Maybe Int
-> Maybe ESPartitionInstanceType
-> Maybe Bool
-> Maybe Int
-> Maybe ColdStorageOptions
-> Maybe Bool
-> Maybe ESPartitionInstanceType
-> Maybe Bool
-> Maybe ZoneAwarenessConfig
-> Maybe Int
-> Maybe ESWarmPartitionInstanceType
-> ElasticsearchClusterConfig
ElasticsearchClusterConfig'
    { $sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: Maybe Int
dedicatedMasterCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
dedicatedMasterType = Maybe ESPartitionInstanceType
forall a. Maybe a
Prelude.Nothing,
      $sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:ElasticsearchClusterConfig' :: Maybe Int
instanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:coldStorageOptions:ElasticsearchClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions = Maybe ColdStorageOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
instanceType = Maybe ESPartitionInstanceType
forall a. Maybe a
Prelude.Nothing,
      $sel:warmEnabled:ElasticsearchClusterConfig' :: Maybe Bool
warmEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = Maybe ZoneAwarenessConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:warmCount:ElasticsearchClusterConfig' :: Maybe Int
warmCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:warmType:ElasticsearchClusterConfig' :: Maybe ESWarmPartitionInstanceType
warmType = Maybe ESWarmPartitionInstanceType
forall a. Maybe a
Prelude.Nothing
    }

-- | Total number of dedicated master nodes, active and on standby, for the
-- cluster.
elasticsearchClusterConfig_dedicatedMasterCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_dedicatedMasterCount :: (Maybe Int -> f (Maybe Int))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_dedicatedMasterCount = (ElasticsearchClusterConfig -> Maybe Int)
-> (ElasticsearchClusterConfig
    -> Maybe Int -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
dedicatedMasterCount :: Maybe Int
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
dedicatedMasterCount} -> Maybe Int
dedicatedMasterCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: Maybe Int
dedicatedMasterCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | The instance type for a dedicated master node.
elasticsearchClusterConfig_dedicatedMasterType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_dedicatedMasterType :: (Maybe ESPartitionInstanceType
 -> f (Maybe ESPartitionInstanceType))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_dedicatedMasterType = (ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType)
-> (ElasticsearchClusterConfig
    -> Maybe ESPartitionInstanceType -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe ESPartitionInstanceType)
     (Maybe ESPartitionInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESPartitionInstanceType
dedicatedMasterType :: Maybe ESPartitionInstanceType
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
dedicatedMasterType} -> Maybe ESPartitionInstanceType
dedicatedMasterType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
dedicatedMasterType = Maybe ESPartitionInstanceType
a} :: ElasticsearchClusterConfig)

-- | A boolean value to indicate whether a dedicated master node is enabled.
-- See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-dedicatedmasternodes About Dedicated Master Nodes>
-- for more information.
elasticsearchClusterConfig_dedicatedMasterEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_dedicatedMasterEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_dedicatedMasterEnabled = (ElasticsearchClusterConfig -> Maybe Bool)
-> (ElasticsearchClusterConfig
    -> Maybe Bool -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
dedicatedMasterEnabled :: Maybe Bool
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
dedicatedMasterEnabled} -> Maybe Bool
dedicatedMasterEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: Maybe Bool
dedicatedMasterEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

-- | The number of instances in the specified domain cluster.
elasticsearchClusterConfig_instanceCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_instanceCount :: (Maybe Int -> f (Maybe Int))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_instanceCount = (ElasticsearchClusterConfig -> Maybe Int)
-> (ElasticsearchClusterConfig
    -> Maybe Int -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:instanceCount:ElasticsearchClusterConfig' :: Maybe Int
instanceCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | Specifies the @ColdStorageOptions@ config for Elasticsearch Domain
elasticsearchClusterConfig_coldStorageOptions :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ColdStorageOptions)
elasticsearchClusterConfig_coldStorageOptions :: (Maybe ColdStorageOptions -> f (Maybe ColdStorageOptions))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_coldStorageOptions = (ElasticsearchClusterConfig -> Maybe ColdStorageOptions)
-> (ElasticsearchClusterConfig
    -> Maybe ColdStorageOptions -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe ColdStorageOptions)
     (Maybe ColdStorageOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ColdStorageOptions
coldStorageOptions :: Maybe ColdStorageOptions
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
coldStorageOptions} -> Maybe ColdStorageOptions
coldStorageOptions) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ColdStorageOptions
a -> ElasticsearchClusterConfig
s {$sel:coldStorageOptions:ElasticsearchClusterConfig' :: Maybe ColdStorageOptions
coldStorageOptions = Maybe ColdStorageOptions
a} :: ElasticsearchClusterConfig)

-- | A boolean value to indicate whether zone awareness is enabled. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness About Zone Awareness>
-- for more information.
elasticsearchClusterConfig_zoneAwarenessEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_zoneAwarenessEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_zoneAwarenessEnabled = (ElasticsearchClusterConfig -> Maybe Bool)
-> (ElasticsearchClusterConfig
    -> Maybe Bool -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
zoneAwarenessEnabled :: Maybe Bool
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
zoneAwarenessEnabled} -> Maybe Bool
zoneAwarenessEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: Maybe Bool
zoneAwarenessEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

-- | The instance type for an Elasticsearch cluster. UltraWarm instance types
-- are not supported for data instances.
elasticsearchClusterConfig_instanceType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESPartitionInstanceType)
elasticsearchClusterConfig_instanceType :: (Maybe ESPartitionInstanceType
 -> f (Maybe ESPartitionInstanceType))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_instanceType = (ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType)
-> (ElasticsearchClusterConfig
    -> Maybe ESPartitionInstanceType -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe ESPartitionInstanceType)
     (Maybe ESPartitionInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESPartitionInstanceType
instanceType :: Maybe ESPartitionInstanceType
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
instanceType} -> Maybe ESPartitionInstanceType
instanceType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:instanceType:ElasticsearchClusterConfig' :: Maybe ESPartitionInstanceType
instanceType = Maybe ESPartitionInstanceType
a} :: ElasticsearchClusterConfig)

-- | True to enable warm storage.
elasticsearchClusterConfig_warmEnabled :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Bool)
elasticsearchClusterConfig_warmEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_warmEnabled = (ElasticsearchClusterConfig -> Maybe Bool)
-> (ElasticsearchClusterConfig
    -> Maybe Bool -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Bool
warmEnabled :: Maybe Bool
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
warmEnabled} -> Maybe Bool
warmEnabled) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Bool
a -> ElasticsearchClusterConfig
s {$sel:warmEnabled:ElasticsearchClusterConfig' :: Maybe Bool
warmEnabled = Maybe Bool
a} :: ElasticsearchClusterConfig)

-- | Specifies the zone awareness configuration for a domain when zone
-- awareness is enabled.
elasticsearchClusterConfig_zoneAwarenessConfig :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ZoneAwarenessConfig)
elasticsearchClusterConfig_zoneAwarenessConfig :: (Maybe ZoneAwarenessConfig -> f (Maybe ZoneAwarenessConfig))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_zoneAwarenessConfig = (ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig)
-> (ElasticsearchClusterConfig
    -> Maybe ZoneAwarenessConfig -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe ZoneAwarenessConfig)
     (Maybe ZoneAwarenessConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ZoneAwarenessConfig
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig} -> Maybe ZoneAwarenessConfig
zoneAwarenessConfig) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ZoneAwarenessConfig
a -> ElasticsearchClusterConfig
s {$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: Maybe ZoneAwarenessConfig
zoneAwarenessConfig = Maybe ZoneAwarenessConfig
a} :: ElasticsearchClusterConfig)

-- | The number of warm nodes in the cluster.
elasticsearchClusterConfig_warmCount :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe Prelude.Int)
elasticsearchClusterConfig_warmCount :: (Maybe Int -> f (Maybe Int))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_warmCount = (ElasticsearchClusterConfig -> Maybe Int)
-> (ElasticsearchClusterConfig
    -> Maybe Int -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe Int
warmCount :: Maybe Int
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
warmCount} -> Maybe Int
warmCount) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe Int
a -> ElasticsearchClusterConfig
s {$sel:warmCount:ElasticsearchClusterConfig' :: Maybe Int
warmCount = Maybe Int
a} :: ElasticsearchClusterConfig)

-- | The instance type for the Elasticsearch cluster\'s warm nodes.
elasticsearchClusterConfig_warmType :: Lens.Lens' ElasticsearchClusterConfig (Prelude.Maybe ESWarmPartitionInstanceType)
elasticsearchClusterConfig_warmType :: (Maybe ESWarmPartitionInstanceType
 -> f (Maybe ESWarmPartitionInstanceType))
-> ElasticsearchClusterConfig -> f ElasticsearchClusterConfig
elasticsearchClusterConfig_warmType = (ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType)
-> (ElasticsearchClusterConfig
    -> Maybe ESWarmPartitionInstanceType -> ElasticsearchClusterConfig)
-> Lens
     ElasticsearchClusterConfig
     ElasticsearchClusterConfig
     (Maybe ESWarmPartitionInstanceType)
     (Maybe ESWarmPartitionInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchClusterConfig' {Maybe ESWarmPartitionInstanceType
warmType :: Maybe ESWarmPartitionInstanceType
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
warmType} -> Maybe ESWarmPartitionInstanceType
warmType) (\s :: ElasticsearchClusterConfig
s@ElasticsearchClusterConfig' {} Maybe ESWarmPartitionInstanceType
a -> ElasticsearchClusterConfig
s {$sel:warmType:ElasticsearchClusterConfig' :: Maybe ESWarmPartitionInstanceType
warmType = Maybe ESWarmPartitionInstanceType
a} :: ElasticsearchClusterConfig)

instance Core.FromJSON ElasticsearchClusterConfig where
  parseJSON :: Value -> Parser ElasticsearchClusterConfig
parseJSON =
    String
-> (Object -> Parser ElasticsearchClusterConfig)
-> Value
-> Parser ElasticsearchClusterConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ElasticsearchClusterConfig"
      ( \Object
x ->
          Maybe Int
-> Maybe ESPartitionInstanceType
-> Maybe Bool
-> Maybe Int
-> Maybe ColdStorageOptions
-> Maybe Bool
-> Maybe ESPartitionInstanceType
-> Maybe Bool
-> Maybe ZoneAwarenessConfig
-> Maybe Int
-> Maybe ESWarmPartitionInstanceType
-> ElasticsearchClusterConfig
ElasticsearchClusterConfig'
            (Maybe Int
 -> Maybe ESPartitionInstanceType
 -> Maybe Bool
 -> Maybe Int
 -> Maybe ColdStorageOptions
 -> Maybe Bool
 -> Maybe ESPartitionInstanceType
 -> Maybe Bool
 -> Maybe ZoneAwarenessConfig
 -> Maybe Int
 -> Maybe ESWarmPartitionInstanceType
 -> ElasticsearchClusterConfig)
-> Parser (Maybe Int)
-> Parser
     (Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe Int
      -> Maybe ColdStorageOptions
      -> Maybe Bool
      -> Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DedicatedMasterCount")
            Parser
  (Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe Int
   -> Maybe ColdStorageOptions
   -> Maybe Bool
   -> Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe ESPartitionInstanceType)
-> Parser
     (Maybe Bool
      -> Maybe Int
      -> Maybe ColdStorageOptions
      -> Maybe Bool
      -> Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ESPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DedicatedMasterType")
            Parser
  (Maybe Bool
   -> Maybe Int
   -> Maybe ColdStorageOptions
   -> Maybe Bool
   -> Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe ColdStorageOptions
      -> Maybe Bool
      -> Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DedicatedMasterEnabled")
            Parser
  (Maybe Int
   -> Maybe ColdStorageOptions
   -> Maybe Bool
   -> Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe Int)
-> Parser
     (Maybe ColdStorageOptions
      -> Maybe Bool
      -> Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceCount")
            Parser
  (Maybe ColdStorageOptions
   -> Maybe Bool
   -> Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe ColdStorageOptions)
-> Parser
     (Maybe Bool
      -> Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ColdStorageOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ColdStorageOptions")
            Parser
  (Maybe Bool
   -> Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe ESPartitionInstanceType
      -> Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ZoneAwarenessEnabled")
            Parser
  (Maybe ESPartitionInstanceType
   -> Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe ESPartitionInstanceType)
-> Parser
     (Maybe Bool
      -> Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ESPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser
  (Maybe Bool
   -> Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe ZoneAwarenessConfig
      -> Maybe Int
      -> Maybe ESWarmPartitionInstanceType
      -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WarmEnabled")
            Parser
  (Maybe ZoneAwarenessConfig
   -> Maybe Int
   -> Maybe ESWarmPartitionInstanceType
   -> ElasticsearchClusterConfig)
-> Parser (Maybe ZoneAwarenessConfig)
-> Parser
     (Maybe Int
      -> Maybe ESWarmPartitionInstanceType -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ZoneAwarenessConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ZoneAwarenessConfig")
            Parser
  (Maybe Int
   -> Maybe ESWarmPartitionInstanceType -> ElasticsearchClusterConfig)
-> Parser (Maybe Int)
-> Parser
     (Maybe ESWarmPartitionInstanceType -> ElasticsearchClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WarmCount")
            Parser
  (Maybe ESWarmPartitionInstanceType -> ElasticsearchClusterConfig)
-> Parser (Maybe ESWarmPartitionInstanceType)
-> Parser ElasticsearchClusterConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ESWarmPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WarmType")
      )

instance Prelude.Hashable ElasticsearchClusterConfig

instance Prelude.NFData ElasticsearchClusterConfig

instance Core.ToJSON ElasticsearchClusterConfig where
  toJSON :: ElasticsearchClusterConfig -> Value
toJSON ElasticsearchClusterConfig' {Maybe Bool
Maybe Int
Maybe ColdStorageOptions
Maybe ESPartitionInstanceType
Maybe ESWarmPartitionInstanceType
Maybe ZoneAwarenessConfig
warmType :: Maybe ESWarmPartitionInstanceType
warmCount :: Maybe Int
zoneAwarenessConfig :: Maybe ZoneAwarenessConfig
warmEnabled :: Maybe Bool
instanceType :: Maybe ESPartitionInstanceType
zoneAwarenessEnabled :: Maybe Bool
coldStorageOptions :: Maybe ColdStorageOptions
instanceCount :: Maybe Int
dedicatedMasterEnabled :: Maybe Bool
dedicatedMasterType :: Maybe ESPartitionInstanceType
dedicatedMasterCount :: Maybe Int
$sel:warmType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESWarmPartitionInstanceType
$sel:warmCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:zoneAwarenessConfig:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ZoneAwarenessConfig
$sel:warmEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:instanceType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:zoneAwarenessEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:coldStorageOptions:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ColdStorageOptions
$sel:instanceCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
$sel:dedicatedMasterEnabled:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Bool
$sel:dedicatedMasterType:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe ESPartitionInstanceType
$sel:dedicatedMasterCount:ElasticsearchClusterConfig' :: ElasticsearchClusterConfig -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DedicatedMasterCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
dedicatedMasterCount,
            (Text
"DedicatedMasterType" Text -> ESPartitionInstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ESPartitionInstanceType -> Pair)
-> Maybe ESPartitionInstanceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ESPartitionInstanceType
dedicatedMasterType,
            (Text
"DedicatedMasterEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
dedicatedMasterEnabled,
            (Text
"InstanceCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instanceCount,
            (Text
"ColdStorageOptions" Text -> ColdStorageOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ColdStorageOptions -> Pair)
-> Maybe ColdStorageOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ColdStorageOptions
coldStorageOptions,
            (Text
"ZoneAwarenessEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
zoneAwarenessEnabled,
            (Text
"InstanceType" Text -> ESPartitionInstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ESPartitionInstanceType -> Pair)
-> Maybe ESPartitionInstanceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ESPartitionInstanceType
instanceType,
            (Text
"WarmEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
warmEnabled,
            (Text
"ZoneAwarenessConfig" Text -> ZoneAwarenessConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ZoneAwarenessConfig -> Pair)
-> Maybe ZoneAwarenessConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ZoneAwarenessConfig
zoneAwarenessConfig,
            (Text
"WarmCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
warmCount,
            (Text
"WarmType" Text -> ESWarmPartitionInstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ESWarmPartitionInstanceType -> Pair)
-> Maybe ESWarmPartitionInstanceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ESWarmPartitionInstanceType
warmType
          ]
      )