{-# 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.ElasticBeanstalk.CreateEnvironment
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Launches an AWS Elastic Beanstalk environment for the specified
-- application using the specified configuration.
module Amazonka.ElasticBeanstalk.CreateEnvironment
  ( -- * Creating a Request
    CreateEnvironment (..),
    newCreateEnvironment,

    -- * Request Lenses
    createEnvironment_cNAMEPrefix,
    createEnvironment_description,
    createEnvironment_environmentName,
    createEnvironment_groupName,
    createEnvironment_operationsRole,
    createEnvironment_optionSettings,
    createEnvironment_optionsToRemove,
    createEnvironment_platformArn,
    createEnvironment_solutionStackName,
    createEnvironment_tags,
    createEnvironment_templateName,
    createEnvironment_tier,
    createEnvironment_versionLabel,
    createEnvironment_applicationName,

    -- * Destructuring the Response
    EnvironmentDescription (..),
    newEnvironmentDescription,

    -- * Response Lenses
    environmentDescription_abortableOperationInProgress,
    environmentDescription_applicationName,
    environmentDescription_cname,
    environmentDescription_dateCreated,
    environmentDescription_dateUpdated,
    environmentDescription_description,
    environmentDescription_endpointURL,
    environmentDescription_environmentArn,
    environmentDescription_environmentId,
    environmentDescription_environmentLinks,
    environmentDescription_environmentName,
    environmentDescription_health,
    environmentDescription_healthStatus,
    environmentDescription_operationsRole,
    environmentDescription_platformArn,
    environmentDescription_resources,
    environmentDescription_solutionStackName,
    environmentDescription_status,
    environmentDescription_templateName,
    environmentDescription_tier,
    environmentDescription_versionLabel,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newCreateEnvironment' smart constructor.
data CreateEnvironment = CreateEnvironment'
  { -- | If specified, the environment attempts to use this value as the prefix
    -- for the CNAME in your Elastic Beanstalk environment URL. If not
    -- specified, the CNAME is generated automatically by appending a random
    -- alphanumeric string to the environment name.
    CreateEnvironment -> Maybe Text
cNAMEPrefix :: Prelude.Maybe Prelude.Text,
    -- | Your description for this environment.
    CreateEnvironment -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique name for the environment.
    --
    -- Constraint: Must be from 4 to 40 characters in length. The name can
    -- contain only letters, numbers, and hyphens. It can\'t start or end with
    -- a hyphen. This name must be unique within a region in your account. If
    -- the specified name already exists in the region, Elastic Beanstalk
    -- returns an @InvalidParameterValue@ error.
    --
    -- If you don\'t specify the @CNAMEPrefix@ parameter, the environment name
    -- becomes part of the CNAME, and therefore part of the visible URL for
    -- your application.
    CreateEnvironment -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
    -- | The name of the group to which the target environment belongs. Specify a
    -- group name only if the environment\'s name is specified in an
    -- environment manifest and not with the environment name parameter. See
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html Environment Manifest (env.yaml)>
    -- for details.
    CreateEnvironment -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an existing IAM role to be used as the
    -- environment\'s operations role. If specified, Elastic Beanstalk uses the
    -- operations role for permissions to downstream services during this call
    -- and during subsequent calls acting on this environment. To specify an
    -- operations role, you must have the @iam:PassRole@ permission for the
    -- role. For more information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-operationsrole.html Operations roles>
    -- in the /AWS Elastic Beanstalk Developer Guide/.
    CreateEnvironment -> Maybe Text
operationsRole :: Prelude.Maybe Prelude.Text,
    -- | If specified, AWS Elastic Beanstalk sets the specified configuration
    -- options to the requested value in the configuration set for the new
    -- environment. These override the values obtained from the solution stack
    -- or the configuration template.
    CreateEnvironment -> Maybe [ConfigurationOptionSetting]
optionSettings :: Prelude.Maybe [ConfigurationOptionSetting],
    -- | A list of custom user-defined configuration options to remove from the
    -- configuration set for this new environment.
    CreateEnvironment -> Maybe [OptionSpecification]
optionsToRemove :: Prelude.Maybe [OptionSpecification],
    -- | The Amazon Resource Name (ARN) of the custom platform to use with the
    -- environment. For more information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
    -- in the /AWS Elastic Beanstalk Developer Guide/.
    --
    -- If you specify @PlatformArn@, don\'t specify @SolutionStackName@.
    CreateEnvironment -> Maybe Text
platformArn :: Prelude.Maybe Prelude.Text,
    -- | The name of an Elastic Beanstalk solution stack (platform version) to
    -- use with the environment. If specified, Elastic Beanstalk sets the
    -- configuration values to the default values associated with the specified
    -- solution stack. For a list of current solution stacks, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html Elastic Beanstalk Supported Platforms>
    -- in the /AWS Elastic Beanstalk Platforms/ guide.
    --
    -- If you specify @SolutionStackName@, don\'t specify @PlatformArn@ or
    -- @TemplateName@.
    CreateEnvironment -> Maybe Text
solutionStackName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the tags applied to resources in the environment.
    CreateEnvironment -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the Elastic Beanstalk configuration template to use with the
    -- environment.
    --
    -- If you specify @TemplateName@, then don\'t specify @SolutionStackName@.
    CreateEnvironment -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the tier to use in creating this environment. The environment
    -- tier that you choose determines whether Elastic Beanstalk provisions
    -- resources to support a web application that handles HTTP(S) requests or
    -- a web application that handles background-processing tasks.
    CreateEnvironment -> Maybe EnvironmentTier
tier :: Prelude.Maybe EnvironmentTier,
    -- | The name of the application version to deploy.
    --
    -- Default: If not specified, Elastic Beanstalk attempts to deploy the
    -- sample application.
    CreateEnvironment -> Maybe Text
versionLabel :: Prelude.Maybe Prelude.Text,
    -- | The name of the application that is associated with this environment.
    CreateEnvironment -> Text
applicationName :: Prelude.Text
  }
  deriving (CreateEnvironment -> CreateEnvironment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironment -> CreateEnvironment -> Bool
$c/= :: CreateEnvironment -> CreateEnvironment -> Bool
== :: CreateEnvironment -> CreateEnvironment -> Bool
$c== :: CreateEnvironment -> CreateEnvironment -> Bool
Prelude.Eq, ReadPrec [CreateEnvironment]
ReadPrec CreateEnvironment
Int -> ReadS CreateEnvironment
ReadS [CreateEnvironment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEnvironment]
$creadListPrec :: ReadPrec [CreateEnvironment]
readPrec :: ReadPrec CreateEnvironment
$creadPrec :: ReadPrec CreateEnvironment
readList :: ReadS [CreateEnvironment]
$creadList :: ReadS [CreateEnvironment]
readsPrec :: Int -> ReadS CreateEnvironment
$creadsPrec :: Int -> ReadS CreateEnvironment
Prelude.Read, Int -> CreateEnvironment -> ShowS
[CreateEnvironment] -> ShowS
CreateEnvironment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironment] -> ShowS
$cshowList :: [CreateEnvironment] -> ShowS
show :: CreateEnvironment -> String
$cshow :: CreateEnvironment -> String
showsPrec :: Int -> CreateEnvironment -> ShowS
$cshowsPrec :: Int -> CreateEnvironment -> ShowS
Prelude.Show, forall x. Rep CreateEnvironment x -> CreateEnvironment
forall x. CreateEnvironment -> Rep CreateEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEnvironment x -> CreateEnvironment
$cfrom :: forall x. CreateEnvironment -> Rep CreateEnvironment x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironment' 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:
--
-- 'cNAMEPrefix', 'createEnvironment_cNAMEPrefix' - If specified, the environment attempts to use this value as the prefix
-- for the CNAME in your Elastic Beanstalk environment URL. If not
-- specified, the CNAME is generated automatically by appending a random
-- alphanumeric string to the environment name.
--
-- 'description', 'createEnvironment_description' - Your description for this environment.
--
-- 'environmentName', 'createEnvironment_environmentName' - A unique name for the environment.
--
-- Constraint: Must be from 4 to 40 characters in length. The name can
-- contain only letters, numbers, and hyphens. It can\'t start or end with
-- a hyphen. This name must be unique within a region in your account. If
-- the specified name already exists in the region, Elastic Beanstalk
-- returns an @InvalidParameterValue@ error.
--
-- If you don\'t specify the @CNAMEPrefix@ parameter, the environment name
-- becomes part of the CNAME, and therefore part of the visible URL for
-- your application.
--
-- 'groupName', 'createEnvironment_groupName' - The name of the group to which the target environment belongs. Specify a
-- group name only if the environment\'s name is specified in an
-- environment manifest and not with the environment name parameter. See
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html Environment Manifest (env.yaml)>
-- for details.
--
-- 'operationsRole', 'createEnvironment_operationsRole' - The Amazon Resource Name (ARN) of an existing IAM role to be used as the
-- environment\'s operations role. If specified, Elastic Beanstalk uses the
-- operations role for permissions to downstream services during this call
-- and during subsequent calls acting on this environment. To specify an
-- operations role, you must have the @iam:PassRole@ permission for the
-- role. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-operationsrole.html Operations roles>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- 'optionSettings', 'createEnvironment_optionSettings' - If specified, AWS Elastic Beanstalk sets the specified configuration
-- options to the requested value in the configuration set for the new
-- environment. These override the values obtained from the solution stack
-- or the configuration template.
--
-- 'optionsToRemove', 'createEnvironment_optionsToRemove' - A list of custom user-defined configuration options to remove from the
-- configuration set for this new environment.
--
-- 'platformArn', 'createEnvironment_platformArn' - The Amazon Resource Name (ARN) of the custom platform to use with the
-- environment. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- If you specify @PlatformArn@, don\'t specify @SolutionStackName@.
--
-- 'solutionStackName', 'createEnvironment_solutionStackName' - The name of an Elastic Beanstalk solution stack (platform version) to
-- use with the environment. If specified, Elastic Beanstalk sets the
-- configuration values to the default values associated with the specified
-- solution stack. For a list of current solution stacks, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html Elastic Beanstalk Supported Platforms>
-- in the /AWS Elastic Beanstalk Platforms/ guide.
--
-- If you specify @SolutionStackName@, don\'t specify @PlatformArn@ or
-- @TemplateName@.
--
-- 'tags', 'createEnvironment_tags' - Specifies the tags applied to resources in the environment.
--
-- 'templateName', 'createEnvironment_templateName' - The name of the Elastic Beanstalk configuration template to use with the
-- environment.
--
-- If you specify @TemplateName@, then don\'t specify @SolutionStackName@.
--
-- 'tier', 'createEnvironment_tier' - Specifies the tier to use in creating this environment. The environment
-- tier that you choose determines whether Elastic Beanstalk provisions
-- resources to support a web application that handles HTTP(S) requests or
-- a web application that handles background-processing tasks.
--
-- 'versionLabel', 'createEnvironment_versionLabel' - The name of the application version to deploy.
--
-- Default: If not specified, Elastic Beanstalk attempts to deploy the
-- sample application.
--
-- 'applicationName', 'createEnvironment_applicationName' - The name of the application that is associated with this environment.
newCreateEnvironment ::
  -- | 'applicationName'
  Prelude.Text ->
  CreateEnvironment
newCreateEnvironment :: Text -> CreateEnvironment
newCreateEnvironment Text
pApplicationName_ =
  CreateEnvironment'
    { $sel:cNAMEPrefix:CreateEnvironment' :: Maybe Text
cNAMEPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateEnvironment' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentName:CreateEnvironment' :: Maybe Text
environmentName = forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:CreateEnvironment' :: Maybe Text
groupName = forall a. Maybe a
Prelude.Nothing,
      $sel:operationsRole:CreateEnvironment' :: Maybe Text
operationsRole = forall a. Maybe a
Prelude.Nothing,
      $sel:optionSettings:CreateEnvironment' :: Maybe [ConfigurationOptionSetting]
optionSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:optionsToRemove:CreateEnvironment' :: Maybe [OptionSpecification]
optionsToRemove = forall a. Maybe a
Prelude.Nothing,
      $sel:platformArn:CreateEnvironment' :: Maybe Text
platformArn = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionStackName:CreateEnvironment' :: Maybe Text
solutionStackName = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateEnvironment' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:CreateEnvironment' :: Maybe Text
templateName = forall a. Maybe a
Prelude.Nothing,
      $sel:tier:CreateEnvironment' :: Maybe EnvironmentTier
tier = forall a. Maybe a
Prelude.Nothing,
      $sel:versionLabel:CreateEnvironment' :: Maybe Text
versionLabel = forall a. Maybe a
Prelude.Nothing,
      $sel:applicationName:CreateEnvironment' :: Text
applicationName = Text
pApplicationName_
    }

-- | If specified, the environment attempts to use this value as the prefix
-- for the CNAME in your Elastic Beanstalk environment URL. If not
-- specified, the CNAME is generated automatically by appending a random
-- alphanumeric string to the environment name.
createEnvironment_cNAMEPrefix :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_cNAMEPrefix :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_cNAMEPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
cNAMEPrefix :: Maybe Text
$sel:cNAMEPrefix:CreateEnvironment' :: CreateEnvironment -> Maybe Text
cNAMEPrefix} -> Maybe Text
cNAMEPrefix) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:cNAMEPrefix:CreateEnvironment' :: Maybe Text
cNAMEPrefix = Maybe Text
a} :: CreateEnvironment)

-- | Your description for this environment.
createEnvironment_description :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_description :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
description :: Maybe Text
$sel:description:CreateEnvironment' :: CreateEnvironment -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:description:CreateEnvironment' :: Maybe Text
description = Maybe Text
a} :: CreateEnvironment)

-- | A unique name for the environment.
--
-- Constraint: Must be from 4 to 40 characters in length. The name can
-- contain only letters, numbers, and hyphens. It can\'t start or end with
-- a hyphen. This name must be unique within a region in your account. If
-- the specified name already exists in the region, Elastic Beanstalk
-- returns an @InvalidParameterValue@ error.
--
-- If you don\'t specify the @CNAMEPrefix@ parameter, the environment name
-- becomes part of the CNAME, and therefore part of the visible URL for
-- your application.
createEnvironment_environmentName :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_environmentName :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_environmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:environmentName:CreateEnvironment' :: Maybe Text
environmentName = Maybe Text
a} :: CreateEnvironment)

-- | The name of the group to which the target environment belongs. Specify a
-- group name only if the environment\'s name is specified in an
-- environment manifest and not with the environment name parameter. See
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html Environment Manifest (env.yaml)>
-- for details.
createEnvironment_groupName :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_groupName :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_groupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
groupName :: Maybe Text
$sel:groupName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:groupName:CreateEnvironment' :: Maybe Text
groupName = Maybe Text
a} :: CreateEnvironment)

-- | The Amazon Resource Name (ARN) of an existing IAM role to be used as the
-- environment\'s operations role. If specified, Elastic Beanstalk uses the
-- operations role for permissions to downstream services during this call
-- and during subsequent calls acting on this environment. To specify an
-- operations role, you must have the @iam:PassRole@ permission for the
-- role. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-operationsrole.html Operations roles>
-- in the /AWS Elastic Beanstalk Developer Guide/.
createEnvironment_operationsRole :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_operationsRole :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_operationsRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
operationsRole :: Maybe Text
$sel:operationsRole:CreateEnvironment' :: CreateEnvironment -> Maybe Text
operationsRole} -> Maybe Text
operationsRole) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:operationsRole:CreateEnvironment' :: Maybe Text
operationsRole = Maybe Text
a} :: CreateEnvironment)

-- | If specified, AWS Elastic Beanstalk sets the specified configuration
-- options to the requested value in the configuration set for the new
-- environment. These override the values obtained from the solution stack
-- or the configuration template.
createEnvironment_optionSettings :: Lens.Lens' CreateEnvironment (Prelude.Maybe [ConfigurationOptionSetting])
createEnvironment_optionSettings :: Lens' CreateEnvironment (Maybe [ConfigurationOptionSetting])
createEnvironment_optionSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe [ConfigurationOptionSetting]
optionSettings :: Maybe [ConfigurationOptionSetting]
$sel:optionSettings:CreateEnvironment' :: CreateEnvironment -> Maybe [ConfigurationOptionSetting]
optionSettings} -> Maybe [ConfigurationOptionSetting]
optionSettings) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe [ConfigurationOptionSetting]
a -> CreateEnvironment
s {$sel:optionSettings:CreateEnvironment' :: Maybe [ConfigurationOptionSetting]
optionSettings = Maybe [ConfigurationOptionSetting]
a} :: CreateEnvironment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of custom user-defined configuration options to remove from the
-- configuration set for this new environment.
createEnvironment_optionsToRemove :: Lens.Lens' CreateEnvironment (Prelude.Maybe [OptionSpecification])
createEnvironment_optionsToRemove :: Lens' CreateEnvironment (Maybe [OptionSpecification])
createEnvironment_optionsToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe [OptionSpecification]
optionsToRemove :: Maybe [OptionSpecification]
$sel:optionsToRemove:CreateEnvironment' :: CreateEnvironment -> Maybe [OptionSpecification]
optionsToRemove} -> Maybe [OptionSpecification]
optionsToRemove) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe [OptionSpecification]
a -> CreateEnvironment
s {$sel:optionsToRemove:CreateEnvironment' :: Maybe [OptionSpecification]
optionsToRemove = Maybe [OptionSpecification]
a} :: CreateEnvironment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the custom platform to use with the
-- environment. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- If you specify @PlatformArn@, don\'t specify @SolutionStackName@.
createEnvironment_platformArn :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_platformArn :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_platformArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
platformArn :: Maybe Text
$sel:platformArn:CreateEnvironment' :: CreateEnvironment -> Maybe Text
platformArn} -> Maybe Text
platformArn) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:platformArn:CreateEnvironment' :: Maybe Text
platformArn = Maybe Text
a} :: CreateEnvironment)

-- | The name of an Elastic Beanstalk solution stack (platform version) to
-- use with the environment. If specified, Elastic Beanstalk sets the
-- configuration values to the default values associated with the specified
-- solution stack. For a list of current solution stacks, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html Elastic Beanstalk Supported Platforms>
-- in the /AWS Elastic Beanstalk Platforms/ guide.
--
-- If you specify @SolutionStackName@, don\'t specify @PlatformArn@ or
-- @TemplateName@.
createEnvironment_solutionStackName :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_solutionStackName :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_solutionStackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
solutionStackName :: Maybe Text
$sel:solutionStackName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
solutionStackName} -> Maybe Text
solutionStackName) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:solutionStackName:CreateEnvironment' :: Maybe Text
solutionStackName = Maybe Text
a} :: CreateEnvironment)

-- | Specifies the tags applied to resources in the environment.
createEnvironment_tags :: Lens.Lens' CreateEnvironment (Prelude.Maybe [Tag])
createEnvironment_tags :: Lens' CreateEnvironment (Maybe [Tag])
createEnvironment_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateEnvironment' :: CreateEnvironment -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe [Tag]
a -> CreateEnvironment
s {$sel:tags:CreateEnvironment' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateEnvironment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Elastic Beanstalk configuration template to use with the
-- environment.
--
-- If you specify @TemplateName@, then don\'t specify @SolutionStackName@.
createEnvironment_templateName :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_templateName :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
templateName :: Maybe Text
$sel:templateName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
templateName} -> Maybe Text
templateName) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:templateName:CreateEnvironment' :: Maybe Text
templateName = Maybe Text
a} :: CreateEnvironment)

-- | Specifies the tier to use in creating this environment. The environment
-- tier that you choose determines whether Elastic Beanstalk provisions
-- resources to support a web application that handles HTTP(S) requests or
-- a web application that handles background-processing tasks.
createEnvironment_tier :: Lens.Lens' CreateEnvironment (Prelude.Maybe EnvironmentTier)
createEnvironment_tier :: Lens' CreateEnvironment (Maybe EnvironmentTier)
createEnvironment_tier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe EnvironmentTier
tier :: Maybe EnvironmentTier
$sel:tier:CreateEnvironment' :: CreateEnvironment -> Maybe EnvironmentTier
tier} -> Maybe EnvironmentTier
tier) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe EnvironmentTier
a -> CreateEnvironment
s {$sel:tier:CreateEnvironment' :: Maybe EnvironmentTier
tier = Maybe EnvironmentTier
a} :: CreateEnvironment)

-- | The name of the application version to deploy.
--
-- Default: If not specified, Elastic Beanstalk attempts to deploy the
-- sample application.
createEnvironment_versionLabel :: Lens.Lens' CreateEnvironment (Prelude.Maybe Prelude.Text)
createEnvironment_versionLabel :: Lens' CreateEnvironment (Maybe Text)
createEnvironment_versionLabel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Maybe Text
versionLabel :: Maybe Text
$sel:versionLabel:CreateEnvironment' :: CreateEnvironment -> Maybe Text
versionLabel} -> Maybe Text
versionLabel) (\s :: CreateEnvironment
s@CreateEnvironment' {} Maybe Text
a -> CreateEnvironment
s {$sel:versionLabel:CreateEnvironment' :: Maybe Text
versionLabel = Maybe Text
a} :: CreateEnvironment)

-- | The name of the application that is associated with this environment.
createEnvironment_applicationName :: Lens.Lens' CreateEnvironment Prelude.Text
createEnvironment_applicationName :: Lens' CreateEnvironment Text
createEnvironment_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironment' {Text
applicationName :: Text
$sel:applicationName:CreateEnvironment' :: CreateEnvironment -> Text
applicationName} -> Text
applicationName) (\s :: CreateEnvironment
s@CreateEnvironment' {} Text
a -> CreateEnvironment
s {$sel:applicationName:CreateEnvironment' :: Text
applicationName = Text
a} :: CreateEnvironment)

instance Core.AWSRequest CreateEnvironment where
  type
    AWSResponse CreateEnvironment =
      EnvironmentDescription
  request :: (Service -> Service)
-> CreateEnvironment -> Request CreateEnvironment
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateEnvironment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEnvironment)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateEnvironmentResult"
      (\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)

instance Prelude.Hashable CreateEnvironment where
  hashWithSalt :: Int -> CreateEnvironment -> Int
hashWithSalt Int
_salt CreateEnvironment' {Maybe [ConfigurationOptionSetting]
Maybe [OptionSpecification]
Maybe [Tag]
Maybe Text
Maybe EnvironmentTier
Text
applicationName :: Text
versionLabel :: Maybe Text
tier :: Maybe EnvironmentTier
templateName :: Maybe Text
tags :: Maybe [Tag]
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionsToRemove :: Maybe [OptionSpecification]
optionSettings :: Maybe [ConfigurationOptionSetting]
operationsRole :: Maybe Text
groupName :: Maybe Text
environmentName :: Maybe Text
description :: Maybe Text
cNAMEPrefix :: Maybe Text
$sel:applicationName:CreateEnvironment' :: CreateEnvironment -> Text
$sel:versionLabel:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tier:CreateEnvironment' :: CreateEnvironment -> Maybe EnvironmentTier
$sel:templateName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tags:CreateEnvironment' :: CreateEnvironment -> Maybe [Tag]
$sel:solutionStackName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:platformArn:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:optionsToRemove:CreateEnvironment' :: CreateEnvironment -> Maybe [OptionSpecification]
$sel:optionSettings:CreateEnvironment' :: CreateEnvironment -> Maybe [ConfigurationOptionSetting]
$sel:operationsRole:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:groupName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:environmentName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:description:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:cNAMEPrefix:CreateEnvironment' :: CreateEnvironment -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cNAMEPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
environmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
operationsRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConfigurationOptionSetting]
optionSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [OptionSpecification]
optionsToRemove
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
solutionStackName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnvironmentTier
tier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionLabel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationName

instance Prelude.NFData CreateEnvironment where
  rnf :: CreateEnvironment -> ()
rnf CreateEnvironment' {Maybe [ConfigurationOptionSetting]
Maybe [OptionSpecification]
Maybe [Tag]
Maybe Text
Maybe EnvironmentTier
Text
applicationName :: Text
versionLabel :: Maybe Text
tier :: Maybe EnvironmentTier
templateName :: Maybe Text
tags :: Maybe [Tag]
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionsToRemove :: Maybe [OptionSpecification]
optionSettings :: Maybe [ConfigurationOptionSetting]
operationsRole :: Maybe Text
groupName :: Maybe Text
environmentName :: Maybe Text
description :: Maybe Text
cNAMEPrefix :: Maybe Text
$sel:applicationName:CreateEnvironment' :: CreateEnvironment -> Text
$sel:versionLabel:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tier:CreateEnvironment' :: CreateEnvironment -> Maybe EnvironmentTier
$sel:templateName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tags:CreateEnvironment' :: CreateEnvironment -> Maybe [Tag]
$sel:solutionStackName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:platformArn:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:optionsToRemove:CreateEnvironment' :: CreateEnvironment -> Maybe [OptionSpecification]
$sel:optionSettings:CreateEnvironment' :: CreateEnvironment -> Maybe [ConfigurationOptionSetting]
$sel:operationsRole:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:groupName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:environmentName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:description:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:cNAMEPrefix:CreateEnvironment' :: CreateEnvironment -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cNAMEPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
environmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationsRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConfigurationOptionSetting]
optionSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [OptionSpecification]
optionsToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
solutionStackName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnvironmentTier
tier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionLabel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationName

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

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

instance Data.ToQuery CreateEnvironment where
  toQuery :: CreateEnvironment -> QueryString
toQuery CreateEnvironment' {Maybe [ConfigurationOptionSetting]
Maybe [OptionSpecification]
Maybe [Tag]
Maybe Text
Maybe EnvironmentTier
Text
applicationName :: Text
versionLabel :: Maybe Text
tier :: Maybe EnvironmentTier
templateName :: Maybe Text
tags :: Maybe [Tag]
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionsToRemove :: Maybe [OptionSpecification]
optionSettings :: Maybe [ConfigurationOptionSetting]
operationsRole :: Maybe Text
groupName :: Maybe Text
environmentName :: Maybe Text
description :: Maybe Text
cNAMEPrefix :: Maybe Text
$sel:applicationName:CreateEnvironment' :: CreateEnvironment -> Text
$sel:versionLabel:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tier:CreateEnvironment' :: CreateEnvironment -> Maybe EnvironmentTier
$sel:templateName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:tags:CreateEnvironment' :: CreateEnvironment -> Maybe [Tag]
$sel:solutionStackName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:platformArn:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:optionsToRemove:CreateEnvironment' :: CreateEnvironment -> Maybe [OptionSpecification]
$sel:optionSettings:CreateEnvironment' :: CreateEnvironment -> Maybe [ConfigurationOptionSetting]
$sel:operationsRole:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:groupName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:environmentName:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:description:CreateEnvironment' :: CreateEnvironment -> Maybe Text
$sel:cNAMEPrefix:CreateEnvironment' :: CreateEnvironment -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateEnvironment" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"CNAMEPrefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cNAMEPrefix,
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"EnvironmentName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
environmentName,
        ByteString
"GroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
groupName,
        ByteString
"OperationsRole" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
operationsRole,
        ByteString
"OptionSettings"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConfigurationOptionSetting]
optionSettings
            ),
        ByteString
"OptionsToRemove"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OptionSpecification]
optionsToRemove
            ),
        ByteString
"PlatformArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
platformArn,
        ByteString
"SolutionStackName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
solutionStackName,
        ByteString
"Tags"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"TemplateName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
templateName,
        ByteString
"Tier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe EnvironmentTier
tier,
        ByteString
"VersionLabel" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
versionLabel,
        ByteString
"ApplicationName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
applicationName
      ]