{-# 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.ElasticSearch.CreateElasticsearchDomain
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new Elasticsearch domain. For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains Creating Elasticsearch Domains>
-- in the /Amazon Elasticsearch Service Developer Guide/.
module Amazonka.ElasticSearch.CreateElasticsearchDomain
  ( -- * Creating a Request
    CreateElasticsearchDomain (..),
    newCreateElasticsearchDomain,

    -- * Request Lenses
    createElasticsearchDomain_eBSOptions,
    createElasticsearchDomain_nodeToNodeEncryptionOptions,
    createElasticsearchDomain_accessPolicies,
    createElasticsearchDomain_autoTuneOptions,
    createElasticsearchDomain_logPublishingOptions,
    createElasticsearchDomain_advancedSecurityOptions,
    createElasticsearchDomain_tagList,
    createElasticsearchDomain_elasticsearchClusterConfig,
    createElasticsearchDomain_snapshotOptions,
    createElasticsearchDomain_cognitoOptions,
    createElasticsearchDomain_encryptionAtRestOptions,
    createElasticsearchDomain_vPCOptions,
    createElasticsearchDomain_domainEndpointOptions,
    createElasticsearchDomain_advancedOptions,
    createElasticsearchDomain_elasticsearchVersion,
    createElasticsearchDomain_domainName,

    -- * Destructuring the Response
    CreateElasticsearchDomainResponse (..),
    newCreateElasticsearchDomainResponse,

    -- * Response Lenses
    createElasticsearchDomainResponse_domainStatus,
    createElasticsearchDomainResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.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:/ 'newCreateElasticsearchDomain' smart constructor.
data CreateElasticsearchDomain = CreateElasticsearchDomain'
  { -- | Options to enable, disable and specify the type and size of EBS storage
    -- volumes.
    CreateElasticsearchDomain -> Maybe EBSOptions
eBSOptions :: Prelude.Maybe EBSOptions,
    -- | Specifies the NodeToNodeEncryptionOptions.
    CreateElasticsearchDomain -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions :: Prelude.Maybe NodeToNodeEncryptionOptions,
    -- | IAM access policy as a JSON-formatted string.
    CreateElasticsearchDomain -> Maybe Text
accessPolicies :: Prelude.Maybe Prelude.Text,
    -- | Specifies Auto-Tune options.
    CreateElasticsearchDomain -> Maybe AutoTuneOptionsInput
autoTuneOptions :: Prelude.Maybe AutoTuneOptionsInput,
    -- | Map of @LogType@ and @LogPublishingOption@, each containing options to
    -- publish a given type of Elasticsearch log.
    CreateElasticsearchDomain
-> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions :: Prelude.Maybe (Prelude.HashMap LogType LogPublishingOption),
    -- | Specifies advanced security options.
    CreateElasticsearchDomain -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions :: Prelude.Maybe AdvancedSecurityOptionsInput,
    -- | A list of @Tag@ added during domain creation.
    CreateElasticsearchDomain -> Maybe [Tag]
tagList :: Prelude.Maybe [Tag],
    -- | Configuration options for an Elasticsearch domain. Specifies the
    -- instance type and number of instances in the domain cluster.
    CreateElasticsearchDomain -> Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig :: Prelude.Maybe ElasticsearchClusterConfig,
    -- | Option to set time, in UTC format, of the daily automated snapshot.
    -- Default value is 0 hours.
    CreateElasticsearchDomain -> Maybe SnapshotOptions
snapshotOptions :: Prelude.Maybe SnapshotOptions,
    -- | Options to specify the Cognito user and identity pools for Kibana
    -- authentication. For more information, see
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html Amazon Cognito Authentication for Kibana>.
    CreateElasticsearchDomain -> Maybe CognitoOptions
cognitoOptions :: Prelude.Maybe CognitoOptions,
    -- | Specifies the Encryption At Rest Options.
    CreateElasticsearchDomain -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions :: Prelude.Maybe EncryptionAtRestOptions,
    -- | Options to specify the subnets and security groups for VPC endpoint. For
    -- more information, see
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc Creating a VPC>
    -- in /VPC Endpoints for Amazon Elasticsearch Service Domains/
    CreateElasticsearchDomain -> Maybe VPCOptions
vPCOptions :: Prelude.Maybe VPCOptions,
    -- | Options to specify configuration that will be applied to the domain
    -- endpoint.
    CreateElasticsearchDomain -> Maybe DomainEndpointOptions
domainEndpointOptions :: Prelude.Maybe DomainEndpointOptions,
    -- | Option to allow references to indices in an HTTP request body. Must be
    -- @false@ when configuring access to individual sub-resources. By default,
    -- the value is @true@. See
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options Configuration Advanced Options>
    -- for more information.
    CreateElasticsearchDomain -> Maybe (HashMap Text Text)
advancedOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | String of format X.Y to specify version for the Elasticsearch domain eg.
    -- \"1.5\" or \"2.3\". For more information, see
    -- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains Creating Elasticsearch Domains>
    -- in the /Amazon Elasticsearch Service Developer Guide/.
    CreateElasticsearchDomain -> Maybe Text
elasticsearchVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the Elasticsearch domain that you are creating. Domain names
    -- are unique across the domains owned by an account within an AWS region.
    -- Domain names must start with a lowercase letter and can contain the
    -- following characters: a-z (lowercase), 0-9, and - (hyphen).
    CreateElasticsearchDomain -> Text
domainName :: Prelude.Text
  }
  deriving (CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool
(CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool)
-> (CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool)
-> Eq CreateElasticsearchDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool
$c/= :: CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool
== :: CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool
$c== :: CreateElasticsearchDomain -> CreateElasticsearchDomain -> Bool
Prelude.Eq, Int -> CreateElasticsearchDomain -> ShowS
[CreateElasticsearchDomain] -> ShowS
CreateElasticsearchDomain -> String
(Int -> CreateElasticsearchDomain -> ShowS)
-> (CreateElasticsearchDomain -> String)
-> ([CreateElasticsearchDomain] -> ShowS)
-> Show CreateElasticsearchDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateElasticsearchDomain] -> ShowS
$cshowList :: [CreateElasticsearchDomain] -> ShowS
show :: CreateElasticsearchDomain -> String
$cshow :: CreateElasticsearchDomain -> String
showsPrec :: Int -> CreateElasticsearchDomain -> ShowS
$cshowsPrec :: Int -> CreateElasticsearchDomain -> ShowS
Prelude.Show, (forall x.
 CreateElasticsearchDomain -> Rep CreateElasticsearchDomain x)
-> (forall x.
    Rep CreateElasticsearchDomain x -> CreateElasticsearchDomain)
-> Generic CreateElasticsearchDomain
forall x.
Rep CreateElasticsearchDomain x -> CreateElasticsearchDomain
forall x.
CreateElasticsearchDomain -> Rep CreateElasticsearchDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateElasticsearchDomain x -> CreateElasticsearchDomain
$cfrom :: forall x.
CreateElasticsearchDomain -> Rep CreateElasticsearchDomain x
Prelude.Generic)

-- |
-- Create a value of 'CreateElasticsearchDomain' 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:
--
-- 'eBSOptions', 'createElasticsearchDomain_eBSOptions' - Options to enable, disable and specify the type and size of EBS storage
-- volumes.
--
-- 'nodeToNodeEncryptionOptions', 'createElasticsearchDomain_nodeToNodeEncryptionOptions' - Specifies the NodeToNodeEncryptionOptions.
--
-- 'accessPolicies', 'createElasticsearchDomain_accessPolicies' - IAM access policy as a JSON-formatted string.
--
-- 'autoTuneOptions', 'createElasticsearchDomain_autoTuneOptions' - Specifies Auto-Tune options.
--
-- 'logPublishingOptions', 'createElasticsearchDomain_logPublishingOptions' - Map of @LogType@ and @LogPublishingOption@, each containing options to
-- publish a given type of Elasticsearch log.
--
-- 'advancedSecurityOptions', 'createElasticsearchDomain_advancedSecurityOptions' - Specifies advanced security options.
--
-- 'tagList', 'createElasticsearchDomain_tagList' - A list of @Tag@ added during domain creation.
--
-- 'elasticsearchClusterConfig', 'createElasticsearchDomain_elasticsearchClusterConfig' - Configuration options for an Elasticsearch domain. Specifies the
-- instance type and number of instances in the domain cluster.
--
-- 'snapshotOptions', 'createElasticsearchDomain_snapshotOptions' - Option to set time, in UTC format, of the daily automated snapshot.
-- Default value is 0 hours.
--
-- 'cognitoOptions', 'createElasticsearchDomain_cognitoOptions' - Options to specify the Cognito user and identity pools for Kibana
-- authentication. For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html Amazon Cognito Authentication for Kibana>.
--
-- 'encryptionAtRestOptions', 'createElasticsearchDomain_encryptionAtRestOptions' - Specifies the Encryption At Rest Options.
--
-- 'vPCOptions', 'createElasticsearchDomain_vPCOptions' - Options to specify the subnets and security groups for VPC endpoint. For
-- more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc Creating a VPC>
-- in /VPC Endpoints for Amazon Elasticsearch Service Domains/
--
-- 'domainEndpointOptions', 'createElasticsearchDomain_domainEndpointOptions' - Options to specify configuration that will be applied to the domain
-- endpoint.
--
-- 'advancedOptions', 'createElasticsearchDomain_advancedOptions' - Option to allow references to indices in an HTTP request body. Must be
-- @false@ when configuring access to individual sub-resources. By default,
-- the value is @true@. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options Configuration Advanced Options>
-- for more information.
--
-- 'elasticsearchVersion', 'createElasticsearchDomain_elasticsearchVersion' - String of format X.Y to specify version for the Elasticsearch domain eg.
-- \"1.5\" or \"2.3\". For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains Creating Elasticsearch Domains>
-- in the /Amazon Elasticsearch Service Developer Guide/.
--
-- 'domainName', 'createElasticsearchDomain_domainName' - The name of the Elasticsearch domain that you are creating. Domain names
-- are unique across the domains owned by an account within an AWS region.
-- Domain names must start with a lowercase letter and can contain the
-- following characters: a-z (lowercase), 0-9, and - (hyphen).
newCreateElasticsearchDomain ::
  -- | 'domainName'
  Prelude.Text ->
  CreateElasticsearchDomain
newCreateElasticsearchDomain :: Text -> CreateElasticsearchDomain
newCreateElasticsearchDomain Text
pDomainName_ =
  CreateElasticsearchDomain' :: Maybe EBSOptions
-> Maybe NodeToNodeEncryptionOptions
-> Maybe Text
-> Maybe AutoTuneOptionsInput
-> Maybe (HashMap LogType LogPublishingOption)
-> Maybe AdvancedSecurityOptionsInput
-> Maybe [Tag]
-> Maybe ElasticsearchClusterConfig
-> Maybe SnapshotOptions
-> Maybe CognitoOptions
-> Maybe EncryptionAtRestOptions
-> Maybe VPCOptions
-> Maybe DomainEndpointOptions
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> CreateElasticsearchDomain
CreateElasticsearchDomain'
    { $sel:eBSOptions:CreateElasticsearchDomain' :: Maybe EBSOptions
eBSOptions =
        Maybe EBSOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeToNodeEncryptionOptions:CreateElasticsearchDomain' :: Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions = Maybe NodeToNodeEncryptionOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:accessPolicies:CreateElasticsearchDomain' :: Maybe Text
accessPolicies = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoTuneOptions:CreateElasticsearchDomain' :: Maybe AutoTuneOptionsInput
autoTuneOptions = Maybe AutoTuneOptionsInput
forall a. Maybe a
Prelude.Nothing,
      $sel:logPublishingOptions:CreateElasticsearchDomain' :: Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions = Maybe (HashMap LogType LogPublishingOption)
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedSecurityOptions:CreateElasticsearchDomain' :: Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions = Maybe AdvancedSecurityOptionsInput
forall a. Maybe a
Prelude.Nothing,
      $sel:tagList:CreateElasticsearchDomain' :: Maybe [Tag]
tagList = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticsearchClusterConfig:CreateElasticsearchDomain' :: Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig = Maybe ElasticsearchClusterConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotOptions:CreateElasticsearchDomain' :: Maybe SnapshotOptions
snapshotOptions = Maybe SnapshotOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoOptions:CreateElasticsearchDomain' :: Maybe CognitoOptions
cognitoOptions = Maybe CognitoOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionAtRestOptions:CreateElasticsearchDomain' :: Maybe EncryptionAtRestOptions
encryptionAtRestOptions = Maybe EncryptionAtRestOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:vPCOptions:CreateElasticsearchDomain' :: Maybe VPCOptions
vPCOptions = Maybe VPCOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:domainEndpointOptions:CreateElasticsearchDomain' :: Maybe DomainEndpointOptions
domainEndpointOptions = Maybe DomainEndpointOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedOptions:CreateElasticsearchDomain' :: Maybe (HashMap Text Text)
advancedOptions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticsearchVersion:CreateElasticsearchDomain' :: Maybe Text
elasticsearchVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CreateElasticsearchDomain' :: Text
domainName = Text
pDomainName_
    }

-- | Options to enable, disable and specify the type and size of EBS storage
-- volumes.
createElasticsearchDomain_eBSOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe EBSOptions)
createElasticsearchDomain_eBSOptions :: (Maybe EBSOptions -> f (Maybe EBSOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_eBSOptions = (CreateElasticsearchDomain -> Maybe EBSOptions)
-> (CreateElasticsearchDomain
    -> Maybe EBSOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe EBSOptions)
     (Maybe EBSOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe EBSOptions
eBSOptions :: Maybe EBSOptions
$sel:eBSOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe EBSOptions
eBSOptions} -> Maybe EBSOptions
eBSOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe EBSOptions
a -> CreateElasticsearchDomain
s {$sel:eBSOptions:CreateElasticsearchDomain' :: Maybe EBSOptions
eBSOptions = Maybe EBSOptions
a} :: CreateElasticsearchDomain)

-- | Specifies the NodeToNodeEncryptionOptions.
createElasticsearchDomain_nodeToNodeEncryptionOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe NodeToNodeEncryptionOptions)
createElasticsearchDomain_nodeToNodeEncryptionOptions :: (Maybe NodeToNodeEncryptionOptions
 -> f (Maybe NodeToNodeEncryptionOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_nodeToNodeEncryptionOptions = (CreateElasticsearchDomain -> Maybe NodeToNodeEncryptionOptions)
-> (CreateElasticsearchDomain
    -> Maybe NodeToNodeEncryptionOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe NodeToNodeEncryptionOptions)
     (Maybe NodeToNodeEncryptionOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions :: Maybe NodeToNodeEncryptionOptions
$sel:nodeToNodeEncryptionOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions} -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe NodeToNodeEncryptionOptions
a -> CreateElasticsearchDomain
s {$sel:nodeToNodeEncryptionOptions:CreateElasticsearchDomain' :: Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions = Maybe NodeToNodeEncryptionOptions
a} :: CreateElasticsearchDomain)

-- | IAM access policy as a JSON-formatted string.
createElasticsearchDomain_accessPolicies :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe Prelude.Text)
createElasticsearchDomain_accessPolicies :: (Maybe Text -> f (Maybe Text))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_accessPolicies = (CreateElasticsearchDomain -> Maybe Text)
-> (CreateElasticsearchDomain
    -> Maybe Text -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe Text
accessPolicies :: Maybe Text
$sel:accessPolicies:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe Text
accessPolicies} -> Maybe Text
accessPolicies) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe Text
a -> CreateElasticsearchDomain
s {$sel:accessPolicies:CreateElasticsearchDomain' :: Maybe Text
accessPolicies = Maybe Text
a} :: CreateElasticsearchDomain)

-- | Specifies Auto-Tune options.
createElasticsearchDomain_autoTuneOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe AutoTuneOptionsInput)
createElasticsearchDomain_autoTuneOptions :: (Maybe AutoTuneOptionsInput -> f (Maybe AutoTuneOptionsInput))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_autoTuneOptions = (CreateElasticsearchDomain -> Maybe AutoTuneOptionsInput)
-> (CreateElasticsearchDomain
    -> Maybe AutoTuneOptionsInput -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe AutoTuneOptionsInput)
     (Maybe AutoTuneOptionsInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe AutoTuneOptionsInput
autoTuneOptions :: Maybe AutoTuneOptionsInput
$sel:autoTuneOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe AutoTuneOptionsInput
autoTuneOptions} -> Maybe AutoTuneOptionsInput
autoTuneOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe AutoTuneOptionsInput
a -> CreateElasticsearchDomain
s {$sel:autoTuneOptions:CreateElasticsearchDomain' :: Maybe AutoTuneOptionsInput
autoTuneOptions = Maybe AutoTuneOptionsInput
a} :: CreateElasticsearchDomain)

-- | Map of @LogType@ and @LogPublishingOption@, each containing options to
-- publish a given type of Elasticsearch log.
createElasticsearchDomain_logPublishingOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe (Prelude.HashMap LogType LogPublishingOption))
createElasticsearchDomain_logPublishingOptions :: (Maybe (HashMap LogType LogPublishingOption)
 -> f (Maybe (HashMap LogType LogPublishingOption)))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_logPublishingOptions = (CreateElasticsearchDomain
 -> Maybe (HashMap LogType LogPublishingOption))
-> (CreateElasticsearchDomain
    -> Maybe (HashMap LogType LogPublishingOption)
    -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions :: Maybe (HashMap LogType LogPublishingOption)
$sel:logPublishingOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain
-> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions} -> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe (HashMap LogType LogPublishingOption)
a -> CreateElasticsearchDomain
s {$sel:logPublishingOptions:CreateElasticsearchDomain' :: Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions = Maybe (HashMap LogType LogPublishingOption)
a} :: CreateElasticsearchDomain) ((Maybe (HashMap LogType LogPublishingOption)
  -> f (Maybe (HashMap LogType LogPublishingOption)))
 -> CreateElasticsearchDomain -> f CreateElasticsearchDomain)
-> ((Maybe (HashMap LogType LogPublishingOption)
     -> f (Maybe (HashMap LogType LogPublishingOption)))
    -> Maybe (HashMap LogType LogPublishingOption)
    -> f (Maybe (HashMap LogType LogPublishingOption)))
-> (Maybe (HashMap LogType LogPublishingOption)
    -> f (Maybe (HashMap LogType LogPublishingOption)))
-> CreateElasticsearchDomain
-> f CreateElasticsearchDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
-> Iso
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
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
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies advanced security options.
createElasticsearchDomain_advancedSecurityOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe AdvancedSecurityOptionsInput)
createElasticsearchDomain_advancedSecurityOptions :: (Maybe AdvancedSecurityOptionsInput
 -> f (Maybe AdvancedSecurityOptionsInput))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_advancedSecurityOptions = (CreateElasticsearchDomain -> Maybe AdvancedSecurityOptionsInput)
-> (CreateElasticsearchDomain
    -> Maybe AdvancedSecurityOptionsInput -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe AdvancedSecurityOptionsInput)
     (Maybe AdvancedSecurityOptionsInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions :: Maybe AdvancedSecurityOptionsInput
$sel:advancedSecurityOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions} -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe AdvancedSecurityOptionsInput
a -> CreateElasticsearchDomain
s {$sel:advancedSecurityOptions:CreateElasticsearchDomain' :: Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions = Maybe AdvancedSecurityOptionsInput
a} :: CreateElasticsearchDomain)

-- | A list of @Tag@ added during domain creation.
createElasticsearchDomain_tagList :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe [Tag])
createElasticsearchDomain_tagList :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_tagList = (CreateElasticsearchDomain -> Maybe [Tag])
-> (CreateElasticsearchDomain
    -> Maybe [Tag] -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe [Tag]
tagList :: Maybe [Tag]
$sel:tagList:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe [Tag]
tagList} -> Maybe [Tag]
tagList) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe [Tag]
a -> CreateElasticsearchDomain
s {$sel:tagList:CreateElasticsearchDomain' :: Maybe [Tag]
tagList = Maybe [Tag]
a} :: CreateElasticsearchDomain) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateElasticsearchDomain -> f CreateElasticsearchDomain)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateElasticsearchDomain
-> f CreateElasticsearchDomain
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

-- | Configuration options for an Elasticsearch domain. Specifies the
-- instance type and number of instances in the domain cluster.
createElasticsearchDomain_elasticsearchClusterConfig :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe ElasticsearchClusterConfig)
createElasticsearchDomain_elasticsearchClusterConfig :: (Maybe ElasticsearchClusterConfig
 -> f (Maybe ElasticsearchClusterConfig))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_elasticsearchClusterConfig = (CreateElasticsearchDomain -> Maybe ElasticsearchClusterConfig)
-> (CreateElasticsearchDomain
    -> Maybe ElasticsearchClusterConfig -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe ElasticsearchClusterConfig)
     (Maybe ElasticsearchClusterConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig :: Maybe ElasticsearchClusterConfig
$sel:elasticsearchClusterConfig:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig} -> Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe ElasticsearchClusterConfig
a -> CreateElasticsearchDomain
s {$sel:elasticsearchClusterConfig:CreateElasticsearchDomain' :: Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig = Maybe ElasticsearchClusterConfig
a} :: CreateElasticsearchDomain)

-- | Option to set time, in UTC format, of the daily automated snapshot.
-- Default value is 0 hours.
createElasticsearchDomain_snapshotOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe SnapshotOptions)
createElasticsearchDomain_snapshotOptions :: (Maybe SnapshotOptions -> f (Maybe SnapshotOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_snapshotOptions = (CreateElasticsearchDomain -> Maybe SnapshotOptions)
-> (CreateElasticsearchDomain
    -> Maybe SnapshotOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe SnapshotOptions)
     (Maybe SnapshotOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe SnapshotOptions
snapshotOptions :: Maybe SnapshotOptions
$sel:snapshotOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe SnapshotOptions
snapshotOptions} -> Maybe SnapshotOptions
snapshotOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe SnapshotOptions
a -> CreateElasticsearchDomain
s {$sel:snapshotOptions:CreateElasticsearchDomain' :: Maybe SnapshotOptions
snapshotOptions = Maybe SnapshotOptions
a} :: CreateElasticsearchDomain)

-- | Options to specify the Cognito user and identity pools for Kibana
-- authentication. For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html Amazon Cognito Authentication for Kibana>.
createElasticsearchDomain_cognitoOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe CognitoOptions)
createElasticsearchDomain_cognitoOptions :: (Maybe CognitoOptions -> f (Maybe CognitoOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_cognitoOptions = (CreateElasticsearchDomain -> Maybe CognitoOptions)
-> (CreateElasticsearchDomain
    -> Maybe CognitoOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe CognitoOptions)
     (Maybe CognitoOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe CognitoOptions
cognitoOptions :: Maybe CognitoOptions
$sel:cognitoOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe CognitoOptions
cognitoOptions} -> Maybe CognitoOptions
cognitoOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe CognitoOptions
a -> CreateElasticsearchDomain
s {$sel:cognitoOptions:CreateElasticsearchDomain' :: Maybe CognitoOptions
cognitoOptions = Maybe CognitoOptions
a} :: CreateElasticsearchDomain)

-- | Specifies the Encryption At Rest Options.
createElasticsearchDomain_encryptionAtRestOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe EncryptionAtRestOptions)
createElasticsearchDomain_encryptionAtRestOptions :: (Maybe EncryptionAtRestOptions
 -> f (Maybe EncryptionAtRestOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_encryptionAtRestOptions = (CreateElasticsearchDomain -> Maybe EncryptionAtRestOptions)
-> (CreateElasticsearchDomain
    -> Maybe EncryptionAtRestOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe EncryptionAtRestOptions)
     (Maybe EncryptionAtRestOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe EncryptionAtRestOptions
encryptionAtRestOptions :: Maybe EncryptionAtRestOptions
$sel:encryptionAtRestOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions} -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe EncryptionAtRestOptions
a -> CreateElasticsearchDomain
s {$sel:encryptionAtRestOptions:CreateElasticsearchDomain' :: Maybe EncryptionAtRestOptions
encryptionAtRestOptions = Maybe EncryptionAtRestOptions
a} :: CreateElasticsearchDomain)

-- | Options to specify the subnets and security groups for VPC endpoint. For
-- more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc Creating a VPC>
-- in /VPC Endpoints for Amazon Elasticsearch Service Domains/
createElasticsearchDomain_vPCOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe VPCOptions)
createElasticsearchDomain_vPCOptions :: (Maybe VPCOptions -> f (Maybe VPCOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_vPCOptions = (CreateElasticsearchDomain -> Maybe VPCOptions)
-> (CreateElasticsearchDomain
    -> Maybe VPCOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe VPCOptions)
     (Maybe VPCOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe VPCOptions
vPCOptions :: Maybe VPCOptions
$sel:vPCOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe VPCOptions
vPCOptions} -> Maybe VPCOptions
vPCOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe VPCOptions
a -> CreateElasticsearchDomain
s {$sel:vPCOptions:CreateElasticsearchDomain' :: Maybe VPCOptions
vPCOptions = Maybe VPCOptions
a} :: CreateElasticsearchDomain)

-- | Options to specify configuration that will be applied to the domain
-- endpoint.
createElasticsearchDomain_domainEndpointOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe DomainEndpointOptions)
createElasticsearchDomain_domainEndpointOptions :: (Maybe DomainEndpointOptions -> f (Maybe DomainEndpointOptions))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_domainEndpointOptions = (CreateElasticsearchDomain -> Maybe DomainEndpointOptions)
-> (CreateElasticsearchDomain
    -> Maybe DomainEndpointOptions -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe DomainEndpointOptions)
     (Maybe DomainEndpointOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe DomainEndpointOptions
domainEndpointOptions :: Maybe DomainEndpointOptions
$sel:domainEndpointOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe DomainEndpointOptions
domainEndpointOptions} -> Maybe DomainEndpointOptions
domainEndpointOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe DomainEndpointOptions
a -> CreateElasticsearchDomain
s {$sel:domainEndpointOptions:CreateElasticsearchDomain' :: Maybe DomainEndpointOptions
domainEndpointOptions = Maybe DomainEndpointOptions
a} :: CreateElasticsearchDomain)

-- | Option to allow references to indices in an HTTP request body. Must be
-- @false@ when configuring access to individual sub-resources. By default,
-- the value is @true@. See
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options Configuration Advanced Options>
-- for more information.
createElasticsearchDomain_advancedOptions :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createElasticsearchDomain_advancedOptions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_advancedOptions = (CreateElasticsearchDomain -> Maybe (HashMap Text Text))
-> (CreateElasticsearchDomain
    -> Maybe (HashMap Text Text) -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe (HashMap Text Text)
advancedOptions :: Maybe (HashMap Text Text)
$sel:advancedOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe (HashMap Text Text)
advancedOptions} -> Maybe (HashMap Text Text)
advancedOptions) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe (HashMap Text Text)
a -> CreateElasticsearchDomain
s {$sel:advancedOptions:CreateElasticsearchDomain' :: Maybe (HashMap Text Text)
advancedOptions = Maybe (HashMap Text Text)
a} :: CreateElasticsearchDomain) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateElasticsearchDomain -> f CreateElasticsearchDomain)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateElasticsearchDomain
-> f CreateElasticsearchDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | String of format X.Y to specify version for the Elasticsearch domain eg.
-- \"1.5\" or \"2.3\". For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains Creating Elasticsearch Domains>
-- in the /Amazon Elasticsearch Service Developer Guide/.
createElasticsearchDomain_elasticsearchVersion :: Lens.Lens' CreateElasticsearchDomain (Prelude.Maybe Prelude.Text)
createElasticsearchDomain_elasticsearchVersion :: (Maybe Text -> f (Maybe Text))
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_elasticsearchVersion = (CreateElasticsearchDomain -> Maybe Text)
-> (CreateElasticsearchDomain
    -> Maybe Text -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain
     CreateElasticsearchDomain
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Maybe Text
elasticsearchVersion :: Maybe Text
$sel:elasticsearchVersion:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe Text
elasticsearchVersion} -> Maybe Text
elasticsearchVersion) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Maybe Text
a -> CreateElasticsearchDomain
s {$sel:elasticsearchVersion:CreateElasticsearchDomain' :: Maybe Text
elasticsearchVersion = Maybe Text
a} :: CreateElasticsearchDomain)

-- | The name of the Elasticsearch domain that you are creating. Domain names
-- are unique across the domains owned by an account within an AWS region.
-- Domain names must start with a lowercase letter and can contain the
-- following characters: a-z (lowercase), 0-9, and - (hyphen).
createElasticsearchDomain_domainName :: Lens.Lens' CreateElasticsearchDomain Prelude.Text
createElasticsearchDomain_domainName :: (Text -> f Text)
-> CreateElasticsearchDomain -> f CreateElasticsearchDomain
createElasticsearchDomain_domainName = (CreateElasticsearchDomain -> Text)
-> (CreateElasticsearchDomain -> Text -> CreateElasticsearchDomain)
-> Lens
     CreateElasticsearchDomain CreateElasticsearchDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomain' {Text
domainName :: Text
$sel:domainName:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Text
domainName} -> Text
domainName) (\s :: CreateElasticsearchDomain
s@CreateElasticsearchDomain' {} Text
a -> CreateElasticsearchDomain
s {$sel:domainName:CreateElasticsearchDomain' :: Text
domainName = Text
a} :: CreateElasticsearchDomain)

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

instance Prelude.NFData CreateElasticsearchDomain

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

instance Core.ToJSON CreateElasticsearchDomain where
  toJSON :: CreateElasticsearchDomain -> Value
toJSON CreateElasticsearchDomain' {Maybe [Tag]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap LogType LogPublishingOption)
Maybe CognitoOptions
Maybe EncryptionAtRestOptions
Maybe NodeToNodeEncryptionOptions
Maybe AdvancedSecurityOptionsInput
Maybe SnapshotOptions
Maybe DomainEndpointOptions
Maybe AutoTuneOptionsInput
Maybe VPCOptions
Maybe EBSOptions
Maybe ElasticsearchClusterConfig
Text
domainName :: Text
elasticsearchVersion :: Maybe Text
advancedOptions :: Maybe (HashMap Text Text)
domainEndpointOptions :: Maybe DomainEndpointOptions
vPCOptions :: Maybe VPCOptions
encryptionAtRestOptions :: Maybe EncryptionAtRestOptions
cognitoOptions :: Maybe CognitoOptions
snapshotOptions :: Maybe SnapshotOptions
elasticsearchClusterConfig :: Maybe ElasticsearchClusterConfig
tagList :: Maybe [Tag]
advancedSecurityOptions :: Maybe AdvancedSecurityOptionsInput
logPublishingOptions :: Maybe (HashMap LogType LogPublishingOption)
autoTuneOptions :: Maybe AutoTuneOptionsInput
accessPolicies :: Maybe Text
nodeToNodeEncryptionOptions :: Maybe NodeToNodeEncryptionOptions
eBSOptions :: Maybe EBSOptions
$sel:domainName:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Text
$sel:elasticsearchVersion:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe Text
$sel:advancedOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe (HashMap Text Text)
$sel:domainEndpointOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe DomainEndpointOptions
$sel:vPCOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe VPCOptions
$sel:encryptionAtRestOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe EncryptionAtRestOptions
$sel:cognitoOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe CognitoOptions
$sel:snapshotOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe SnapshotOptions
$sel:elasticsearchClusterConfig:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe ElasticsearchClusterConfig
$sel:tagList:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe [Tag]
$sel:advancedSecurityOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe AdvancedSecurityOptionsInput
$sel:logPublishingOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain
-> Maybe (HashMap LogType LogPublishingOption)
$sel:autoTuneOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe AutoTuneOptionsInput
$sel:accessPolicies:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe Text
$sel:nodeToNodeEncryptionOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe NodeToNodeEncryptionOptions
$sel:eBSOptions:CreateElasticsearchDomain' :: CreateElasticsearchDomain -> Maybe EBSOptions
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EBSOptions" Text -> EBSOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EBSOptions -> Pair) -> Maybe EBSOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EBSOptions
eBSOptions,
            (Text
"NodeToNodeEncryptionOptions" Text -> NodeToNodeEncryptionOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NodeToNodeEncryptionOptions -> Pair)
-> Maybe NodeToNodeEncryptionOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions,
            (Text
"AccessPolicies" 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
accessPolicies,
            (Text
"AutoTuneOptions" Text -> AutoTuneOptionsInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AutoTuneOptionsInput -> Pair)
-> Maybe AutoTuneOptionsInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoTuneOptionsInput
autoTuneOptions,
            (Text
"LogPublishingOptions" Text -> HashMap LogType LogPublishingOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap LogType LogPublishingOption -> Pair)
-> Maybe (HashMap LogType LogPublishingOption) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions,
            (Text
"AdvancedSecurityOptions" Text -> AdvancedSecurityOptionsInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AdvancedSecurityOptionsInput -> Pair)
-> Maybe AdvancedSecurityOptionsInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions,
            (Text
"TagList" 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]
tagList,
            (Text
"ElasticsearchClusterConfig" Text -> ElasticsearchClusterConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ElasticsearchClusterConfig -> Pair)
-> Maybe ElasticsearchClusterConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchClusterConfig
elasticsearchClusterConfig,
            (Text
"SnapshotOptions" Text -> SnapshotOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SnapshotOptions -> Pair) -> Maybe SnapshotOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SnapshotOptions
snapshotOptions,
            (Text
"CognitoOptions" Text -> CognitoOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CognitoOptions -> Pair) -> Maybe CognitoOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CognitoOptions
cognitoOptions,
            (Text
"EncryptionAtRestOptions" Text -> EncryptionAtRestOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EncryptionAtRestOptions -> Pair)
-> Maybe EncryptionAtRestOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionAtRestOptions
encryptionAtRestOptions,
            (Text
"VPCOptions" Text -> VPCOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VPCOptions -> Pair) -> Maybe VPCOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VPCOptions
vPCOptions,
            (Text
"DomainEndpointOptions" Text -> DomainEndpointOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DomainEndpointOptions -> Pair)
-> Maybe DomainEndpointOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DomainEndpointOptions
domainEndpointOptions,
            (Text
"AdvancedOptions" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
advancedOptions,
            (Text
"ElasticsearchVersion" 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
elasticsearchVersion,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
          ]
      )

instance Core.ToPath CreateElasticsearchDomain where
  toPath :: CreateElasticsearchDomain -> ByteString
toPath = ByteString -> CreateElasticsearchDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-01-01/es/domain"

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

-- | The result of a @CreateElasticsearchDomain@ operation. Contains the
-- status of the newly created Elasticsearch domain.
--
-- /See:/ 'newCreateElasticsearchDomainResponse' smart constructor.
data CreateElasticsearchDomainResponse = CreateElasticsearchDomainResponse'
  { -- | The status of the newly created Elasticsearch domain.
    CreateElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus
domainStatus :: Prelude.Maybe ElasticsearchDomainStatus,
    -- | The response's http status code.
    CreateElasticsearchDomainResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateElasticsearchDomainResponse
-> CreateElasticsearchDomainResponse -> Bool
(CreateElasticsearchDomainResponse
 -> CreateElasticsearchDomainResponse -> Bool)
-> (CreateElasticsearchDomainResponse
    -> CreateElasticsearchDomainResponse -> Bool)
-> Eq CreateElasticsearchDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateElasticsearchDomainResponse
-> CreateElasticsearchDomainResponse -> Bool
$c/= :: CreateElasticsearchDomainResponse
-> CreateElasticsearchDomainResponse -> Bool
== :: CreateElasticsearchDomainResponse
-> CreateElasticsearchDomainResponse -> Bool
$c== :: CreateElasticsearchDomainResponse
-> CreateElasticsearchDomainResponse -> Bool
Prelude.Eq, ReadPrec [CreateElasticsearchDomainResponse]
ReadPrec CreateElasticsearchDomainResponse
Int -> ReadS CreateElasticsearchDomainResponse
ReadS [CreateElasticsearchDomainResponse]
(Int -> ReadS CreateElasticsearchDomainResponse)
-> ReadS [CreateElasticsearchDomainResponse]
-> ReadPrec CreateElasticsearchDomainResponse
-> ReadPrec [CreateElasticsearchDomainResponse]
-> Read CreateElasticsearchDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateElasticsearchDomainResponse]
$creadListPrec :: ReadPrec [CreateElasticsearchDomainResponse]
readPrec :: ReadPrec CreateElasticsearchDomainResponse
$creadPrec :: ReadPrec CreateElasticsearchDomainResponse
readList :: ReadS [CreateElasticsearchDomainResponse]
$creadList :: ReadS [CreateElasticsearchDomainResponse]
readsPrec :: Int -> ReadS CreateElasticsearchDomainResponse
$creadsPrec :: Int -> ReadS CreateElasticsearchDomainResponse
Prelude.Read, Int -> CreateElasticsearchDomainResponse -> ShowS
[CreateElasticsearchDomainResponse] -> ShowS
CreateElasticsearchDomainResponse -> String
(Int -> CreateElasticsearchDomainResponse -> ShowS)
-> (CreateElasticsearchDomainResponse -> String)
-> ([CreateElasticsearchDomainResponse] -> ShowS)
-> Show CreateElasticsearchDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateElasticsearchDomainResponse] -> ShowS
$cshowList :: [CreateElasticsearchDomainResponse] -> ShowS
show :: CreateElasticsearchDomainResponse -> String
$cshow :: CreateElasticsearchDomainResponse -> String
showsPrec :: Int -> CreateElasticsearchDomainResponse -> ShowS
$cshowsPrec :: Int -> CreateElasticsearchDomainResponse -> ShowS
Prelude.Show, (forall x.
 CreateElasticsearchDomainResponse
 -> Rep CreateElasticsearchDomainResponse x)
-> (forall x.
    Rep CreateElasticsearchDomainResponse x
    -> CreateElasticsearchDomainResponse)
-> Generic CreateElasticsearchDomainResponse
forall x.
Rep CreateElasticsearchDomainResponse x
-> CreateElasticsearchDomainResponse
forall x.
CreateElasticsearchDomainResponse
-> Rep CreateElasticsearchDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateElasticsearchDomainResponse x
-> CreateElasticsearchDomainResponse
$cfrom :: forall x.
CreateElasticsearchDomainResponse
-> Rep CreateElasticsearchDomainResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateElasticsearchDomainResponse' 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:
--
-- 'domainStatus', 'createElasticsearchDomainResponse_domainStatus' - The status of the newly created Elasticsearch domain.
--
-- 'httpStatus', 'createElasticsearchDomainResponse_httpStatus' - The response's http status code.
newCreateElasticsearchDomainResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateElasticsearchDomainResponse
newCreateElasticsearchDomainResponse :: Int -> CreateElasticsearchDomainResponse
newCreateElasticsearchDomainResponse Int
pHttpStatus_ =
  CreateElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
-> Int -> CreateElasticsearchDomainResponse
CreateElasticsearchDomainResponse'
    { $sel:domainStatus:CreateElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
domainStatus =
        Maybe ElasticsearchDomainStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateElasticsearchDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the newly created Elasticsearch domain.
createElasticsearchDomainResponse_domainStatus :: Lens.Lens' CreateElasticsearchDomainResponse (Prelude.Maybe ElasticsearchDomainStatus)
createElasticsearchDomainResponse_domainStatus :: (Maybe ElasticsearchDomainStatus
 -> f (Maybe ElasticsearchDomainStatus))
-> CreateElasticsearchDomainResponse
-> f CreateElasticsearchDomainResponse
createElasticsearchDomainResponse_domainStatus = (CreateElasticsearchDomainResponse
 -> Maybe ElasticsearchDomainStatus)
-> (CreateElasticsearchDomainResponse
    -> Maybe ElasticsearchDomainStatus
    -> CreateElasticsearchDomainResponse)
-> Lens
     CreateElasticsearchDomainResponse
     CreateElasticsearchDomainResponse
     (Maybe ElasticsearchDomainStatus)
     (Maybe ElasticsearchDomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateElasticsearchDomainResponse' {Maybe ElasticsearchDomainStatus
domainStatus :: Maybe ElasticsearchDomainStatus
$sel:domainStatus:CreateElasticsearchDomainResponse' :: CreateElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus
domainStatus} -> Maybe ElasticsearchDomainStatus
domainStatus) (\s :: CreateElasticsearchDomainResponse
s@CreateElasticsearchDomainResponse' {} Maybe ElasticsearchDomainStatus
a -> CreateElasticsearchDomainResponse
s {$sel:domainStatus:CreateElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
domainStatus = Maybe ElasticsearchDomainStatus
a} :: CreateElasticsearchDomainResponse)

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

instance
  Prelude.NFData
    CreateElasticsearchDomainResponse