{-# 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.Batch.CreateComputeEnvironment
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Batch compute environment. You can create @MANAGED@ or
-- @UNMANAGED@ compute environments. @MANAGED@ compute environments can use
-- Amazon EC2 or Fargate resources. @UNMANAGED@ compute environments can
-- only use EC2 resources.
--
-- In a managed compute environment, Batch manages the capacity and
-- instance types of the compute resources within the environment. This is
-- based on the compute resource specification that you define or the
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html launch template>
-- that you specify when you create the compute environment. Either, you
-- can choose to use EC2 On-Demand Instances and EC2 Spot Instances. Or,
-- you can use Fargate and Fargate Spot capacity in your managed compute
-- environment. You can optionally set a maximum price so that Spot
-- Instances only launch when the Spot Instance price is less than a
-- specified percentage of the On-Demand price.
--
-- Multi-node parallel jobs aren\'t supported on Spot Instances.
--
-- In an unmanaged compute environment, you can manage your own EC2 compute
-- resources and have flexibility with how you configure your compute
-- resources. For example, you can use custom AMIs. However, you must
-- verify that each of your AMIs meet the Amazon ECS container instance AMI
-- specification. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html container instance AMIs>
-- in the /Amazon Elastic Container Service Developer Guide/. After you
-- created your unmanaged compute environment, you can use the
-- DescribeComputeEnvironments operation to find the Amazon ECS cluster
-- that\'s associated with it. Then, launch your container instances into
-- that Amazon ECS cluster. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html Launching an Amazon ECS container instance>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- To create a compute environment that uses EKS resources, the caller must
-- have permissions to call @eks:DescribeCluster@.
--
-- Batch doesn\'t automatically upgrade the AMIs in a compute environment
-- after it\'s created. For example, it also doesn\'t update the AMIs in
-- your compute environment when a newer version of the Amazon ECS
-- optimized AMI is available. You\'re responsible for the management of
-- the guest operating system. This includes any updates and security
-- patches. You\'re also responsible for any additional application
-- software or utilities that you install on the compute resources. There
-- are two ways to use a new AMI for your Batch jobs. The original method
-- is to complete these steps:
--
-- 1.  Create a new compute environment with the new AMI.
--
-- 2.  Add the compute environment to an existing job queue.
--
-- 3.  Remove the earlier compute environment from your job queue.
--
-- 4.  Delete the earlier compute environment.
--
-- In April 2022, Batch added enhanced support for updating compute
-- environments. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html Updating compute environments>.
-- To use the enhanced updating of compute environments to update AMIs,
-- follow these rules:
--
-- -   Either don\'t set the service role (@serviceRole@) parameter or set
--     it to the __AWSBatchServiceRole__ service-linked role.
--
-- -   Set the allocation strategy (@allocationStrategy@) parameter to
--     @BEST_FIT_PROGRESSIVE@ or @SPOT_CAPACITY_OPTIMIZED@.
--
-- -   Set the update to latest image version
--     (@updateToLatestImageVersion@) parameter to @true@.
--
-- -   Don\'t specify an AMI ID in @imageId@, @imageIdOverride@ (in
--     <https://docs.aws.amazon.com/batch/latest/APIReference/API_Ec2Configuration.html ec2Configuration>
--     ), or in the launch template (@launchTemplate@). In that case, Batch
--     selects the latest Amazon ECS optimized AMI that\'s supported by
--     Batch at the time the infrastructure update is initiated.
--     Alternatively, you can specify the AMI ID in the @imageId@ or
--     @imageIdOverride@ parameters, or the launch template identified by
--     the @LaunchTemplate@ properties. Changing any of these properties
--     starts an infrastructure update. If the AMI ID is specified in the
--     launch template, it can\'t be replaced by specifying an AMI ID in
--     either the @imageId@ or @imageIdOverride@ parameters. It can only be
--     replaced by specifying a different launch template, or if the launch
--     template version is set to @$Default@ or @$Latest@, by setting
--     either a new default version for the launch template (if @$Default@)
--     or by adding a new version to the launch template (if @$Latest@).
--
-- If these rules are followed, any update that starts an infrastructure
-- update causes the AMI ID to be re-selected. If the @version@ setting in
-- the launch template (@launchTemplate@) is set to @$Latest@ or
-- @$Default@, the latest or default version of the launch template is
-- evaluated up at the time of the infrastructure update, even if the
-- @launchTemplate@ wasn\'t updated.
module Amazonka.Batch.CreateComputeEnvironment
  ( -- * Creating a Request
    CreateComputeEnvironment (..),
    newCreateComputeEnvironment,

    -- * Request Lenses
    createComputeEnvironment_computeResources,
    createComputeEnvironment_eksConfiguration,
    createComputeEnvironment_serviceRole,
    createComputeEnvironment_state,
    createComputeEnvironment_tags,
    createComputeEnvironment_unmanagedvCpus,
    createComputeEnvironment_computeEnvironmentName,
    createComputeEnvironment_type,

    -- * Destructuring the Response
    CreateComputeEnvironmentResponse (..),
    newCreateComputeEnvironmentResponse,

    -- * Response Lenses
    createComputeEnvironmentResponse_computeEnvironmentArn,
    createComputeEnvironmentResponse_computeEnvironmentName,
    createComputeEnvironmentResponse_httpStatus,
  )
where

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

-- | Contains the parameters for @CreateComputeEnvironment@.
--
-- /See:/ 'newCreateComputeEnvironment' smart constructor.
data CreateComputeEnvironment = CreateComputeEnvironment'
  { -- | Details about the compute resources managed by the compute environment.
    -- This parameter is required for managed compute environments. For more
    -- information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
    -- in the /Batch User Guide/.
    CreateComputeEnvironment -> Maybe ComputeResource
computeResources :: Prelude.Maybe ComputeResource,
    -- | The details for the Amazon EKS cluster that supports the compute
    -- environment.
    CreateComputeEnvironment -> Maybe EksConfiguration
eksConfiguration :: Prelude.Maybe EksConfiguration,
    -- | The full Amazon Resource Name (ARN) of the IAM role that allows Batch to
    -- make calls to other Amazon Web Services services on your behalf. For
    -- more information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
    -- in the /Batch User Guide/.
    --
    -- If your account already created the Batch service-linked role, that role
    -- is used by default for your compute environment unless you specify a
    -- different role here. If the Batch service-linked role doesn\'t exist in
    -- your account, and no role is specified here, the service attempts to
    -- create the Batch service-linked role in your account.
    --
    -- If your specified role has a path other than @\/@, then you must specify
    -- either the full role ARN (recommended) or prefix the role name with the
    -- path. For example, if a role with the name @bar@ has a path of
    -- @\/foo\/@, specify @\/foo\/bar@ as the role name. For more information,
    -- see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names Friendly names and paths>
    -- in the /IAM User Guide/.
    --
    -- Depending on how you created your Batch service role, its ARN might
    -- contain the @service-role@ path prefix. When you only specify the name
    -- of the service role, Batch assumes that your ARN doesn\'t use the
    -- @service-role@ path prefix. Because of this, we recommend that you
    -- specify the full ARN of your service role when you create compute
    -- environments.
    CreateComputeEnvironment -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text,
    -- | The state of the compute environment. If the state is @ENABLED@, then
    -- the compute environment accepts jobs from a queue and can scale out
    -- automatically based on queues.
    --
    -- If the state is @ENABLED@, then the Batch scheduler can attempt to place
    -- jobs from an associated job queue on the compute resources within the
    -- environment. If the compute environment is managed, then it can scale
    -- its instances out or in automatically, based on the job queue demand.
    --
    -- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
    -- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
    -- state continue to progress normally. Managed compute environments in the
    -- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
    -- value after instances become idle.
    CreateComputeEnvironment -> Maybe CEState
state :: Prelude.Maybe CEState,
    -- | The tags that you apply to the compute environment to help you
    -- categorize and organize your resources. Each tag consists of a key and
    -- an optional value. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
    -- in /Amazon Web Services General Reference/.
    --
    -- These tags can be updated or removed using the
    -- <https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html TagResource>
    -- and
    -- <https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html UntagResource>
    -- API operations. These tags don\'t propagate to the underlying compute
    -- resources.
    CreateComputeEnvironment -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The maximum number of vCPUs for an unmanaged compute environment. This
    -- parameter is only used for fair share scheduling to reserve vCPU
    -- capacity for new share identifiers. If this parameter isn\'t provided
    -- for a fair share job queue, no vCPU capacity is reserved.
    --
    -- This parameter is only supported when the @type@ parameter is set to
    -- @UNMANAGED@.
    CreateComputeEnvironment -> Maybe Int
unmanagedvCpus :: Prelude.Maybe Prelude.Int,
    -- | The name for your compute environment. It can be up to 128 characters
    -- long. It can contain uppercase and lowercase letters, numbers, hyphens
    -- (-), and underscores (_).
    CreateComputeEnvironment -> Text
computeEnvironmentName :: Prelude.Text,
    -- | The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
    -- information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
    -- in the /Batch User Guide/.
    CreateComputeEnvironment -> CEType
type' :: CEType
  }
  deriving (CreateComputeEnvironment -> CreateComputeEnvironment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComputeEnvironment -> CreateComputeEnvironment -> Bool
$c/= :: CreateComputeEnvironment -> CreateComputeEnvironment -> Bool
== :: CreateComputeEnvironment -> CreateComputeEnvironment -> Bool
$c== :: CreateComputeEnvironment -> CreateComputeEnvironment -> Bool
Prelude.Eq, ReadPrec [CreateComputeEnvironment]
ReadPrec CreateComputeEnvironment
Int -> ReadS CreateComputeEnvironment
ReadS [CreateComputeEnvironment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComputeEnvironment]
$creadListPrec :: ReadPrec [CreateComputeEnvironment]
readPrec :: ReadPrec CreateComputeEnvironment
$creadPrec :: ReadPrec CreateComputeEnvironment
readList :: ReadS [CreateComputeEnvironment]
$creadList :: ReadS [CreateComputeEnvironment]
readsPrec :: Int -> ReadS CreateComputeEnvironment
$creadsPrec :: Int -> ReadS CreateComputeEnvironment
Prelude.Read, Int -> CreateComputeEnvironment -> ShowS
[CreateComputeEnvironment] -> ShowS
CreateComputeEnvironment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComputeEnvironment] -> ShowS
$cshowList :: [CreateComputeEnvironment] -> ShowS
show :: CreateComputeEnvironment -> String
$cshow :: CreateComputeEnvironment -> String
showsPrec :: Int -> CreateComputeEnvironment -> ShowS
$cshowsPrec :: Int -> CreateComputeEnvironment -> ShowS
Prelude.Show, forall x.
Rep CreateComputeEnvironment x -> CreateComputeEnvironment
forall x.
CreateComputeEnvironment -> Rep CreateComputeEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateComputeEnvironment x -> CreateComputeEnvironment
$cfrom :: forall x.
CreateComputeEnvironment -> Rep CreateComputeEnvironment x
Prelude.Generic)

-- |
-- Create a value of 'CreateComputeEnvironment' 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:
--
-- 'computeResources', 'createComputeEnvironment_computeResources' - Details about the compute resources managed by the compute environment.
-- This parameter is required for managed compute environments. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
--
-- 'eksConfiguration', 'createComputeEnvironment_eksConfiguration' - The details for the Amazon EKS cluster that supports the compute
-- environment.
--
-- 'serviceRole', 'createComputeEnvironment_serviceRole' - The full Amazon Resource Name (ARN) of the IAM role that allows Batch to
-- make calls to other Amazon Web Services services on your behalf. For
-- more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
-- in the /Batch User Guide/.
--
-- If your account already created the Batch service-linked role, that role
-- is used by default for your compute environment unless you specify a
-- different role here. If the Batch service-linked role doesn\'t exist in
-- your account, and no role is specified here, the service attempts to
-- create the Batch service-linked role in your account.
--
-- If your specified role has a path other than @\/@, then you must specify
-- either the full role ARN (recommended) or prefix the role name with the
-- path. For example, if a role with the name @bar@ has a path of
-- @\/foo\/@, specify @\/foo\/bar@ as the role name. For more information,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names Friendly names and paths>
-- in the /IAM User Guide/.
--
-- Depending on how you created your Batch service role, its ARN might
-- contain the @service-role@ path prefix. When you only specify the name
-- of the service role, Batch assumes that your ARN doesn\'t use the
-- @service-role@ path prefix. Because of this, we recommend that you
-- specify the full ARN of your service role when you create compute
-- environments.
--
-- 'state', 'createComputeEnvironment_state' - The state of the compute environment. If the state is @ENABLED@, then
-- the compute environment accepts jobs from a queue and can scale out
-- automatically based on queues.
--
-- If the state is @ENABLED@, then the Batch scheduler can attempt to place
-- jobs from an associated job queue on the compute resources within the
-- environment. If the compute environment is managed, then it can scale
-- its instances out or in automatically, based on the job queue demand.
--
-- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
-- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
-- state continue to progress normally. Managed compute environments in the
-- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
-- value after instances become idle.
--
-- 'tags', 'createComputeEnvironment_tags' - The tags that you apply to the compute environment to help you
-- categorize and organize your resources. Each tag consists of a key and
-- an optional value. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in /Amazon Web Services General Reference/.
--
-- These tags can be updated or removed using the
-- <https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html TagResource>
-- and
-- <https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html UntagResource>
-- API operations. These tags don\'t propagate to the underlying compute
-- resources.
--
-- 'unmanagedvCpus', 'createComputeEnvironment_unmanagedvCpus' - The maximum number of vCPUs for an unmanaged compute environment. This
-- parameter is only used for fair share scheduling to reserve vCPU
-- capacity for new share identifiers. If this parameter isn\'t provided
-- for a fair share job queue, no vCPU capacity is reserved.
--
-- This parameter is only supported when the @type@ parameter is set to
-- @UNMANAGED@.
--
-- 'computeEnvironmentName', 'createComputeEnvironment_computeEnvironmentName' - The name for your compute environment. It can be up to 128 characters
-- long. It can contain uppercase and lowercase letters, numbers, hyphens
-- (-), and underscores (_).
--
-- 'type'', 'createComputeEnvironment_type' - The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
newCreateComputeEnvironment ::
  -- | 'computeEnvironmentName'
  Prelude.Text ->
  -- | 'type''
  CEType ->
  CreateComputeEnvironment
newCreateComputeEnvironment :: Text -> CEType -> CreateComputeEnvironment
newCreateComputeEnvironment
  Text
pComputeEnvironmentName_
  CEType
pType_ =
    CreateComputeEnvironment'
      { $sel:computeResources:CreateComputeEnvironment' :: Maybe ComputeResource
computeResources =
          forall a. Maybe a
Prelude.Nothing,
        $sel:eksConfiguration:CreateComputeEnvironment' :: Maybe EksConfiguration
eksConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:serviceRole:CreateComputeEnvironment' :: Maybe Text
serviceRole = forall a. Maybe a
Prelude.Nothing,
        $sel:state:CreateComputeEnvironment' :: Maybe CEState
state = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateComputeEnvironment' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:unmanagedvCpus:CreateComputeEnvironment' :: Maybe Int
unmanagedvCpus = forall a. Maybe a
Prelude.Nothing,
        $sel:computeEnvironmentName:CreateComputeEnvironment' :: Text
computeEnvironmentName = Text
pComputeEnvironmentName_,
        $sel:type':CreateComputeEnvironment' :: CEType
type' = CEType
pType_
      }

-- | Details about the compute resources managed by the compute environment.
-- This parameter is required for managed compute environments. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
createComputeEnvironment_computeResources :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe ComputeResource)
createComputeEnvironment_computeResources :: Lens' CreateComputeEnvironment (Maybe ComputeResource)
createComputeEnvironment_computeResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe ComputeResource
computeResources :: Maybe ComputeResource
$sel:computeResources:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe ComputeResource
computeResources} -> Maybe ComputeResource
computeResources) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe ComputeResource
a -> CreateComputeEnvironment
s {$sel:computeResources:CreateComputeEnvironment' :: Maybe ComputeResource
computeResources = Maybe ComputeResource
a} :: CreateComputeEnvironment)

-- | The details for the Amazon EKS cluster that supports the compute
-- environment.
createComputeEnvironment_eksConfiguration :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe EksConfiguration)
createComputeEnvironment_eksConfiguration :: Lens' CreateComputeEnvironment (Maybe EksConfiguration)
createComputeEnvironment_eksConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe EksConfiguration
eksConfiguration :: Maybe EksConfiguration
$sel:eksConfiguration:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe EksConfiguration
eksConfiguration} -> Maybe EksConfiguration
eksConfiguration) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe EksConfiguration
a -> CreateComputeEnvironment
s {$sel:eksConfiguration:CreateComputeEnvironment' :: Maybe EksConfiguration
eksConfiguration = Maybe EksConfiguration
a} :: CreateComputeEnvironment)

-- | The full Amazon Resource Name (ARN) of the IAM role that allows Batch to
-- make calls to other Amazon Web Services services on your behalf. For
-- more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
-- in the /Batch User Guide/.
--
-- If your account already created the Batch service-linked role, that role
-- is used by default for your compute environment unless you specify a
-- different role here. If the Batch service-linked role doesn\'t exist in
-- your account, and no role is specified here, the service attempts to
-- create the Batch service-linked role in your account.
--
-- If your specified role has a path other than @\/@, then you must specify
-- either the full role ARN (recommended) or prefix the role name with the
-- path. For example, if a role with the name @bar@ has a path of
-- @\/foo\/@, specify @\/foo\/bar@ as the role name. For more information,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names Friendly names and paths>
-- in the /IAM User Guide/.
--
-- Depending on how you created your Batch service role, its ARN might
-- contain the @service-role@ path prefix. When you only specify the name
-- of the service role, Batch assumes that your ARN doesn\'t use the
-- @service-role@ path prefix. Because of this, we recommend that you
-- specify the full ARN of your service role when you create compute
-- environments.
createComputeEnvironment_serviceRole :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe Prelude.Text)
createComputeEnvironment_serviceRole :: Lens' CreateComputeEnvironment (Maybe Text)
createComputeEnvironment_serviceRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe Text
a -> CreateComputeEnvironment
s {$sel:serviceRole:CreateComputeEnvironment' :: Maybe Text
serviceRole = Maybe Text
a} :: CreateComputeEnvironment)

-- | The state of the compute environment. If the state is @ENABLED@, then
-- the compute environment accepts jobs from a queue and can scale out
-- automatically based on queues.
--
-- If the state is @ENABLED@, then the Batch scheduler can attempt to place
-- jobs from an associated job queue on the compute resources within the
-- environment. If the compute environment is managed, then it can scale
-- its instances out or in automatically, based on the job queue demand.
--
-- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
-- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
-- state continue to progress normally. Managed compute environments in the
-- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
-- value after instances become idle.
createComputeEnvironment_state :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe CEState)
createComputeEnvironment_state :: Lens' CreateComputeEnvironment (Maybe CEState)
createComputeEnvironment_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe CEState
state :: Maybe CEState
$sel:state:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe CEState
state} -> Maybe CEState
state) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe CEState
a -> CreateComputeEnvironment
s {$sel:state:CreateComputeEnvironment' :: Maybe CEState
state = Maybe CEState
a} :: CreateComputeEnvironment)

-- | The tags that you apply to the compute environment to help you
-- categorize and organize your resources. Each tag consists of a key and
-- an optional value. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in /Amazon Web Services General Reference/.
--
-- These tags can be updated or removed using the
-- <https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html TagResource>
-- and
-- <https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html UntagResource>
-- API operations. These tags don\'t propagate to the underlying compute
-- resources.
createComputeEnvironment_tags :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createComputeEnvironment_tags :: Lens' CreateComputeEnvironment (Maybe (HashMap Text Text))
createComputeEnvironment_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe (HashMap Text Text)
a -> CreateComputeEnvironment
s {$sel:tags:CreateComputeEnvironment' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateComputeEnvironment) 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 maximum number of vCPUs for an unmanaged compute environment. This
-- parameter is only used for fair share scheduling to reserve vCPU
-- capacity for new share identifiers. If this parameter isn\'t provided
-- for a fair share job queue, no vCPU capacity is reserved.
--
-- This parameter is only supported when the @type@ parameter is set to
-- @UNMANAGED@.
createComputeEnvironment_unmanagedvCpus :: Lens.Lens' CreateComputeEnvironment (Prelude.Maybe Prelude.Int)
createComputeEnvironment_unmanagedvCpus :: Lens' CreateComputeEnvironment (Maybe Int)
createComputeEnvironment_unmanagedvCpus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Maybe Int
unmanagedvCpus :: Maybe Int
$sel:unmanagedvCpus:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Int
unmanagedvCpus} -> Maybe Int
unmanagedvCpus) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Maybe Int
a -> CreateComputeEnvironment
s {$sel:unmanagedvCpus:CreateComputeEnvironment' :: Maybe Int
unmanagedvCpus = Maybe Int
a} :: CreateComputeEnvironment)

-- | The name for your compute environment. It can be up to 128 characters
-- long. It can contain uppercase and lowercase letters, numbers, hyphens
-- (-), and underscores (_).
createComputeEnvironment_computeEnvironmentName :: Lens.Lens' CreateComputeEnvironment Prelude.Text
createComputeEnvironment_computeEnvironmentName :: Lens' CreateComputeEnvironment Text
createComputeEnvironment_computeEnvironmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {Text
computeEnvironmentName :: Text
$sel:computeEnvironmentName:CreateComputeEnvironment' :: CreateComputeEnvironment -> Text
computeEnvironmentName} -> Text
computeEnvironmentName) (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} Text
a -> CreateComputeEnvironment
s {$sel:computeEnvironmentName:CreateComputeEnvironment' :: Text
computeEnvironmentName = Text
a} :: CreateComputeEnvironment)

-- | The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
createComputeEnvironment_type :: Lens.Lens' CreateComputeEnvironment CEType
createComputeEnvironment_type :: Lens' CreateComputeEnvironment CEType
createComputeEnvironment_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironment' {CEType
type' :: CEType
$sel:type':CreateComputeEnvironment' :: CreateComputeEnvironment -> CEType
type'} -> CEType
type') (\s :: CreateComputeEnvironment
s@CreateComputeEnvironment' {} CEType
a -> CreateComputeEnvironment
s {$sel:type':CreateComputeEnvironment' :: CEType
type' = CEType
a} :: CreateComputeEnvironment)

instance Core.AWSRequest CreateComputeEnvironment where
  type
    AWSResponse CreateComputeEnvironment =
      CreateComputeEnvironmentResponse
  request :: (Service -> Service)
-> CreateComputeEnvironment -> Request CreateComputeEnvironment
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateComputeEnvironment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateComputeEnvironment)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> CreateComputeEnvironmentResponse
CreateComputeEnvironmentResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"computeEnvironmentArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"computeEnvironmentName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateComputeEnvironment where
  hashWithSalt :: Int -> CreateComputeEnvironment -> Int
hashWithSalt Int
_salt CreateComputeEnvironment' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe CEState
Maybe EksConfiguration
Maybe ComputeResource
Text
CEType
type' :: CEType
computeEnvironmentName :: Text
unmanagedvCpus :: Maybe Int
tags :: Maybe (HashMap Text Text)
state :: Maybe CEState
serviceRole :: Maybe Text
eksConfiguration :: Maybe EksConfiguration
computeResources :: Maybe ComputeResource
$sel:type':CreateComputeEnvironment' :: CreateComputeEnvironment -> CEType
$sel:computeEnvironmentName:CreateComputeEnvironment' :: CreateComputeEnvironment -> Text
$sel:unmanagedvCpus:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Int
$sel:tags:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe (HashMap Text Text)
$sel:state:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe CEState
$sel:serviceRole:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Text
$sel:eksConfiguration:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe EksConfiguration
$sel:computeResources:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe ComputeResource
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComputeResource
computeResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EksConfiguration
eksConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CEState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
unmanagedvCpus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
computeEnvironmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CEType
type'

instance Prelude.NFData CreateComputeEnvironment where
  rnf :: CreateComputeEnvironment -> ()
rnf CreateComputeEnvironment' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe CEState
Maybe EksConfiguration
Maybe ComputeResource
Text
CEType
type' :: CEType
computeEnvironmentName :: Text
unmanagedvCpus :: Maybe Int
tags :: Maybe (HashMap Text Text)
state :: Maybe CEState
serviceRole :: Maybe Text
eksConfiguration :: Maybe EksConfiguration
computeResources :: Maybe ComputeResource
$sel:type':CreateComputeEnvironment' :: CreateComputeEnvironment -> CEType
$sel:computeEnvironmentName:CreateComputeEnvironment' :: CreateComputeEnvironment -> Text
$sel:unmanagedvCpus:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Int
$sel:tags:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe (HashMap Text Text)
$sel:state:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe CEState
$sel:serviceRole:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Text
$sel:eksConfiguration:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe EksConfiguration
$sel:computeResources:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe ComputeResource
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ComputeResource
computeResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EksConfiguration
eksConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CEState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
unmanagedvCpus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
computeEnvironmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CEType
type'

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

instance Data.ToJSON CreateComputeEnvironment where
  toJSON :: CreateComputeEnvironment -> Value
toJSON CreateComputeEnvironment' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe CEState
Maybe EksConfiguration
Maybe ComputeResource
Text
CEType
type' :: CEType
computeEnvironmentName :: Text
unmanagedvCpus :: Maybe Int
tags :: Maybe (HashMap Text Text)
state :: Maybe CEState
serviceRole :: Maybe Text
eksConfiguration :: Maybe EksConfiguration
computeResources :: Maybe ComputeResource
$sel:type':CreateComputeEnvironment' :: CreateComputeEnvironment -> CEType
$sel:computeEnvironmentName:CreateComputeEnvironment' :: CreateComputeEnvironment -> Text
$sel:unmanagedvCpus:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Int
$sel:tags:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe (HashMap Text Text)
$sel:state:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe CEState
$sel:serviceRole:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe Text
$sel:eksConfiguration:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe EksConfiguration
$sel:computeResources:CreateComputeEnvironment' :: CreateComputeEnvironment -> Maybe ComputeResource
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"computeResources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputeResource
computeResources,
            (Key
"eksConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EksConfiguration
eksConfiguration,
            (Key
"serviceRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceRole,
            (Key
"state" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CEState
state,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Key
"unmanagedvCpus" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
unmanagedvCpus,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"computeEnvironmentName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
computeEnvironmentName
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CEType
type')
          ]
      )

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

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

-- | /See:/ 'newCreateComputeEnvironmentResponse' smart constructor.
data CreateComputeEnvironmentResponse = CreateComputeEnvironmentResponse'
  { -- | The Amazon Resource Name (ARN) of the compute environment.
    CreateComputeEnvironmentResponse -> Maybe Text
computeEnvironmentArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the compute environment. It can be up to 128 characters
    -- long. It can contain uppercase and lowercase letters, numbers, hyphens
    -- (-), and underscores (_).
    CreateComputeEnvironmentResponse -> Maybe Text
computeEnvironmentName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateComputeEnvironmentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateComputeEnvironmentResponse
-> CreateComputeEnvironmentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComputeEnvironmentResponse
-> CreateComputeEnvironmentResponse -> Bool
$c/= :: CreateComputeEnvironmentResponse
-> CreateComputeEnvironmentResponse -> Bool
== :: CreateComputeEnvironmentResponse
-> CreateComputeEnvironmentResponse -> Bool
$c== :: CreateComputeEnvironmentResponse
-> CreateComputeEnvironmentResponse -> Bool
Prelude.Eq, ReadPrec [CreateComputeEnvironmentResponse]
ReadPrec CreateComputeEnvironmentResponse
Int -> ReadS CreateComputeEnvironmentResponse
ReadS [CreateComputeEnvironmentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComputeEnvironmentResponse]
$creadListPrec :: ReadPrec [CreateComputeEnvironmentResponse]
readPrec :: ReadPrec CreateComputeEnvironmentResponse
$creadPrec :: ReadPrec CreateComputeEnvironmentResponse
readList :: ReadS [CreateComputeEnvironmentResponse]
$creadList :: ReadS [CreateComputeEnvironmentResponse]
readsPrec :: Int -> ReadS CreateComputeEnvironmentResponse
$creadsPrec :: Int -> ReadS CreateComputeEnvironmentResponse
Prelude.Read, Int -> CreateComputeEnvironmentResponse -> ShowS
[CreateComputeEnvironmentResponse] -> ShowS
CreateComputeEnvironmentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComputeEnvironmentResponse] -> ShowS
$cshowList :: [CreateComputeEnvironmentResponse] -> ShowS
show :: CreateComputeEnvironmentResponse -> String
$cshow :: CreateComputeEnvironmentResponse -> String
showsPrec :: Int -> CreateComputeEnvironmentResponse -> ShowS
$cshowsPrec :: Int -> CreateComputeEnvironmentResponse -> ShowS
Prelude.Show, forall x.
Rep CreateComputeEnvironmentResponse x
-> CreateComputeEnvironmentResponse
forall x.
CreateComputeEnvironmentResponse
-> Rep CreateComputeEnvironmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateComputeEnvironmentResponse x
-> CreateComputeEnvironmentResponse
$cfrom :: forall x.
CreateComputeEnvironmentResponse
-> Rep CreateComputeEnvironmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateComputeEnvironmentResponse' 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:
--
-- 'computeEnvironmentArn', 'createComputeEnvironmentResponse_computeEnvironmentArn' - The Amazon Resource Name (ARN) of the compute environment.
--
-- 'computeEnvironmentName', 'createComputeEnvironmentResponse_computeEnvironmentName' - The name of the compute environment. It can be up to 128 characters
-- long. It can contain uppercase and lowercase letters, numbers, hyphens
-- (-), and underscores (_).
--
-- 'httpStatus', 'createComputeEnvironmentResponse_httpStatus' - The response's http status code.
newCreateComputeEnvironmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateComputeEnvironmentResponse
newCreateComputeEnvironmentResponse :: Int -> CreateComputeEnvironmentResponse
newCreateComputeEnvironmentResponse Int
pHttpStatus_ =
  CreateComputeEnvironmentResponse'
    { $sel:computeEnvironmentArn:CreateComputeEnvironmentResponse' :: Maybe Text
computeEnvironmentArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:computeEnvironmentName:CreateComputeEnvironmentResponse' :: Maybe Text
computeEnvironmentName = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateComputeEnvironmentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the compute environment.
createComputeEnvironmentResponse_computeEnvironmentArn :: Lens.Lens' CreateComputeEnvironmentResponse (Prelude.Maybe Prelude.Text)
createComputeEnvironmentResponse_computeEnvironmentArn :: Lens' CreateComputeEnvironmentResponse (Maybe Text)
createComputeEnvironmentResponse_computeEnvironmentArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironmentResponse' {Maybe Text
computeEnvironmentArn :: Maybe Text
$sel:computeEnvironmentArn:CreateComputeEnvironmentResponse' :: CreateComputeEnvironmentResponse -> Maybe Text
computeEnvironmentArn} -> Maybe Text
computeEnvironmentArn) (\s :: CreateComputeEnvironmentResponse
s@CreateComputeEnvironmentResponse' {} Maybe Text
a -> CreateComputeEnvironmentResponse
s {$sel:computeEnvironmentArn:CreateComputeEnvironmentResponse' :: Maybe Text
computeEnvironmentArn = Maybe Text
a} :: CreateComputeEnvironmentResponse)

-- | The name of the compute environment. It can be up to 128 characters
-- long. It can contain uppercase and lowercase letters, numbers, hyphens
-- (-), and underscores (_).
createComputeEnvironmentResponse_computeEnvironmentName :: Lens.Lens' CreateComputeEnvironmentResponse (Prelude.Maybe Prelude.Text)
createComputeEnvironmentResponse_computeEnvironmentName :: Lens' CreateComputeEnvironmentResponse (Maybe Text)
createComputeEnvironmentResponse_computeEnvironmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComputeEnvironmentResponse' {Maybe Text
computeEnvironmentName :: Maybe Text
$sel:computeEnvironmentName:CreateComputeEnvironmentResponse' :: CreateComputeEnvironmentResponse -> Maybe Text
computeEnvironmentName} -> Maybe Text
computeEnvironmentName) (\s :: CreateComputeEnvironmentResponse
s@CreateComputeEnvironmentResponse' {} Maybe Text
a -> CreateComputeEnvironmentResponse
s {$sel:computeEnvironmentName:CreateComputeEnvironmentResponse' :: Maybe Text
computeEnvironmentName = Maybe Text
a} :: CreateComputeEnvironmentResponse)

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

instance
  Prelude.NFData
    CreateComputeEnvironmentResponse
  where
  rnf :: CreateComputeEnvironmentResponse -> ()
rnf CreateComputeEnvironmentResponse' {Int
Maybe Text
httpStatus :: Int
computeEnvironmentName :: Maybe Text
computeEnvironmentArn :: Maybe Text
$sel:httpStatus:CreateComputeEnvironmentResponse' :: CreateComputeEnvironmentResponse -> Int
$sel:computeEnvironmentName:CreateComputeEnvironmentResponse' :: CreateComputeEnvironmentResponse -> Maybe Text
$sel:computeEnvironmentArn:CreateComputeEnvironmentResponse' :: CreateComputeEnvironmentResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
computeEnvironmentArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
computeEnvironmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus