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

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

-- |
-- Module      : Amazonka.EMR.Types.JobFlowInstancesConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EMR.Types.JobFlowInstancesConfig where

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.InstanceFleetConfig
import Amazonka.EMR.Types.InstanceGroupConfig
import Amazonka.EMR.Types.PlacementType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A description of the Amazon EC2 instance on which the cluster (job flow)
-- runs. A valid JobFlowInstancesConfig must contain either InstanceGroups
-- or InstanceFleets. They cannot be used together. You may also have
-- MasterInstanceType, SlaveInstanceType, and InstanceCount (all three must
-- be present), but we don\'t recommend this configuration.
--
-- /See:/ 'newJobFlowInstancesConfig' smart constructor.
data JobFlowInstancesConfig = JobFlowInstancesConfig'
  { -- | The instance fleet configuration is available only in Amazon EMR
    -- versions 4.8.0 and later, excluding 5.0.x versions.
    --
    -- Describes the EC2 instances and instance configurations for clusters
    -- that use the instance fleet configuration.
    JobFlowInstancesConfig -> Maybe [InstanceFleetConfig]
instanceFleets :: Prelude.Maybe [InstanceFleetConfig],
    -- | The name of the EC2 key pair that can be used to connect to the master
    -- node using SSH as the user called \"hadoop.\"
    JobFlowInstancesConfig -> Maybe Text
ec2KeyName :: Prelude.Maybe Prelude.Text,
    -- | The EC2 instance type of the core and task nodes.
    JobFlowInstancesConfig -> Maybe Text
slaveInstanceType :: Prelude.Maybe Prelude.Text,
    -- | The number of EC2 instances in the cluster.
    JobFlowInstancesConfig -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The identifier of the Amazon EC2 security group for the core and task
    -- nodes. If you specify @EmrManagedSlaveSecurityGroup@, you must also
    -- specify @EmrManagedMasterSecurityGroup@.
    JobFlowInstancesConfig -> Maybe Text
emrManagedSlaveSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | A list of additional Amazon EC2 security group IDs for the core and task
    -- nodes.
    JobFlowInstancesConfig -> Maybe [Text]
additionalSlaveSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | Applies to clusters that use the instance fleet configuration. When
    -- multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and
    -- launches instances in the optimal subnet.
    --
    -- The instance fleet configuration is available only in Amazon EMR
    -- versions 4.8.0 and later, excluding 5.0.x versions.
    JobFlowInstancesConfig -> Maybe [Text]
ec2SubnetIds :: Prelude.Maybe [Prelude.Text],
    -- | Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop
    -- version for the cluster. Valid inputs are \"0.18\" (no longer
    -- maintained), \"0.20\" (no longer maintained), \"0.20.205\" (no longer
    -- maintained), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this
    -- value, the default of 0.18 is used, unless the @AmiVersion@ parameter is
    -- set in the RunJobFlow call, in which case the default version of Hadoop
    -- for that AMI version is used.
    JobFlowInstancesConfig -> Maybe Text
hadoopVersion :: Prelude.Maybe Prelude.Text,
    -- | A list of additional Amazon EC2 security group IDs for the master node.
    JobFlowInstancesConfig -> Maybe [Text]
additionalMasterSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The identifier of the Amazon EC2 security group for the master node. If
    -- you specify @EmrManagedMasterSecurityGroup@, you must also specify
    -- @EmrManagedSlaveSecurityGroup@.
    JobFlowInstancesConfig -> Maybe Text
emrManagedMasterSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | Applies to clusters that use the uniform instance group configuration.
    -- To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set
    -- this parameter to the identifier of the Amazon VPC subnet where you want
    -- the cluster to launch. If you do not specify this value and your account
    -- supports EC2-Classic, the cluster launches in EC2-Classic.
    JobFlowInstancesConfig -> Maybe Text
ec2SubnetId :: Prelude.Maybe Prelude.Text,
    -- | The EC2 instance type of the master node.
    JobFlowInstancesConfig -> Maybe Text
masterInstanceType :: Prelude.Maybe Prelude.Text,
    -- | Configuration for the instance groups in a cluster.
    JobFlowInstancesConfig -> Maybe [InstanceGroupConfig]
instanceGroups :: Prelude.Maybe [InstanceGroupConfig],
    -- | Specifies whether the cluster should remain available after completing
    -- all steps. Defaults to @true@. For more information about configuring
    -- cluster termination, see
    -- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html Control Cluster Termination>
    -- in the /EMR Management Guide/.
    JobFlowInstancesConfig -> Maybe Bool
keepJobFlowAliveWhenNoSteps :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of the Amazon EC2 security group for the Amazon EMR
    -- service to access clusters in VPC private subnets.
    JobFlowInstancesConfig -> Maybe Text
serviceAccessSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to lock the cluster to prevent the Amazon EC2
    -- instances from being terminated by API call, user intervention, or in
    -- the event of a job-flow error.
    JobFlowInstancesConfig -> Maybe Bool
terminationProtected :: Prelude.Maybe Prelude.Bool,
    -- | The Availability Zone in which the cluster runs.
    JobFlowInstancesConfig -> Maybe PlacementType
placement :: Prelude.Maybe PlacementType
  }
  deriving (JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool
(JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool)
-> (JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool)
-> Eq JobFlowInstancesConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool
$c/= :: JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool
== :: JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool
$c== :: JobFlowInstancesConfig -> JobFlowInstancesConfig -> Bool
Prelude.Eq, ReadPrec [JobFlowInstancesConfig]
ReadPrec JobFlowInstancesConfig
Int -> ReadS JobFlowInstancesConfig
ReadS [JobFlowInstancesConfig]
(Int -> ReadS JobFlowInstancesConfig)
-> ReadS [JobFlowInstancesConfig]
-> ReadPrec JobFlowInstancesConfig
-> ReadPrec [JobFlowInstancesConfig]
-> Read JobFlowInstancesConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobFlowInstancesConfig]
$creadListPrec :: ReadPrec [JobFlowInstancesConfig]
readPrec :: ReadPrec JobFlowInstancesConfig
$creadPrec :: ReadPrec JobFlowInstancesConfig
readList :: ReadS [JobFlowInstancesConfig]
$creadList :: ReadS [JobFlowInstancesConfig]
readsPrec :: Int -> ReadS JobFlowInstancesConfig
$creadsPrec :: Int -> ReadS JobFlowInstancesConfig
Prelude.Read, Int -> JobFlowInstancesConfig -> ShowS
[JobFlowInstancesConfig] -> ShowS
JobFlowInstancesConfig -> String
(Int -> JobFlowInstancesConfig -> ShowS)
-> (JobFlowInstancesConfig -> String)
-> ([JobFlowInstancesConfig] -> ShowS)
-> Show JobFlowInstancesConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobFlowInstancesConfig] -> ShowS
$cshowList :: [JobFlowInstancesConfig] -> ShowS
show :: JobFlowInstancesConfig -> String
$cshow :: JobFlowInstancesConfig -> String
showsPrec :: Int -> JobFlowInstancesConfig -> ShowS
$cshowsPrec :: Int -> JobFlowInstancesConfig -> ShowS
Prelude.Show, (forall x. JobFlowInstancesConfig -> Rep JobFlowInstancesConfig x)
-> (forall x.
    Rep JobFlowInstancesConfig x -> JobFlowInstancesConfig)
-> Generic JobFlowInstancesConfig
forall x. Rep JobFlowInstancesConfig x -> JobFlowInstancesConfig
forall x. JobFlowInstancesConfig -> Rep JobFlowInstancesConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobFlowInstancesConfig x -> JobFlowInstancesConfig
$cfrom :: forall x. JobFlowInstancesConfig -> Rep JobFlowInstancesConfig x
Prelude.Generic)

-- |
-- Create a value of 'JobFlowInstancesConfig' 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:
--
-- 'instanceFleets', 'jobFlowInstancesConfig_instanceFleets' - The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
--
-- Describes the EC2 instances and instance configurations for clusters
-- that use the instance fleet configuration.
--
-- 'ec2KeyName', 'jobFlowInstancesConfig_ec2KeyName' - The name of the EC2 key pair that can be used to connect to the master
-- node using SSH as the user called \"hadoop.\"
--
-- 'slaveInstanceType', 'jobFlowInstancesConfig_slaveInstanceType' - The EC2 instance type of the core and task nodes.
--
-- 'instanceCount', 'jobFlowInstancesConfig_instanceCount' - The number of EC2 instances in the cluster.
--
-- 'emrManagedSlaveSecurityGroup', 'jobFlowInstancesConfig_emrManagedSlaveSecurityGroup' - The identifier of the Amazon EC2 security group for the core and task
-- nodes. If you specify @EmrManagedSlaveSecurityGroup@, you must also
-- specify @EmrManagedMasterSecurityGroup@.
--
-- 'additionalSlaveSecurityGroups', 'jobFlowInstancesConfig_additionalSlaveSecurityGroups' - A list of additional Amazon EC2 security group IDs for the core and task
-- nodes.
--
-- 'ec2SubnetIds', 'jobFlowInstancesConfig_ec2SubnetIds' - Applies to clusters that use the instance fleet configuration. When
-- multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and
-- launches instances in the optimal subnet.
--
-- The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
--
-- 'hadoopVersion', 'jobFlowInstancesConfig_hadoopVersion' - Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop
-- version for the cluster. Valid inputs are \"0.18\" (no longer
-- maintained), \"0.20\" (no longer maintained), \"0.20.205\" (no longer
-- maintained), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this
-- value, the default of 0.18 is used, unless the @AmiVersion@ parameter is
-- set in the RunJobFlow call, in which case the default version of Hadoop
-- for that AMI version is used.
--
-- 'additionalMasterSecurityGroups', 'jobFlowInstancesConfig_additionalMasterSecurityGroups' - A list of additional Amazon EC2 security group IDs for the master node.
--
-- 'emrManagedMasterSecurityGroup', 'jobFlowInstancesConfig_emrManagedMasterSecurityGroup' - The identifier of the Amazon EC2 security group for the master node. If
-- you specify @EmrManagedMasterSecurityGroup@, you must also specify
-- @EmrManagedSlaveSecurityGroup@.
--
-- 'ec2SubnetId', 'jobFlowInstancesConfig_ec2SubnetId' - Applies to clusters that use the uniform instance group configuration.
-- To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set
-- this parameter to the identifier of the Amazon VPC subnet where you want
-- the cluster to launch. If you do not specify this value and your account
-- supports EC2-Classic, the cluster launches in EC2-Classic.
--
-- 'masterInstanceType', 'jobFlowInstancesConfig_masterInstanceType' - The EC2 instance type of the master node.
--
-- 'instanceGroups', 'jobFlowInstancesConfig_instanceGroups' - Configuration for the instance groups in a cluster.
--
-- 'keepJobFlowAliveWhenNoSteps', 'jobFlowInstancesConfig_keepJobFlowAliveWhenNoSteps' - Specifies whether the cluster should remain available after completing
-- all steps. Defaults to @true@. For more information about configuring
-- cluster termination, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html Control Cluster Termination>
-- in the /EMR Management Guide/.
--
-- 'serviceAccessSecurityGroup', 'jobFlowInstancesConfig_serviceAccessSecurityGroup' - The identifier of the Amazon EC2 security group for the Amazon EMR
-- service to access clusters in VPC private subnets.
--
-- 'terminationProtected', 'jobFlowInstancesConfig_terminationProtected' - Specifies whether to lock the cluster to prevent the Amazon EC2
-- instances from being terminated by API call, user intervention, or in
-- the event of a job-flow error.
--
-- 'placement', 'jobFlowInstancesConfig_placement' - The Availability Zone in which the cluster runs.
newJobFlowInstancesConfig ::
  JobFlowInstancesConfig
newJobFlowInstancesConfig :: JobFlowInstancesConfig
newJobFlowInstancesConfig =
  JobFlowInstancesConfig' :: Maybe [InstanceFleetConfig]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [InstanceGroupConfig]
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe PlacementType
-> JobFlowInstancesConfig
JobFlowInstancesConfig'
    { $sel:instanceFleets:JobFlowInstancesConfig' :: Maybe [InstanceFleetConfig]
instanceFleets =
        Maybe [InstanceFleetConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2KeyName:JobFlowInstancesConfig' :: Maybe Text
ec2KeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:slaveInstanceType:JobFlowInstancesConfig' :: Maybe Text
slaveInstanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:JobFlowInstancesConfig' :: Maybe Int
instanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:emrManagedSlaveSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
emrManagedSlaveSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalSlaveSecurityGroups:JobFlowInstancesConfig' :: Maybe [Text]
additionalSlaveSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2SubnetIds:JobFlowInstancesConfig' :: Maybe [Text]
ec2SubnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:hadoopVersion:JobFlowInstancesConfig' :: Maybe Text
hadoopVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMasterSecurityGroups:JobFlowInstancesConfig' :: Maybe [Text]
additionalMasterSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:emrManagedMasterSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
emrManagedMasterSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2SubnetId:JobFlowInstancesConfig' :: Maybe Text
ec2SubnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:masterInstanceType:JobFlowInstancesConfig' :: Maybe Text
masterInstanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceGroups:JobFlowInstancesConfig' :: Maybe [InstanceGroupConfig]
instanceGroups = Maybe [InstanceGroupConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:keepJobFlowAliveWhenNoSteps:JobFlowInstancesConfig' :: Maybe Bool
keepJobFlowAliveWhenNoSteps = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceAccessSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
serviceAccessSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:terminationProtected:JobFlowInstancesConfig' :: Maybe Bool
terminationProtected = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:placement:JobFlowInstancesConfig' :: Maybe PlacementType
placement = Maybe PlacementType
forall a. Maybe a
Prelude.Nothing
    }

-- | The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
--
-- Describes the EC2 instances and instance configurations for clusters
-- that use the instance fleet configuration.
jobFlowInstancesConfig_instanceFleets :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe [InstanceFleetConfig])
jobFlowInstancesConfig_instanceFleets :: (Maybe [InstanceFleetConfig] -> f (Maybe [InstanceFleetConfig]))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_instanceFleets = (JobFlowInstancesConfig -> Maybe [InstanceFleetConfig])
-> (JobFlowInstancesConfig
    -> Maybe [InstanceFleetConfig] -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe [InstanceFleetConfig])
     (Maybe [InstanceFleetConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe [InstanceFleetConfig]
instanceFleets :: Maybe [InstanceFleetConfig]
$sel:instanceFleets:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [InstanceFleetConfig]
instanceFleets} -> Maybe [InstanceFleetConfig]
instanceFleets) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe [InstanceFleetConfig]
a -> JobFlowInstancesConfig
s {$sel:instanceFleets:JobFlowInstancesConfig' :: Maybe [InstanceFleetConfig]
instanceFleets = Maybe [InstanceFleetConfig]
a} :: JobFlowInstancesConfig) ((Maybe [InstanceFleetConfig] -> f (Maybe [InstanceFleetConfig]))
 -> JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> ((Maybe [InstanceFleetConfig]
     -> f (Maybe [InstanceFleetConfig]))
    -> Maybe [InstanceFleetConfig] -> f (Maybe [InstanceFleetConfig]))
-> (Maybe [InstanceFleetConfig] -> f (Maybe [InstanceFleetConfig]))
-> JobFlowInstancesConfig
-> f JobFlowInstancesConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstanceFleetConfig]
  [InstanceFleetConfig]
  [InstanceFleetConfig]
  [InstanceFleetConfig]
-> Iso
     (Maybe [InstanceFleetConfig])
     (Maybe [InstanceFleetConfig])
     (Maybe [InstanceFleetConfig])
     (Maybe [InstanceFleetConfig])
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
  [InstanceFleetConfig]
  [InstanceFleetConfig]
  [InstanceFleetConfig]
  [InstanceFleetConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the EC2 key pair that can be used to connect to the master
-- node using SSH as the user called \"hadoop.\"
jobFlowInstancesConfig_ec2KeyName :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_ec2KeyName :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_ec2KeyName = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
ec2KeyName :: Maybe Text
$sel:ec2KeyName:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
ec2KeyName} -> Maybe Text
ec2KeyName) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:ec2KeyName:JobFlowInstancesConfig' :: Maybe Text
ec2KeyName = Maybe Text
a} :: JobFlowInstancesConfig)

-- | The EC2 instance type of the core and task nodes.
jobFlowInstancesConfig_slaveInstanceType :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_slaveInstanceType :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_slaveInstanceType = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
slaveInstanceType :: Maybe Text
$sel:slaveInstanceType:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
slaveInstanceType} -> Maybe Text
slaveInstanceType) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:slaveInstanceType:JobFlowInstancesConfig' :: Maybe Text
slaveInstanceType = Maybe Text
a} :: JobFlowInstancesConfig)

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

-- | The identifier of the Amazon EC2 security group for the core and task
-- nodes. If you specify @EmrManagedSlaveSecurityGroup@, you must also
-- specify @EmrManagedMasterSecurityGroup@.
jobFlowInstancesConfig_emrManagedSlaveSecurityGroup :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_emrManagedSlaveSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_emrManagedSlaveSecurityGroup = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
emrManagedSlaveSecurityGroup :: Maybe Text
$sel:emrManagedSlaveSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
emrManagedSlaveSecurityGroup} -> Maybe Text
emrManagedSlaveSecurityGroup) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:emrManagedSlaveSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
emrManagedSlaveSecurityGroup = Maybe Text
a} :: JobFlowInstancesConfig)

-- | A list of additional Amazon EC2 security group IDs for the core and task
-- nodes.
jobFlowInstancesConfig_additionalSlaveSecurityGroups :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe [Prelude.Text])
jobFlowInstancesConfig_additionalSlaveSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_additionalSlaveSecurityGroups = (JobFlowInstancesConfig -> Maybe [Text])
-> (JobFlowInstancesConfig
    -> Maybe [Text] -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe [Text]
additionalSlaveSecurityGroups :: Maybe [Text]
$sel:additionalSlaveSecurityGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
additionalSlaveSecurityGroups} -> Maybe [Text]
additionalSlaveSecurityGroups) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe [Text]
a -> JobFlowInstancesConfig
s {$sel:additionalSlaveSecurityGroups:JobFlowInstancesConfig' :: Maybe [Text]
additionalSlaveSecurityGroups = Maybe [Text]
a} :: JobFlowInstancesConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig
-> f JobFlowInstancesConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Applies to clusters that use the instance fleet configuration. When
-- multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and
-- launches instances in the optimal subnet.
--
-- The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
jobFlowInstancesConfig_ec2SubnetIds :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe [Prelude.Text])
jobFlowInstancesConfig_ec2SubnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_ec2SubnetIds = (JobFlowInstancesConfig -> Maybe [Text])
-> (JobFlowInstancesConfig
    -> Maybe [Text] -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe [Text]
ec2SubnetIds :: Maybe [Text]
$sel:ec2SubnetIds:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
ec2SubnetIds} -> Maybe [Text]
ec2SubnetIds) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe [Text]
a -> JobFlowInstancesConfig
s {$sel:ec2SubnetIds:JobFlowInstancesConfig' :: Maybe [Text]
ec2SubnetIds = Maybe [Text]
a} :: JobFlowInstancesConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig
-> f JobFlowInstancesConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop
-- version for the cluster. Valid inputs are \"0.18\" (no longer
-- maintained), \"0.20\" (no longer maintained), \"0.20.205\" (no longer
-- maintained), \"1.0.3\", \"2.2.0\", or \"2.4.0\". If you do not set this
-- value, the default of 0.18 is used, unless the @AmiVersion@ parameter is
-- set in the RunJobFlow call, in which case the default version of Hadoop
-- for that AMI version is used.
jobFlowInstancesConfig_hadoopVersion :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_hadoopVersion :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_hadoopVersion = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
hadoopVersion :: Maybe Text
$sel:hadoopVersion:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
hadoopVersion} -> Maybe Text
hadoopVersion) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:hadoopVersion:JobFlowInstancesConfig' :: Maybe Text
hadoopVersion = Maybe Text
a} :: JobFlowInstancesConfig)

-- | A list of additional Amazon EC2 security group IDs for the master node.
jobFlowInstancesConfig_additionalMasterSecurityGroups :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe [Prelude.Text])
jobFlowInstancesConfig_additionalMasterSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_additionalMasterSecurityGroups = (JobFlowInstancesConfig -> Maybe [Text])
-> (JobFlowInstancesConfig
    -> Maybe [Text] -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe [Text]
additionalMasterSecurityGroups :: Maybe [Text]
$sel:additionalMasterSecurityGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
additionalMasterSecurityGroups} -> Maybe [Text]
additionalMasterSecurityGroups) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe [Text]
a -> JobFlowInstancesConfig
s {$sel:additionalMasterSecurityGroups:JobFlowInstancesConfig' :: Maybe [Text]
additionalMasterSecurityGroups = Maybe [Text]
a} :: JobFlowInstancesConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> JobFlowInstancesConfig
-> f JobFlowInstancesConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the Amazon EC2 security group for the master node. If
-- you specify @EmrManagedMasterSecurityGroup@, you must also specify
-- @EmrManagedSlaveSecurityGroup@.
jobFlowInstancesConfig_emrManagedMasterSecurityGroup :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_emrManagedMasterSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_emrManagedMasterSecurityGroup = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
emrManagedMasterSecurityGroup :: Maybe Text
$sel:emrManagedMasterSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
emrManagedMasterSecurityGroup} -> Maybe Text
emrManagedMasterSecurityGroup) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:emrManagedMasterSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
emrManagedMasterSecurityGroup = Maybe Text
a} :: JobFlowInstancesConfig)

-- | Applies to clusters that use the uniform instance group configuration.
-- To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set
-- this parameter to the identifier of the Amazon VPC subnet where you want
-- the cluster to launch. If you do not specify this value and your account
-- supports EC2-Classic, the cluster launches in EC2-Classic.
jobFlowInstancesConfig_ec2SubnetId :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_ec2SubnetId :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_ec2SubnetId = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
ec2SubnetId :: Maybe Text
$sel:ec2SubnetId:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
ec2SubnetId} -> Maybe Text
ec2SubnetId) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:ec2SubnetId:JobFlowInstancesConfig' :: Maybe Text
ec2SubnetId = Maybe Text
a} :: JobFlowInstancesConfig)

-- | The EC2 instance type of the master node.
jobFlowInstancesConfig_masterInstanceType :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_masterInstanceType :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_masterInstanceType = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
masterInstanceType :: Maybe Text
$sel:masterInstanceType:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
masterInstanceType} -> Maybe Text
masterInstanceType) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:masterInstanceType:JobFlowInstancesConfig' :: Maybe Text
masterInstanceType = Maybe Text
a} :: JobFlowInstancesConfig)

-- | Configuration for the instance groups in a cluster.
jobFlowInstancesConfig_instanceGroups :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe [InstanceGroupConfig])
jobFlowInstancesConfig_instanceGroups :: (Maybe [InstanceGroupConfig] -> f (Maybe [InstanceGroupConfig]))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_instanceGroups = (JobFlowInstancesConfig -> Maybe [InstanceGroupConfig])
-> (JobFlowInstancesConfig
    -> Maybe [InstanceGroupConfig] -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe [InstanceGroupConfig])
     (Maybe [InstanceGroupConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe [InstanceGroupConfig]
instanceGroups :: Maybe [InstanceGroupConfig]
$sel:instanceGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [InstanceGroupConfig]
instanceGroups} -> Maybe [InstanceGroupConfig]
instanceGroups) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe [InstanceGroupConfig]
a -> JobFlowInstancesConfig
s {$sel:instanceGroups:JobFlowInstancesConfig' :: Maybe [InstanceGroupConfig]
instanceGroups = Maybe [InstanceGroupConfig]
a} :: JobFlowInstancesConfig) ((Maybe [InstanceGroupConfig] -> f (Maybe [InstanceGroupConfig]))
 -> JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> ((Maybe [InstanceGroupConfig]
     -> f (Maybe [InstanceGroupConfig]))
    -> Maybe [InstanceGroupConfig] -> f (Maybe [InstanceGroupConfig]))
-> (Maybe [InstanceGroupConfig] -> f (Maybe [InstanceGroupConfig]))
-> JobFlowInstancesConfig
-> f JobFlowInstancesConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstanceGroupConfig]
  [InstanceGroupConfig]
  [InstanceGroupConfig]
  [InstanceGroupConfig]
-> Iso
     (Maybe [InstanceGroupConfig])
     (Maybe [InstanceGroupConfig])
     (Maybe [InstanceGroupConfig])
     (Maybe [InstanceGroupConfig])
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
  [InstanceGroupConfig]
  [InstanceGroupConfig]
  [InstanceGroupConfig]
  [InstanceGroupConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether the cluster should remain available after completing
-- all steps. Defaults to @true@. For more information about configuring
-- cluster termination, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html Control Cluster Termination>
-- in the /EMR Management Guide/.
jobFlowInstancesConfig_keepJobFlowAliveWhenNoSteps :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Bool)
jobFlowInstancesConfig_keepJobFlowAliveWhenNoSteps :: (Maybe Bool -> f (Maybe Bool))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_keepJobFlowAliveWhenNoSteps = (JobFlowInstancesConfig -> Maybe Bool)
-> (JobFlowInstancesConfig -> Maybe Bool -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Bool
keepJobFlowAliveWhenNoSteps :: Maybe Bool
$sel:keepJobFlowAliveWhenNoSteps:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Bool
keepJobFlowAliveWhenNoSteps} -> Maybe Bool
keepJobFlowAliveWhenNoSteps) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Bool
a -> JobFlowInstancesConfig
s {$sel:keepJobFlowAliveWhenNoSteps:JobFlowInstancesConfig' :: Maybe Bool
keepJobFlowAliveWhenNoSteps = Maybe Bool
a} :: JobFlowInstancesConfig)

-- | The identifier of the Amazon EC2 security group for the Amazon EMR
-- service to access clusters in VPC private subnets.
jobFlowInstancesConfig_serviceAccessSecurityGroup :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Text)
jobFlowInstancesConfig_serviceAccessSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_serviceAccessSecurityGroup = (JobFlowInstancesConfig -> Maybe Text)
-> (JobFlowInstancesConfig -> Maybe Text -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Text
serviceAccessSecurityGroup :: Maybe Text
$sel:serviceAccessSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
serviceAccessSecurityGroup} -> Maybe Text
serviceAccessSecurityGroup) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Text
a -> JobFlowInstancesConfig
s {$sel:serviceAccessSecurityGroup:JobFlowInstancesConfig' :: Maybe Text
serviceAccessSecurityGroup = Maybe Text
a} :: JobFlowInstancesConfig)

-- | Specifies whether to lock the cluster to prevent the Amazon EC2
-- instances from being terminated by API call, user intervention, or in
-- the event of a job-flow error.
jobFlowInstancesConfig_terminationProtected :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe Prelude.Bool)
jobFlowInstancesConfig_terminationProtected :: (Maybe Bool -> f (Maybe Bool))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_terminationProtected = (JobFlowInstancesConfig -> Maybe Bool)
-> (JobFlowInstancesConfig -> Maybe Bool -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe Bool
terminationProtected :: Maybe Bool
$sel:terminationProtected:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Bool
terminationProtected} -> Maybe Bool
terminationProtected) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe Bool
a -> JobFlowInstancesConfig
s {$sel:terminationProtected:JobFlowInstancesConfig' :: Maybe Bool
terminationProtected = Maybe Bool
a} :: JobFlowInstancesConfig)

-- | The Availability Zone in which the cluster runs.
jobFlowInstancesConfig_placement :: Lens.Lens' JobFlowInstancesConfig (Prelude.Maybe PlacementType)
jobFlowInstancesConfig_placement :: (Maybe PlacementType -> f (Maybe PlacementType))
-> JobFlowInstancesConfig -> f JobFlowInstancesConfig
jobFlowInstancesConfig_placement = (JobFlowInstancesConfig -> Maybe PlacementType)
-> (JobFlowInstancesConfig
    -> Maybe PlacementType -> JobFlowInstancesConfig)
-> Lens
     JobFlowInstancesConfig
     JobFlowInstancesConfig
     (Maybe PlacementType)
     (Maybe PlacementType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobFlowInstancesConfig' {Maybe PlacementType
placement :: Maybe PlacementType
$sel:placement:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe PlacementType
placement} -> Maybe PlacementType
placement) (\s :: JobFlowInstancesConfig
s@JobFlowInstancesConfig' {} Maybe PlacementType
a -> JobFlowInstancesConfig
s {$sel:placement:JobFlowInstancesConfig' :: Maybe PlacementType
placement = Maybe PlacementType
a} :: JobFlowInstancesConfig)

instance Prelude.Hashable JobFlowInstancesConfig

instance Prelude.NFData JobFlowInstancesConfig

instance Core.ToJSON JobFlowInstancesConfig where
  toJSON :: JobFlowInstancesConfig -> Value
toJSON JobFlowInstancesConfig' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [InstanceFleetConfig]
Maybe [InstanceGroupConfig]
Maybe Text
Maybe PlacementType
placement :: Maybe PlacementType
terminationProtected :: Maybe Bool
serviceAccessSecurityGroup :: Maybe Text
keepJobFlowAliveWhenNoSteps :: Maybe Bool
instanceGroups :: Maybe [InstanceGroupConfig]
masterInstanceType :: Maybe Text
ec2SubnetId :: Maybe Text
emrManagedMasterSecurityGroup :: Maybe Text
additionalMasterSecurityGroups :: Maybe [Text]
hadoopVersion :: Maybe Text
ec2SubnetIds :: Maybe [Text]
additionalSlaveSecurityGroups :: Maybe [Text]
emrManagedSlaveSecurityGroup :: Maybe Text
instanceCount :: Maybe Int
slaveInstanceType :: Maybe Text
ec2KeyName :: Maybe Text
instanceFleets :: Maybe [InstanceFleetConfig]
$sel:placement:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe PlacementType
$sel:terminationProtected:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Bool
$sel:serviceAccessSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:keepJobFlowAliveWhenNoSteps:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Bool
$sel:instanceGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [InstanceGroupConfig]
$sel:masterInstanceType:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:ec2SubnetId:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:emrManagedMasterSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:additionalMasterSecurityGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
$sel:hadoopVersion:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:ec2SubnetIds:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
$sel:additionalSlaveSecurityGroups:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [Text]
$sel:emrManagedSlaveSecurityGroup:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:instanceCount:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Int
$sel:slaveInstanceType:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:ec2KeyName:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe Text
$sel:instanceFleets:JobFlowInstancesConfig' :: JobFlowInstancesConfig -> Maybe [InstanceFleetConfig]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InstanceFleets" Text -> [InstanceFleetConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([InstanceFleetConfig] -> Pair)
-> Maybe [InstanceFleetConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceFleetConfig]
instanceFleets,
            (Text
"Ec2KeyName" 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
ec2KeyName,
            (Text
"SlaveInstanceType" 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
slaveInstanceType,
            (Text
"InstanceCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instanceCount,
            (Text
"EmrManagedSlaveSecurityGroup" 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
emrManagedSlaveSecurityGroup,
            (Text
"AdditionalSlaveSecurityGroups" 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]
additionalSlaveSecurityGroups,
            (Text
"Ec2SubnetIds" 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]
ec2SubnetIds,
            (Text
"HadoopVersion" 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
hadoopVersion,
            (Text
"AdditionalMasterSecurityGroups" 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]
additionalMasterSecurityGroups,
            (Text
"EmrManagedMasterSecurityGroup" 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
emrManagedMasterSecurityGroup,
            (Text
"Ec2SubnetId" 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
ec2SubnetId,
            (Text
"MasterInstanceType" 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
masterInstanceType,
            (Text
"InstanceGroups" Text -> [InstanceGroupConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([InstanceGroupConfig] -> Pair)
-> Maybe [InstanceGroupConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceGroupConfig]
instanceGroups,
            (Text
"KeepJobFlowAliveWhenNoSteps" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
keepJobFlowAliveWhenNoSteps,
            (Text
"ServiceAccessSecurityGroup" 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
serviceAccessSecurityGroup,
            (Text
"TerminationProtected" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
terminationProtected,
            (Text
"Placement" Text -> PlacementType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PlacementType -> Pair) -> Maybe PlacementType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PlacementType
placement
          ]
      )