{-# 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.EMR.RunJobFlow
-- 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)
--
-- RunJobFlow creates and starts running a new cluster (job flow). The
-- cluster runs the steps specified. After the steps complete, the cluster
-- stops and the HDFS partition is lost. To prevent loss of data, configure
-- the last step of the job flow to store results in Amazon S3. If the
-- JobFlowInstancesConfig @KeepJobFlowAliveWhenNoSteps@ parameter is set to
-- @TRUE@, the cluster transitions to the WAITING state rather than
-- shutting down after the steps have completed.
--
-- For additional protection, you can set the JobFlowInstancesConfig
-- @TerminationProtected@ parameter to @TRUE@ to lock the cluster and
-- prevent it from being terminated by API call, user intervention, or in
-- the event of a job flow error.
--
-- A maximum of 256 steps are allowed in each job flow.
--
-- If your cluster is long-running (such as a Hive data warehouse) or
-- complex, you may require more than 256 steps to process your data. You
-- can bypass the 256-step limitation in various ways, including using the
-- SSH shell to connect to the master node and submitting queries directly
-- to the software running on the master node, such as Hive and Hadoop. For
-- more information on how to do this, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/AddMoreThan256Steps.html Add More than 256 Steps to a Cluster>
-- in the /Amazon EMR Management Guide/.
--
-- For long running clusters, we recommend that you periodically store your
-- results.
--
-- The instance fleets configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow
-- request can contain InstanceFleets parameters or InstanceGroups
-- parameters, but not both.
module Amazonka.EMR.RunJobFlow
  ( -- * Creating a Request
    RunJobFlow (..),
    newRunJobFlow,

    -- * Request Lenses
    runJobFlow_logEncryptionKmsKeyId,
    runJobFlow_amiVersion,
    runJobFlow_ebsRootVolumeSize,
    runJobFlow_additionalInfo,
    runJobFlow_autoTerminationPolicy,
    runJobFlow_configurations,
    runJobFlow_customAmiId,
    runJobFlow_autoScalingRole,
    runJobFlow_securityConfiguration,
    runJobFlow_scaleDownBehavior,
    runJobFlow_steps,
    runJobFlow_jobFlowRole,
    runJobFlow_bootstrapActions,
    runJobFlow_releaseLabel,
    runJobFlow_repoUpgradeOnBoot,
    runJobFlow_placementGroupConfigs,
    runJobFlow_logUri,
    runJobFlow_kerberosAttributes,
    runJobFlow_newSupportedProducts,
    runJobFlow_managedScalingPolicy,
    runJobFlow_visibleToAllUsers,
    runJobFlow_supportedProducts,
    runJobFlow_stepConcurrencyLevel,
    runJobFlow_applications,
    runJobFlow_tags,
    runJobFlow_serviceRole,
    runJobFlow_name,
    runJobFlow_instances,

    -- * Destructuring the Response
    RunJobFlowResponse (..),
    newRunJobFlowResponse,

    -- * Response Lenses
    runJobFlowResponse_clusterArn,
    runJobFlowResponse_jobFlowId,
    runJobFlowResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Input to the RunJobFlow operation.
--
-- /See:/ 'newRunJobFlow' smart constructor.
data RunJobFlow = RunJobFlow'
  { -- | The KMS key used for encrypting log files. If a value is not provided,
    -- the logs remain encrypted by AES-256. This attribute is only available
    -- with Amazon EMR version 5.30.0 and later, excluding Amazon EMR 6.0.0.
    RunJobFlow -> Maybe Text
logEncryptionKmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR
    -- releases 4.0 and later, @ReleaseLabel@ is used. To specify a custom AMI,
    -- use @CustomAmiID@.
    RunJobFlow -> Maybe Text
amiVersion :: Prelude.Maybe Prelude.Text,
    -- | The size, in GiB, of the Amazon EBS root device volume of the Linux AMI
    -- that is used for each EC2 instance. Available in Amazon EMR version 4.x
    -- and later.
    RunJobFlow -> Maybe Int
ebsRootVolumeSize :: Prelude.Maybe Prelude.Int,
    -- | A JSON string for selecting additional features.
    RunJobFlow -> Maybe Text
additionalInfo :: Prelude.Maybe Prelude.Text,
    RunJobFlow -> Maybe AutoTerminationPolicy
autoTerminationPolicy :: Prelude.Maybe AutoTerminationPolicy,
    -- | For Amazon EMR releases 4.0 and later. The list of configurations
    -- supplied for the EMR cluster you are creating.
    RunJobFlow -> Maybe [Configuration]
configurations :: Prelude.Maybe [Configuration],
    -- | Available only in Amazon EMR version 5.7.0 and later. The ID of a custom
    -- Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when
    -- it launches cluster EC2 instances. For more information about custom
    -- AMIs in Amazon EMR, see
    -- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html Using a Custom AMI>
    -- in the /Amazon EMR Management Guide/. If omitted, the cluster uses the
    -- base Linux AMI for the @ReleaseLabel@ specified. For Amazon EMR versions
    -- 2.x and 3.x, use @AmiVersion@ instead.
    --
    -- For information about creating a custom AMI, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html Creating an Amazon EBS-Backed Linux AMI>
    -- in the /Amazon Elastic Compute Cloud User Guide for Linux Instances/.
    -- For information about finding an AMI ID, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html Finding a Linux AMI>.
    RunJobFlow -> Maybe Text
customAmiId :: Prelude.Maybe Prelude.Text,
    -- | An IAM role for automatic scaling policies. The default role is
    -- @EMR_AutoScaling_DefaultRole@. The IAM role provides permissions that
    -- the automatic scaling feature requires to launch and terminate EC2
    -- instances in an instance group.
    RunJobFlow -> Maybe Text
autoScalingRole :: Prelude.Maybe Prelude.Text,
    -- | The name of a security configuration to apply to the cluster.
    RunJobFlow -> Maybe Text
securityConfiguration :: Prelude.Maybe Prelude.Text,
    -- | Specifies the way that individual Amazon EC2 instances terminate when an
    -- automatic scale-in activity occurs or an instance group is resized.
    -- @TERMINATE_AT_INSTANCE_HOUR@ indicates that Amazon EMR terminates nodes
    -- at the instance-hour boundary, regardless of when the request to
    -- terminate the instance was submitted. This option is only available with
    -- Amazon EMR 5.1.0 and later and is the default for clusters created using
    -- that version. @TERMINATE_AT_TASK_COMPLETION@ indicates that Amazon EMR
    -- adds nodes to a deny list and drains tasks from nodes before terminating
    -- the Amazon EC2 instances, regardless of the instance-hour boundary. With
    -- either behavior, Amazon EMR removes the least active nodes first and
    -- blocks instance termination if it could lead to HDFS corruption.
    -- @TERMINATE_AT_TASK_COMPLETION@ available only in Amazon EMR version
    -- 4.1.0 and later, and is the default for versions of Amazon EMR earlier
    -- than 5.1.0.
    RunJobFlow -> Maybe ScaleDownBehavior
scaleDownBehavior :: Prelude.Maybe ScaleDownBehavior,
    -- | A list of steps to run.
    RunJobFlow -> Maybe [StepConfig]
steps :: Prelude.Maybe [StepConfig],
    -- | Also called instance profile and EC2 role. An IAM role for an EMR
    -- cluster. The EC2 instances of the cluster assume this role. The default
    -- role is @EMR_EC2_DefaultRole@. In order to use the default role, you
    -- must have already created it using the CLI or console.
    RunJobFlow -> Maybe Text
jobFlowRole :: Prelude.Maybe Prelude.Text,
    -- | A list of bootstrap actions to run before Hadoop starts on the cluster
    -- nodes.
    RunJobFlow -> Maybe [BootstrapActionConfig]
bootstrapActions :: Prelude.Maybe [BootstrapActionConfig],
    -- | The Amazon EMR release label, which determines the version of
    -- open-source application packages installed on the cluster. Release
    -- labels are in the form @emr-x.x.x@, where x.x.x is an Amazon EMR release
    -- version such as @emr-5.14.0@. For more information about Amazon EMR
    -- release versions and included application versions and features, see
    -- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/>. The release
    -- label applies only to Amazon EMR releases version 4.0 and later. Earlier
    -- versions use @AmiVersion@.
    RunJobFlow -> Maybe Text
releaseLabel :: Prelude.Maybe Prelude.Text,
    -- | Applies only when @CustomAmiID@ is used. Specifies which updates from
    -- the Amazon Linux AMI package repositories to apply automatically when
    -- the instance boots using the AMI. If omitted, the default is @SECURITY@,
    -- which indicates that only security updates are applied. If @NONE@ is
    -- specified, no updates are applied, and all updates must be applied
    -- manually.
    RunJobFlow -> Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot :: Prelude.Maybe RepoUpgradeOnBoot,
    -- | The specified placement group configuration for an Amazon EMR cluster.
    RunJobFlow -> Maybe [PlacementGroupConfig]
placementGroupConfigs :: Prelude.Maybe [PlacementGroupConfig],
    -- | The location in Amazon S3 to write the log files of the job flow. If a
    -- value is not provided, logs are not created.
    RunJobFlow -> Maybe Text
logUri :: Prelude.Maybe Prelude.Text,
    -- | Attributes for Kerberos configuration when Kerberos authentication is
    -- enabled using a security configuration. For more information see
    -- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html Use Kerberos Authentication>
    -- in the /Amazon EMR Management Guide/.
    RunJobFlow -> Maybe KerberosAttributes
kerberosAttributes :: Prelude.Maybe KerberosAttributes,
    -- | For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
    -- later, use Applications.
    --
    -- A list of strings that indicates third-party software to use with the
    -- job flow that accepts a user argument list. EMR accepts and forwards the
    -- argument list to the corresponding installation script as bootstrap
    -- action arguments. For more information, see \"Launch a Job Flow on the
    -- MapR Distribution for Hadoop\" in the
    -- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
    -- Supported values are:
    --
    -- -   \"mapr-m3\" - launch the cluster using MapR M3 Edition.
    --
    -- -   \"mapr-m5\" - launch the cluster using MapR M5 Edition.
    --
    -- -   \"mapr\" with the user arguments specifying \"--edition,m3\" or
    --     \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition
    --     respectively.
    --
    -- -   \"mapr-m7\" - launch the cluster using MapR M7 Edition.
    --
    -- -   \"hunk\" - launch the cluster with the Hunk Big Data Analytics
    --     Platform.
    --
    -- -   \"hue\"- launch the cluster with Hue installed.
    --
    -- -   \"spark\" - launch the cluster with Apache Spark installed.
    --
    -- -   \"ganglia\" - launch the cluster with the Ganglia Monitoring System
    --     installed.
    RunJobFlow -> Maybe [SupportedProductConfig]
newSupportedProducts' :: Prelude.Maybe [SupportedProductConfig],
    -- | The specified managed scaling policy for an Amazon EMR cluster.
    RunJobFlow -> Maybe ManagedScalingPolicy
managedScalingPolicy :: Prelude.Maybe ManagedScalingPolicy,
    -- | Set this value to @true@ so that IAM principals in the Amazon Web
    -- Services account associated with the cluster can perform EMR actions on
    -- the cluster that their IAM policies allow. This value defaults to @true@
    -- for clusters created using the EMR API or the CLI
    -- <https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html create-cluster>
    -- command.
    --
    -- When set to @false@, only the IAM principal that created the cluster and
    -- the Amazon Web Services account root user can perform EMR actions for
    -- the cluster, regardless of the IAM permissions policies attached to
    -- other IAM principals. For more information, see
    -- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_iam_emr-with-iam.html#security_set_visible_to_all_users Understanding the EMR Cluster VisibleToAllUsers Setting>
    -- in the /Amazon EMRManagement Guide/.
    RunJobFlow -> Maybe Bool
visibleToAllUsers :: Prelude.Maybe Prelude.Bool,
    -- | For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
    -- later, use Applications.
    --
    -- A list of strings that indicates third-party software to use. For more
    -- information, see the
    -- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
    -- Currently supported values are:
    --
    -- -   \"mapr-m3\" - launch the job flow using MapR M3 Edition.
    --
    -- -   \"mapr-m5\" - launch the job flow using MapR M5 Edition.
    RunJobFlow -> Maybe [Text]
supportedProducts :: Prelude.Maybe [Prelude.Text],
    -- | Specifies the number of steps that can be executed concurrently. The
    -- default value is @1@. The maximum value is @256@.
    RunJobFlow -> Maybe Int
stepConcurrencyLevel :: Prelude.Maybe Prelude.Int,
    -- | Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of
    -- applications for Amazon EMR to install and configure when launching the
    -- cluster. For a list of applications available for each Amazon EMR
    -- release version, see the
    -- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ Amazon EMR Release Guide>.
    RunJobFlow -> Maybe [Application]
applications :: Prelude.Maybe [Application],
    -- | A list of tags to associate with a cluster and propagate to Amazon EC2
    -- instances.
    RunJobFlow -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The IAM role that Amazon EMR assumes in order to access Amazon Web
    -- Services resources on your behalf.
    RunJobFlow -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text,
    -- | The name of the job flow.
    RunJobFlow -> Text
name :: Prelude.Text,
    -- | A specification of the number and type of Amazon EC2 instances.
    RunJobFlow -> JobFlowInstancesConfig
instances :: JobFlowInstancesConfig
  }
  deriving (RunJobFlow -> RunJobFlow -> Bool
(RunJobFlow -> RunJobFlow -> Bool)
-> (RunJobFlow -> RunJobFlow -> Bool) -> Eq RunJobFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunJobFlow -> RunJobFlow -> Bool
$c/= :: RunJobFlow -> RunJobFlow -> Bool
== :: RunJobFlow -> RunJobFlow -> Bool
$c== :: RunJobFlow -> RunJobFlow -> Bool
Prelude.Eq, ReadPrec [RunJobFlow]
ReadPrec RunJobFlow
Int -> ReadS RunJobFlow
ReadS [RunJobFlow]
(Int -> ReadS RunJobFlow)
-> ReadS [RunJobFlow]
-> ReadPrec RunJobFlow
-> ReadPrec [RunJobFlow]
-> Read RunJobFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunJobFlow]
$creadListPrec :: ReadPrec [RunJobFlow]
readPrec :: ReadPrec RunJobFlow
$creadPrec :: ReadPrec RunJobFlow
readList :: ReadS [RunJobFlow]
$creadList :: ReadS [RunJobFlow]
readsPrec :: Int -> ReadS RunJobFlow
$creadsPrec :: Int -> ReadS RunJobFlow
Prelude.Read, Int -> RunJobFlow -> ShowS
[RunJobFlow] -> ShowS
RunJobFlow -> String
(Int -> RunJobFlow -> ShowS)
-> (RunJobFlow -> String)
-> ([RunJobFlow] -> ShowS)
-> Show RunJobFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunJobFlow] -> ShowS
$cshowList :: [RunJobFlow] -> ShowS
show :: RunJobFlow -> String
$cshow :: RunJobFlow -> String
showsPrec :: Int -> RunJobFlow -> ShowS
$cshowsPrec :: Int -> RunJobFlow -> ShowS
Prelude.Show, (forall x. RunJobFlow -> Rep RunJobFlow x)
-> (forall x. Rep RunJobFlow x -> RunJobFlow) -> Generic RunJobFlow
forall x. Rep RunJobFlow x -> RunJobFlow
forall x. RunJobFlow -> Rep RunJobFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunJobFlow x -> RunJobFlow
$cfrom :: forall x. RunJobFlow -> Rep RunJobFlow x
Prelude.Generic)

-- |
-- Create a value of 'RunJobFlow' 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:
--
-- 'logEncryptionKmsKeyId', 'runJobFlow_logEncryptionKmsKeyId' - The KMS key used for encrypting log files. If a value is not provided,
-- the logs remain encrypted by AES-256. This attribute is only available
-- with Amazon EMR version 5.30.0 and later, excluding Amazon EMR 6.0.0.
--
-- 'amiVersion', 'runJobFlow_amiVersion' - Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR
-- releases 4.0 and later, @ReleaseLabel@ is used. To specify a custom AMI,
-- use @CustomAmiID@.
--
-- 'ebsRootVolumeSize', 'runJobFlow_ebsRootVolumeSize' - The size, in GiB, of the Amazon EBS root device volume of the Linux AMI
-- that is used for each EC2 instance. Available in Amazon EMR version 4.x
-- and later.
--
-- 'additionalInfo', 'runJobFlow_additionalInfo' - A JSON string for selecting additional features.
--
-- 'autoTerminationPolicy', 'runJobFlow_autoTerminationPolicy' - Undocumented member.
--
-- 'configurations', 'runJobFlow_configurations' - For Amazon EMR releases 4.0 and later. The list of configurations
-- supplied for the EMR cluster you are creating.
--
-- 'customAmiId', 'runJobFlow_customAmiId' - Available only in Amazon EMR version 5.7.0 and later. The ID of a custom
-- Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when
-- it launches cluster EC2 instances. For more information about custom
-- AMIs in Amazon EMR, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html Using a Custom AMI>
-- in the /Amazon EMR Management Guide/. If omitted, the cluster uses the
-- base Linux AMI for the @ReleaseLabel@ specified. For Amazon EMR versions
-- 2.x and 3.x, use @AmiVersion@ instead.
--
-- For information about creating a custom AMI, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html Creating an Amazon EBS-Backed Linux AMI>
-- in the /Amazon Elastic Compute Cloud User Guide for Linux Instances/.
-- For information about finding an AMI ID, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html Finding a Linux AMI>.
--
-- 'autoScalingRole', 'runJobFlow_autoScalingRole' - An IAM role for automatic scaling policies. The default role is
-- @EMR_AutoScaling_DefaultRole@. The IAM role provides permissions that
-- the automatic scaling feature requires to launch and terminate EC2
-- instances in an instance group.
--
-- 'securityConfiguration', 'runJobFlow_securityConfiguration' - The name of a security configuration to apply to the cluster.
--
-- 'scaleDownBehavior', 'runJobFlow_scaleDownBehavior' - Specifies the way that individual Amazon EC2 instances terminate when an
-- automatic scale-in activity occurs or an instance group is resized.
-- @TERMINATE_AT_INSTANCE_HOUR@ indicates that Amazon EMR terminates nodes
-- at the instance-hour boundary, regardless of when the request to
-- terminate the instance was submitted. This option is only available with
-- Amazon EMR 5.1.0 and later and is the default for clusters created using
-- that version. @TERMINATE_AT_TASK_COMPLETION@ indicates that Amazon EMR
-- adds nodes to a deny list and drains tasks from nodes before terminating
-- the Amazon EC2 instances, regardless of the instance-hour boundary. With
-- either behavior, Amazon EMR removes the least active nodes first and
-- blocks instance termination if it could lead to HDFS corruption.
-- @TERMINATE_AT_TASK_COMPLETION@ available only in Amazon EMR version
-- 4.1.0 and later, and is the default for versions of Amazon EMR earlier
-- than 5.1.0.
--
-- 'steps', 'runJobFlow_steps' - A list of steps to run.
--
-- 'jobFlowRole', 'runJobFlow_jobFlowRole' - Also called instance profile and EC2 role. An IAM role for an EMR
-- cluster. The EC2 instances of the cluster assume this role. The default
-- role is @EMR_EC2_DefaultRole@. In order to use the default role, you
-- must have already created it using the CLI or console.
--
-- 'bootstrapActions', 'runJobFlow_bootstrapActions' - A list of bootstrap actions to run before Hadoop starts on the cluster
-- nodes.
--
-- 'releaseLabel', 'runJobFlow_releaseLabel' - The Amazon EMR release label, which determines the version of
-- open-source application packages installed on the cluster. Release
-- labels are in the form @emr-x.x.x@, where x.x.x is an Amazon EMR release
-- version such as @emr-5.14.0@. For more information about Amazon EMR
-- release versions and included application versions and features, see
-- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/>. The release
-- label applies only to Amazon EMR releases version 4.0 and later. Earlier
-- versions use @AmiVersion@.
--
-- 'repoUpgradeOnBoot', 'runJobFlow_repoUpgradeOnBoot' - Applies only when @CustomAmiID@ is used. Specifies which updates from
-- the Amazon Linux AMI package repositories to apply automatically when
-- the instance boots using the AMI. If omitted, the default is @SECURITY@,
-- which indicates that only security updates are applied. If @NONE@ is
-- specified, no updates are applied, and all updates must be applied
-- manually.
--
-- 'placementGroupConfigs', 'runJobFlow_placementGroupConfigs' - The specified placement group configuration for an Amazon EMR cluster.
--
-- 'logUri', 'runJobFlow_logUri' - The location in Amazon S3 to write the log files of the job flow. If a
-- value is not provided, logs are not created.
--
-- 'kerberosAttributes', 'runJobFlow_kerberosAttributes' - Attributes for Kerberos configuration when Kerberos authentication is
-- enabled using a security configuration. For more information see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html Use Kerberos Authentication>
-- in the /Amazon EMR Management Guide/.
--
-- 'newSupportedProducts'', 'runJobFlow_newSupportedProducts' - For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
-- later, use Applications.
--
-- A list of strings that indicates third-party software to use with the
-- job flow that accepts a user argument list. EMR accepts and forwards the
-- argument list to the corresponding installation script as bootstrap
-- action arguments. For more information, see \"Launch a Job Flow on the
-- MapR Distribution for Hadoop\" in the
-- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
-- Supported values are:
--
-- -   \"mapr-m3\" - launch the cluster using MapR M3 Edition.
--
-- -   \"mapr-m5\" - launch the cluster using MapR M5 Edition.
--
-- -   \"mapr\" with the user arguments specifying \"--edition,m3\" or
--     \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition
--     respectively.
--
-- -   \"mapr-m7\" - launch the cluster using MapR M7 Edition.
--
-- -   \"hunk\" - launch the cluster with the Hunk Big Data Analytics
--     Platform.
--
-- -   \"hue\"- launch the cluster with Hue installed.
--
-- -   \"spark\" - launch the cluster with Apache Spark installed.
--
-- -   \"ganglia\" - launch the cluster with the Ganglia Monitoring System
--     installed.
--
-- 'managedScalingPolicy', 'runJobFlow_managedScalingPolicy' - The specified managed scaling policy for an Amazon EMR cluster.
--
-- 'visibleToAllUsers', 'runJobFlow_visibleToAllUsers' - Set this value to @true@ so that IAM principals in the Amazon Web
-- Services account associated with the cluster can perform EMR actions on
-- the cluster that their IAM policies allow. This value defaults to @true@
-- for clusters created using the EMR API or the CLI
-- <https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html create-cluster>
-- command.
--
-- When set to @false@, only the IAM principal that created the cluster and
-- the Amazon Web Services account root user can perform EMR actions for
-- the cluster, regardless of the IAM permissions policies attached to
-- other IAM principals. For more information, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_iam_emr-with-iam.html#security_set_visible_to_all_users Understanding the EMR Cluster VisibleToAllUsers Setting>
-- in the /Amazon EMRManagement Guide/.
--
-- 'supportedProducts', 'runJobFlow_supportedProducts' - For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
-- later, use Applications.
--
-- A list of strings that indicates third-party software to use. For more
-- information, see the
-- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
-- Currently supported values are:
--
-- -   \"mapr-m3\" - launch the job flow using MapR M3 Edition.
--
-- -   \"mapr-m5\" - launch the job flow using MapR M5 Edition.
--
-- 'stepConcurrencyLevel', 'runJobFlow_stepConcurrencyLevel' - Specifies the number of steps that can be executed concurrently. The
-- default value is @1@. The maximum value is @256@.
--
-- 'applications', 'runJobFlow_applications' - Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of
-- applications for Amazon EMR to install and configure when launching the
-- cluster. For a list of applications available for each Amazon EMR
-- release version, see the
-- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ Amazon EMR Release Guide>.
--
-- 'tags', 'runJobFlow_tags' - A list of tags to associate with a cluster and propagate to Amazon EC2
-- instances.
--
-- 'serviceRole', 'runJobFlow_serviceRole' - The IAM role that Amazon EMR assumes in order to access Amazon Web
-- Services resources on your behalf.
--
-- 'name', 'runJobFlow_name' - The name of the job flow.
--
-- 'instances', 'runJobFlow_instances' - A specification of the number and type of Amazon EC2 instances.
newRunJobFlow ::
  -- | 'name'
  Prelude.Text ->
  -- | 'instances'
  JobFlowInstancesConfig ->
  RunJobFlow
newRunJobFlow :: Text -> JobFlowInstancesConfig -> RunJobFlow
newRunJobFlow Text
pName_ JobFlowInstancesConfig
pInstances_ =
  RunJobFlow' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe AutoTerminationPolicy
-> Maybe [Configuration]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ScaleDownBehavior
-> Maybe [StepConfig]
-> Maybe Text
-> Maybe [BootstrapActionConfig]
-> Maybe Text
-> Maybe RepoUpgradeOnBoot
-> Maybe [PlacementGroupConfig]
-> Maybe Text
-> Maybe KerberosAttributes
-> Maybe [SupportedProductConfig]
-> Maybe ManagedScalingPolicy
-> Maybe Bool
-> Maybe [Text]
-> Maybe Int
-> Maybe [Application]
-> Maybe [Tag]
-> Maybe Text
-> Text
-> JobFlowInstancesConfig
-> RunJobFlow
RunJobFlow'
    { $sel:logEncryptionKmsKeyId:RunJobFlow' :: Maybe Text
logEncryptionKmsKeyId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:amiVersion:RunJobFlow' :: Maybe Text
amiVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsRootVolumeSize:RunJobFlow' :: Maybe Int
ebsRootVolumeSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalInfo:RunJobFlow' :: Maybe Text
additionalInfo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoTerminationPolicy:RunJobFlow' :: Maybe AutoTerminationPolicy
autoTerminationPolicy = Maybe AutoTerminationPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:configurations:RunJobFlow' :: Maybe [Configuration]
configurations = Maybe [Configuration]
forall a. Maybe a
Prelude.Nothing,
      $sel:customAmiId:RunJobFlow' :: Maybe Text
customAmiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingRole:RunJobFlow' :: Maybe Text
autoScalingRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityConfiguration:RunJobFlow' :: Maybe Text
securityConfiguration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scaleDownBehavior:RunJobFlow' :: Maybe ScaleDownBehavior
scaleDownBehavior = Maybe ScaleDownBehavior
forall a. Maybe a
Prelude.Nothing,
      $sel:steps:RunJobFlow' :: Maybe [StepConfig]
steps = Maybe [StepConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:jobFlowRole:RunJobFlow' :: Maybe Text
jobFlowRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bootstrapActions:RunJobFlow' :: Maybe [BootstrapActionConfig]
bootstrapActions = Maybe [BootstrapActionConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:releaseLabel:RunJobFlow' :: Maybe Text
releaseLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repoUpgradeOnBoot:RunJobFlow' :: Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot = Maybe RepoUpgradeOnBoot
forall a. Maybe a
Prelude.Nothing,
      $sel:placementGroupConfigs:RunJobFlow' :: Maybe [PlacementGroupConfig]
placementGroupConfigs = Maybe [PlacementGroupConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:logUri:RunJobFlow' :: Maybe Text
logUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kerberosAttributes:RunJobFlow' :: Maybe KerberosAttributes
kerberosAttributes = Maybe KerberosAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:newSupportedProducts':RunJobFlow' :: Maybe [SupportedProductConfig]
newSupportedProducts' = Maybe [SupportedProductConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:managedScalingPolicy:RunJobFlow' :: Maybe ManagedScalingPolicy
managedScalingPolicy = Maybe ManagedScalingPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:visibleToAllUsers:RunJobFlow' :: Maybe Bool
visibleToAllUsers = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:supportedProducts:RunJobFlow' :: Maybe [Text]
supportedProducts = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:stepConcurrencyLevel:RunJobFlow' :: Maybe Int
stepConcurrencyLevel = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:applications:RunJobFlow' :: Maybe [Application]
applications = Maybe [Application]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RunJobFlow' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRole:RunJobFlow' :: Maybe Text
serviceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:RunJobFlow' :: Text
name = Text
pName_,
      $sel:instances:RunJobFlow' :: JobFlowInstancesConfig
instances = JobFlowInstancesConfig
pInstances_
    }

-- | The KMS key used for encrypting log files. If a value is not provided,
-- the logs remain encrypted by AES-256. This attribute is only available
-- with Amazon EMR version 5.30.0 and later, excluding Amazon EMR 6.0.0.
runJobFlow_logEncryptionKmsKeyId :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_logEncryptionKmsKeyId :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_logEncryptionKmsKeyId = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
logEncryptionKmsKeyId :: Maybe Text
$sel:logEncryptionKmsKeyId:RunJobFlow' :: RunJobFlow -> Maybe Text
logEncryptionKmsKeyId} -> Maybe Text
logEncryptionKmsKeyId) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:logEncryptionKmsKeyId:RunJobFlow' :: Maybe Text
logEncryptionKmsKeyId = Maybe Text
a} :: RunJobFlow)

-- | Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR
-- releases 4.0 and later, @ReleaseLabel@ is used. To specify a custom AMI,
-- use @CustomAmiID@.
runJobFlow_amiVersion :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_amiVersion :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_amiVersion = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
amiVersion :: Maybe Text
$sel:amiVersion:RunJobFlow' :: RunJobFlow -> Maybe Text
amiVersion} -> Maybe Text
amiVersion) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:amiVersion:RunJobFlow' :: Maybe Text
amiVersion = Maybe Text
a} :: RunJobFlow)

-- | The size, in GiB, of the Amazon EBS root device volume of the Linux AMI
-- that is used for each EC2 instance. Available in Amazon EMR version 4.x
-- and later.
runJobFlow_ebsRootVolumeSize :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Int)
runJobFlow_ebsRootVolumeSize :: (Maybe Int -> f (Maybe Int)) -> RunJobFlow -> f RunJobFlow
runJobFlow_ebsRootVolumeSize = (RunJobFlow -> Maybe Int)
-> (RunJobFlow -> Maybe Int -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Int
ebsRootVolumeSize :: Maybe Int
$sel:ebsRootVolumeSize:RunJobFlow' :: RunJobFlow -> Maybe Int
ebsRootVolumeSize} -> Maybe Int
ebsRootVolumeSize) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Int
a -> RunJobFlow
s {$sel:ebsRootVolumeSize:RunJobFlow' :: Maybe Int
ebsRootVolumeSize = Maybe Int
a} :: RunJobFlow)

-- | A JSON string for selecting additional features.
runJobFlow_additionalInfo :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_additionalInfo :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_additionalInfo = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
additionalInfo :: Maybe Text
$sel:additionalInfo:RunJobFlow' :: RunJobFlow -> Maybe Text
additionalInfo} -> Maybe Text
additionalInfo) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:additionalInfo:RunJobFlow' :: Maybe Text
additionalInfo = Maybe Text
a} :: RunJobFlow)

-- | Undocumented member.
runJobFlow_autoTerminationPolicy :: Lens.Lens' RunJobFlow (Prelude.Maybe AutoTerminationPolicy)
runJobFlow_autoTerminationPolicy :: (Maybe AutoTerminationPolicy -> f (Maybe AutoTerminationPolicy))
-> RunJobFlow -> f RunJobFlow
runJobFlow_autoTerminationPolicy = (RunJobFlow -> Maybe AutoTerminationPolicy)
-> (RunJobFlow -> Maybe AutoTerminationPolicy -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe AutoTerminationPolicy)
     (Maybe AutoTerminationPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe AutoTerminationPolicy
autoTerminationPolicy :: Maybe AutoTerminationPolicy
$sel:autoTerminationPolicy:RunJobFlow' :: RunJobFlow -> Maybe AutoTerminationPolicy
autoTerminationPolicy} -> Maybe AutoTerminationPolicy
autoTerminationPolicy) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe AutoTerminationPolicy
a -> RunJobFlow
s {$sel:autoTerminationPolicy:RunJobFlow' :: Maybe AutoTerminationPolicy
autoTerminationPolicy = Maybe AutoTerminationPolicy
a} :: RunJobFlow)

-- | For Amazon EMR releases 4.0 and later. The list of configurations
-- supplied for the EMR cluster you are creating.
runJobFlow_configurations :: Lens.Lens' RunJobFlow (Prelude.Maybe [Configuration])
runJobFlow_configurations :: (Maybe [Configuration] -> f (Maybe [Configuration]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_configurations = (RunJobFlow -> Maybe [Configuration])
-> (RunJobFlow -> Maybe [Configuration] -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe [Configuration])
     (Maybe [Configuration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [Configuration]
configurations :: Maybe [Configuration]
$sel:configurations:RunJobFlow' :: RunJobFlow -> Maybe [Configuration]
configurations} -> Maybe [Configuration]
configurations) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [Configuration]
a -> RunJobFlow
s {$sel:configurations:RunJobFlow' :: Maybe [Configuration]
configurations = Maybe [Configuration]
a} :: RunJobFlow) ((Maybe [Configuration] -> f (Maybe [Configuration]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [Configuration] -> f (Maybe [Configuration]))
    -> Maybe [Configuration] -> f (Maybe [Configuration]))
-> (Maybe [Configuration] -> f (Maybe [Configuration]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [Configuration] [Configuration] [Configuration] [Configuration]
-> Iso
     (Maybe [Configuration])
     (Maybe [Configuration])
     (Maybe [Configuration])
     (Maybe [Configuration])
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
  [Configuration] [Configuration] [Configuration] [Configuration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Available only in Amazon EMR version 5.7.0 and later. The ID of a custom
-- Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when
-- it launches cluster EC2 instances. For more information about custom
-- AMIs in Amazon EMR, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html Using a Custom AMI>
-- in the /Amazon EMR Management Guide/. If omitted, the cluster uses the
-- base Linux AMI for the @ReleaseLabel@ specified. For Amazon EMR versions
-- 2.x and 3.x, use @AmiVersion@ instead.
--
-- For information about creating a custom AMI, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html Creating an Amazon EBS-Backed Linux AMI>
-- in the /Amazon Elastic Compute Cloud User Guide for Linux Instances/.
-- For information about finding an AMI ID, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html Finding a Linux AMI>.
runJobFlow_customAmiId :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_customAmiId :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_customAmiId = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
customAmiId :: Maybe Text
$sel:customAmiId:RunJobFlow' :: RunJobFlow -> Maybe Text
customAmiId} -> Maybe Text
customAmiId) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:customAmiId:RunJobFlow' :: Maybe Text
customAmiId = Maybe Text
a} :: RunJobFlow)

-- | An IAM role for automatic scaling policies. The default role is
-- @EMR_AutoScaling_DefaultRole@. The IAM role provides permissions that
-- the automatic scaling feature requires to launch and terminate EC2
-- instances in an instance group.
runJobFlow_autoScalingRole :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_autoScalingRole :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_autoScalingRole = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
autoScalingRole :: Maybe Text
$sel:autoScalingRole:RunJobFlow' :: RunJobFlow -> Maybe Text
autoScalingRole} -> Maybe Text
autoScalingRole) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:autoScalingRole:RunJobFlow' :: Maybe Text
autoScalingRole = Maybe Text
a} :: RunJobFlow)

-- | The name of a security configuration to apply to the cluster.
runJobFlow_securityConfiguration :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_securityConfiguration :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_securityConfiguration = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
securityConfiguration :: Maybe Text
$sel:securityConfiguration:RunJobFlow' :: RunJobFlow -> Maybe Text
securityConfiguration} -> Maybe Text
securityConfiguration) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:securityConfiguration:RunJobFlow' :: Maybe Text
securityConfiguration = Maybe Text
a} :: RunJobFlow)

-- | Specifies the way that individual Amazon EC2 instances terminate when an
-- automatic scale-in activity occurs or an instance group is resized.
-- @TERMINATE_AT_INSTANCE_HOUR@ indicates that Amazon EMR terminates nodes
-- at the instance-hour boundary, regardless of when the request to
-- terminate the instance was submitted. This option is only available with
-- Amazon EMR 5.1.0 and later and is the default for clusters created using
-- that version. @TERMINATE_AT_TASK_COMPLETION@ indicates that Amazon EMR
-- adds nodes to a deny list and drains tasks from nodes before terminating
-- the Amazon EC2 instances, regardless of the instance-hour boundary. With
-- either behavior, Amazon EMR removes the least active nodes first and
-- blocks instance termination if it could lead to HDFS corruption.
-- @TERMINATE_AT_TASK_COMPLETION@ available only in Amazon EMR version
-- 4.1.0 and later, and is the default for versions of Amazon EMR earlier
-- than 5.1.0.
runJobFlow_scaleDownBehavior :: Lens.Lens' RunJobFlow (Prelude.Maybe ScaleDownBehavior)
runJobFlow_scaleDownBehavior :: (Maybe ScaleDownBehavior -> f (Maybe ScaleDownBehavior))
-> RunJobFlow -> f RunJobFlow
runJobFlow_scaleDownBehavior = (RunJobFlow -> Maybe ScaleDownBehavior)
-> (RunJobFlow -> Maybe ScaleDownBehavior -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe ScaleDownBehavior)
     (Maybe ScaleDownBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe ScaleDownBehavior
scaleDownBehavior :: Maybe ScaleDownBehavior
$sel:scaleDownBehavior:RunJobFlow' :: RunJobFlow -> Maybe ScaleDownBehavior
scaleDownBehavior} -> Maybe ScaleDownBehavior
scaleDownBehavior) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe ScaleDownBehavior
a -> RunJobFlow
s {$sel:scaleDownBehavior:RunJobFlow' :: Maybe ScaleDownBehavior
scaleDownBehavior = Maybe ScaleDownBehavior
a} :: RunJobFlow)

-- | A list of steps to run.
runJobFlow_steps :: Lens.Lens' RunJobFlow (Prelude.Maybe [StepConfig])
runJobFlow_steps :: (Maybe [StepConfig] -> f (Maybe [StepConfig]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_steps = (RunJobFlow -> Maybe [StepConfig])
-> (RunJobFlow -> Maybe [StepConfig] -> RunJobFlow)
-> Lens
     RunJobFlow RunJobFlow (Maybe [StepConfig]) (Maybe [StepConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [StepConfig]
steps :: Maybe [StepConfig]
$sel:steps:RunJobFlow' :: RunJobFlow -> Maybe [StepConfig]
steps} -> Maybe [StepConfig]
steps) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [StepConfig]
a -> RunJobFlow
s {$sel:steps:RunJobFlow' :: Maybe [StepConfig]
steps = Maybe [StepConfig]
a} :: RunJobFlow) ((Maybe [StepConfig] -> f (Maybe [StepConfig]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [StepConfig] -> f (Maybe [StepConfig]))
    -> Maybe [StepConfig] -> f (Maybe [StepConfig]))
-> (Maybe [StepConfig] -> f (Maybe [StepConfig]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [StepConfig] [StepConfig] [StepConfig] [StepConfig]
-> Iso
     (Maybe [StepConfig])
     (Maybe [StepConfig])
     (Maybe [StepConfig])
     (Maybe [StepConfig])
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 [StepConfig] [StepConfig] [StepConfig] [StepConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Also called instance profile and EC2 role. An IAM role for an EMR
-- cluster. The EC2 instances of the cluster assume this role. The default
-- role is @EMR_EC2_DefaultRole@. In order to use the default role, you
-- must have already created it using the CLI or console.
runJobFlow_jobFlowRole :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_jobFlowRole :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_jobFlowRole = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
jobFlowRole :: Maybe Text
$sel:jobFlowRole:RunJobFlow' :: RunJobFlow -> Maybe Text
jobFlowRole} -> Maybe Text
jobFlowRole) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:jobFlowRole:RunJobFlow' :: Maybe Text
jobFlowRole = Maybe Text
a} :: RunJobFlow)

-- | A list of bootstrap actions to run before Hadoop starts on the cluster
-- nodes.
runJobFlow_bootstrapActions :: Lens.Lens' RunJobFlow (Prelude.Maybe [BootstrapActionConfig])
runJobFlow_bootstrapActions :: (Maybe [BootstrapActionConfig]
 -> f (Maybe [BootstrapActionConfig]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_bootstrapActions = (RunJobFlow -> Maybe [BootstrapActionConfig])
-> (RunJobFlow -> Maybe [BootstrapActionConfig] -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe [BootstrapActionConfig])
     (Maybe [BootstrapActionConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [BootstrapActionConfig]
bootstrapActions :: Maybe [BootstrapActionConfig]
$sel:bootstrapActions:RunJobFlow' :: RunJobFlow -> Maybe [BootstrapActionConfig]
bootstrapActions} -> Maybe [BootstrapActionConfig]
bootstrapActions) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [BootstrapActionConfig]
a -> RunJobFlow
s {$sel:bootstrapActions:RunJobFlow' :: Maybe [BootstrapActionConfig]
bootstrapActions = Maybe [BootstrapActionConfig]
a} :: RunJobFlow) ((Maybe [BootstrapActionConfig]
  -> f (Maybe [BootstrapActionConfig]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [BootstrapActionConfig]
     -> f (Maybe [BootstrapActionConfig]))
    -> Maybe [BootstrapActionConfig]
    -> f (Maybe [BootstrapActionConfig]))
-> (Maybe [BootstrapActionConfig]
    -> f (Maybe [BootstrapActionConfig]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BootstrapActionConfig]
  [BootstrapActionConfig]
  [BootstrapActionConfig]
  [BootstrapActionConfig]
-> Iso
     (Maybe [BootstrapActionConfig])
     (Maybe [BootstrapActionConfig])
     (Maybe [BootstrapActionConfig])
     (Maybe [BootstrapActionConfig])
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
  [BootstrapActionConfig]
  [BootstrapActionConfig]
  [BootstrapActionConfig]
  [BootstrapActionConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon EMR release label, which determines the version of
-- open-source application packages installed on the cluster. Release
-- labels are in the form @emr-x.x.x@, where x.x.x is an Amazon EMR release
-- version such as @emr-5.14.0@. For more information about Amazon EMR
-- release versions and included application versions and features, see
-- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/>. The release
-- label applies only to Amazon EMR releases version 4.0 and later. Earlier
-- versions use @AmiVersion@.
runJobFlow_releaseLabel :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_releaseLabel :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_releaseLabel = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
releaseLabel :: Maybe Text
$sel:releaseLabel:RunJobFlow' :: RunJobFlow -> Maybe Text
releaseLabel} -> Maybe Text
releaseLabel) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:releaseLabel:RunJobFlow' :: Maybe Text
releaseLabel = Maybe Text
a} :: RunJobFlow)

-- | Applies only when @CustomAmiID@ is used. Specifies which updates from
-- the Amazon Linux AMI package repositories to apply automatically when
-- the instance boots using the AMI. If omitted, the default is @SECURITY@,
-- which indicates that only security updates are applied. If @NONE@ is
-- specified, no updates are applied, and all updates must be applied
-- manually.
runJobFlow_repoUpgradeOnBoot :: Lens.Lens' RunJobFlow (Prelude.Maybe RepoUpgradeOnBoot)
runJobFlow_repoUpgradeOnBoot :: (Maybe RepoUpgradeOnBoot -> f (Maybe RepoUpgradeOnBoot))
-> RunJobFlow -> f RunJobFlow
runJobFlow_repoUpgradeOnBoot = (RunJobFlow -> Maybe RepoUpgradeOnBoot)
-> (RunJobFlow -> Maybe RepoUpgradeOnBoot -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe RepoUpgradeOnBoot)
     (Maybe RepoUpgradeOnBoot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot :: Maybe RepoUpgradeOnBoot
$sel:repoUpgradeOnBoot:RunJobFlow' :: RunJobFlow -> Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot} -> Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe RepoUpgradeOnBoot
a -> RunJobFlow
s {$sel:repoUpgradeOnBoot:RunJobFlow' :: Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot = Maybe RepoUpgradeOnBoot
a} :: RunJobFlow)

-- | The specified placement group configuration for an Amazon EMR cluster.
runJobFlow_placementGroupConfigs :: Lens.Lens' RunJobFlow (Prelude.Maybe [PlacementGroupConfig])
runJobFlow_placementGroupConfigs :: (Maybe [PlacementGroupConfig] -> f (Maybe [PlacementGroupConfig]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_placementGroupConfigs = (RunJobFlow -> Maybe [PlacementGroupConfig])
-> (RunJobFlow -> Maybe [PlacementGroupConfig] -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe [PlacementGroupConfig])
     (Maybe [PlacementGroupConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [PlacementGroupConfig]
placementGroupConfigs :: Maybe [PlacementGroupConfig]
$sel:placementGroupConfigs:RunJobFlow' :: RunJobFlow -> Maybe [PlacementGroupConfig]
placementGroupConfigs} -> Maybe [PlacementGroupConfig]
placementGroupConfigs) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [PlacementGroupConfig]
a -> RunJobFlow
s {$sel:placementGroupConfigs:RunJobFlow' :: Maybe [PlacementGroupConfig]
placementGroupConfigs = Maybe [PlacementGroupConfig]
a} :: RunJobFlow) ((Maybe [PlacementGroupConfig] -> f (Maybe [PlacementGroupConfig]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [PlacementGroupConfig]
     -> f (Maybe [PlacementGroupConfig]))
    -> Maybe [PlacementGroupConfig]
    -> f (Maybe [PlacementGroupConfig]))
-> (Maybe [PlacementGroupConfig]
    -> f (Maybe [PlacementGroupConfig]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlacementGroupConfig]
  [PlacementGroupConfig]
  [PlacementGroupConfig]
  [PlacementGroupConfig]
-> Iso
     (Maybe [PlacementGroupConfig])
     (Maybe [PlacementGroupConfig])
     (Maybe [PlacementGroupConfig])
     (Maybe [PlacementGroupConfig])
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
  [PlacementGroupConfig]
  [PlacementGroupConfig]
  [PlacementGroupConfig]
  [PlacementGroupConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The location in Amazon S3 to write the log files of the job flow. If a
-- value is not provided, logs are not created.
runJobFlow_logUri :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_logUri :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_logUri = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
logUri :: Maybe Text
$sel:logUri:RunJobFlow' :: RunJobFlow -> Maybe Text
logUri} -> Maybe Text
logUri) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:logUri:RunJobFlow' :: Maybe Text
logUri = Maybe Text
a} :: RunJobFlow)

-- | Attributes for Kerberos configuration when Kerberos authentication is
-- enabled using a security configuration. For more information see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html Use Kerberos Authentication>
-- in the /Amazon EMR Management Guide/.
runJobFlow_kerberosAttributes :: Lens.Lens' RunJobFlow (Prelude.Maybe KerberosAttributes)
runJobFlow_kerberosAttributes :: (Maybe KerberosAttributes -> f (Maybe KerberosAttributes))
-> RunJobFlow -> f RunJobFlow
runJobFlow_kerberosAttributes = (RunJobFlow -> Maybe KerberosAttributes)
-> (RunJobFlow -> Maybe KerberosAttributes -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe KerberosAttributes)
     (Maybe KerberosAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe KerberosAttributes
kerberosAttributes :: Maybe KerberosAttributes
$sel:kerberosAttributes:RunJobFlow' :: RunJobFlow -> Maybe KerberosAttributes
kerberosAttributes} -> Maybe KerberosAttributes
kerberosAttributes) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe KerberosAttributes
a -> RunJobFlow
s {$sel:kerberosAttributes:RunJobFlow' :: Maybe KerberosAttributes
kerberosAttributes = Maybe KerberosAttributes
a} :: RunJobFlow)

-- | For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
-- later, use Applications.
--
-- A list of strings that indicates third-party software to use with the
-- job flow that accepts a user argument list. EMR accepts and forwards the
-- argument list to the corresponding installation script as bootstrap
-- action arguments. For more information, see \"Launch a Job Flow on the
-- MapR Distribution for Hadoop\" in the
-- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
-- Supported values are:
--
-- -   \"mapr-m3\" - launch the cluster using MapR M3 Edition.
--
-- -   \"mapr-m5\" - launch the cluster using MapR M5 Edition.
--
-- -   \"mapr\" with the user arguments specifying \"--edition,m3\" or
--     \"--edition,m5\" - launch the job flow using MapR M3 or M5 Edition
--     respectively.
--
-- -   \"mapr-m7\" - launch the cluster using MapR M7 Edition.
--
-- -   \"hunk\" - launch the cluster with the Hunk Big Data Analytics
--     Platform.
--
-- -   \"hue\"- launch the cluster with Hue installed.
--
-- -   \"spark\" - launch the cluster with Apache Spark installed.
--
-- -   \"ganglia\" - launch the cluster with the Ganglia Monitoring System
--     installed.
runJobFlow_newSupportedProducts :: Lens.Lens' RunJobFlow (Prelude.Maybe [SupportedProductConfig])
runJobFlow_newSupportedProducts :: (Maybe [SupportedProductConfig]
 -> f (Maybe [SupportedProductConfig]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_newSupportedProducts = (RunJobFlow -> Maybe [SupportedProductConfig])
-> (RunJobFlow -> Maybe [SupportedProductConfig] -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe [SupportedProductConfig])
     (Maybe [SupportedProductConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [SupportedProductConfig]
newSupportedProducts' :: Maybe [SupportedProductConfig]
$sel:newSupportedProducts':RunJobFlow' :: RunJobFlow -> Maybe [SupportedProductConfig]
newSupportedProducts'} -> Maybe [SupportedProductConfig]
newSupportedProducts') (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [SupportedProductConfig]
a -> RunJobFlow
s {$sel:newSupportedProducts':RunJobFlow' :: Maybe [SupportedProductConfig]
newSupportedProducts' = Maybe [SupportedProductConfig]
a} :: RunJobFlow) ((Maybe [SupportedProductConfig]
  -> f (Maybe [SupportedProductConfig]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [SupportedProductConfig]
     -> f (Maybe [SupportedProductConfig]))
    -> Maybe [SupportedProductConfig]
    -> f (Maybe [SupportedProductConfig]))
-> (Maybe [SupportedProductConfig]
    -> f (Maybe [SupportedProductConfig]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SupportedProductConfig]
  [SupportedProductConfig]
  [SupportedProductConfig]
  [SupportedProductConfig]
-> Iso
     (Maybe [SupportedProductConfig])
     (Maybe [SupportedProductConfig])
     (Maybe [SupportedProductConfig])
     (Maybe [SupportedProductConfig])
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
  [SupportedProductConfig]
  [SupportedProductConfig]
  [SupportedProductConfig]
  [SupportedProductConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The specified managed scaling policy for an Amazon EMR cluster.
runJobFlow_managedScalingPolicy :: Lens.Lens' RunJobFlow (Prelude.Maybe ManagedScalingPolicy)
runJobFlow_managedScalingPolicy :: (Maybe ManagedScalingPolicy -> f (Maybe ManagedScalingPolicy))
-> RunJobFlow -> f RunJobFlow
runJobFlow_managedScalingPolicy = (RunJobFlow -> Maybe ManagedScalingPolicy)
-> (RunJobFlow -> Maybe ManagedScalingPolicy -> RunJobFlow)
-> Lens
     RunJobFlow
     RunJobFlow
     (Maybe ManagedScalingPolicy)
     (Maybe ManagedScalingPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe ManagedScalingPolicy
managedScalingPolicy :: Maybe ManagedScalingPolicy
$sel:managedScalingPolicy:RunJobFlow' :: RunJobFlow -> Maybe ManagedScalingPolicy
managedScalingPolicy} -> Maybe ManagedScalingPolicy
managedScalingPolicy) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe ManagedScalingPolicy
a -> RunJobFlow
s {$sel:managedScalingPolicy:RunJobFlow' :: Maybe ManagedScalingPolicy
managedScalingPolicy = Maybe ManagedScalingPolicy
a} :: RunJobFlow)

-- | Set this value to @true@ so that IAM principals in the Amazon Web
-- Services account associated with the cluster can perform EMR actions on
-- the cluster that their IAM policies allow. This value defaults to @true@
-- for clusters created using the EMR API or the CLI
-- <https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html create-cluster>
-- command.
--
-- When set to @false@, only the IAM principal that created the cluster and
-- the Amazon Web Services account root user can perform EMR actions for
-- the cluster, regardless of the IAM permissions policies attached to
-- other IAM principals. For more information, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_iam_emr-with-iam.html#security_set_visible_to_all_users Understanding the EMR Cluster VisibleToAllUsers Setting>
-- in the /Amazon EMRManagement Guide/.
runJobFlow_visibleToAllUsers :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Bool)
runJobFlow_visibleToAllUsers :: (Maybe Bool -> f (Maybe Bool)) -> RunJobFlow -> f RunJobFlow
runJobFlow_visibleToAllUsers = (RunJobFlow -> Maybe Bool)
-> (RunJobFlow -> Maybe Bool -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Bool
visibleToAllUsers :: Maybe Bool
$sel:visibleToAllUsers:RunJobFlow' :: RunJobFlow -> Maybe Bool
visibleToAllUsers} -> Maybe Bool
visibleToAllUsers) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Bool
a -> RunJobFlow
s {$sel:visibleToAllUsers:RunJobFlow' :: Maybe Bool
visibleToAllUsers = Maybe Bool
a} :: RunJobFlow)

-- | For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and
-- later, use Applications.
--
-- A list of strings that indicates third-party software to use. For more
-- information, see the
-- <https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf Amazon EMR Developer Guide>.
-- Currently supported values are:
--
-- -   \"mapr-m3\" - launch the job flow using MapR M3 Edition.
--
-- -   \"mapr-m5\" - launch the job flow using MapR M5 Edition.
runJobFlow_supportedProducts :: Lens.Lens' RunJobFlow (Prelude.Maybe [Prelude.Text])
runJobFlow_supportedProducts :: (Maybe [Text] -> f (Maybe [Text])) -> RunJobFlow -> f RunJobFlow
runJobFlow_supportedProducts = (RunJobFlow -> Maybe [Text])
-> (RunJobFlow -> Maybe [Text] -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [Text]
supportedProducts :: Maybe [Text]
$sel:supportedProducts:RunJobFlow' :: RunJobFlow -> Maybe [Text]
supportedProducts} -> Maybe [Text]
supportedProducts) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [Text]
a -> RunJobFlow
s {$sel:supportedProducts:RunJobFlow' :: Maybe [Text]
supportedProducts = Maybe [Text]
a} :: RunJobFlow) ((Maybe [Text] -> f (Maybe [Text])) -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RunJobFlow
-> f RunJobFlow
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

-- | Specifies the number of steps that can be executed concurrently. The
-- default value is @1@. The maximum value is @256@.
runJobFlow_stepConcurrencyLevel :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Int)
runJobFlow_stepConcurrencyLevel :: (Maybe Int -> f (Maybe Int)) -> RunJobFlow -> f RunJobFlow
runJobFlow_stepConcurrencyLevel = (RunJobFlow -> Maybe Int)
-> (RunJobFlow -> Maybe Int -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Int
stepConcurrencyLevel :: Maybe Int
$sel:stepConcurrencyLevel:RunJobFlow' :: RunJobFlow -> Maybe Int
stepConcurrencyLevel} -> Maybe Int
stepConcurrencyLevel) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Int
a -> RunJobFlow
s {$sel:stepConcurrencyLevel:RunJobFlow' :: Maybe Int
stepConcurrencyLevel = Maybe Int
a} :: RunJobFlow)

-- | Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of
-- applications for Amazon EMR to install and configure when launching the
-- cluster. For a list of applications available for each Amazon EMR
-- release version, see the
-- <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ Amazon EMR Release Guide>.
runJobFlow_applications :: Lens.Lens' RunJobFlow (Prelude.Maybe [Application])
runJobFlow_applications :: (Maybe [Application] -> f (Maybe [Application]))
-> RunJobFlow -> f RunJobFlow
runJobFlow_applications = (RunJobFlow -> Maybe [Application])
-> (RunJobFlow -> Maybe [Application] -> RunJobFlow)
-> Lens
     RunJobFlow RunJobFlow (Maybe [Application]) (Maybe [Application])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [Application]
applications :: Maybe [Application]
$sel:applications:RunJobFlow' :: RunJobFlow -> Maybe [Application]
applications} -> Maybe [Application]
applications) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [Application]
a -> RunJobFlow
s {$sel:applications:RunJobFlow' :: Maybe [Application]
applications = Maybe [Application]
a} :: RunJobFlow) ((Maybe [Application] -> f (Maybe [Application]))
 -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [Application] -> f (Maybe [Application]))
    -> Maybe [Application] -> f (Maybe [Application]))
-> (Maybe [Application] -> f (Maybe [Application]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Application] [Application] [Application] [Application]
-> Iso
     (Maybe [Application])
     (Maybe [Application])
     (Maybe [Application])
     (Maybe [Application])
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 [Application] [Application] [Application] [Application]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of tags to associate with a cluster and propagate to Amazon EC2
-- instances.
runJobFlow_tags :: Lens.Lens' RunJobFlow (Prelude.Maybe [Tag])
runJobFlow_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> RunJobFlow -> f RunJobFlow
runJobFlow_tags = (RunJobFlow -> Maybe [Tag])
-> (RunJobFlow -> Maybe [Tag] -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:RunJobFlow' :: RunJobFlow -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe [Tag]
a -> RunJobFlow
s {$sel:tags:RunJobFlow' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: RunJobFlow) ((Maybe [Tag] -> f (Maybe [Tag])) -> RunJobFlow -> f RunJobFlow)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> RunJobFlow
-> f RunJobFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IAM role that Amazon EMR assumes in order to access Amazon Web
-- Services resources on your behalf.
runJobFlow_serviceRole :: Lens.Lens' RunJobFlow (Prelude.Maybe Prelude.Text)
runJobFlow_serviceRole :: (Maybe Text -> f (Maybe Text)) -> RunJobFlow -> f RunJobFlow
runJobFlow_serviceRole = (RunJobFlow -> Maybe Text)
-> (RunJobFlow -> Maybe Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:RunJobFlow' :: RunJobFlow -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: RunJobFlow
s@RunJobFlow' {} Maybe Text
a -> RunJobFlow
s {$sel:serviceRole:RunJobFlow' :: Maybe Text
serviceRole = Maybe Text
a} :: RunJobFlow)

-- | The name of the job flow.
runJobFlow_name :: Lens.Lens' RunJobFlow Prelude.Text
runJobFlow_name :: (Text -> f Text) -> RunJobFlow -> f RunJobFlow
runJobFlow_name = (RunJobFlow -> Text)
-> (RunJobFlow -> Text -> RunJobFlow)
-> Lens RunJobFlow RunJobFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {Text
name :: Text
$sel:name:RunJobFlow' :: RunJobFlow -> Text
name} -> Text
name) (\s :: RunJobFlow
s@RunJobFlow' {} Text
a -> RunJobFlow
s {$sel:name:RunJobFlow' :: Text
name = Text
a} :: RunJobFlow)

-- | A specification of the number and type of Amazon EC2 instances.
runJobFlow_instances :: Lens.Lens' RunJobFlow JobFlowInstancesConfig
runJobFlow_instances :: (JobFlowInstancesConfig -> f JobFlowInstancesConfig)
-> RunJobFlow -> f RunJobFlow
runJobFlow_instances = (RunJobFlow -> JobFlowInstancesConfig)
-> (RunJobFlow -> JobFlowInstancesConfig -> RunJobFlow)
-> Lens
     RunJobFlow RunJobFlow JobFlowInstancesConfig JobFlowInstancesConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlow' {JobFlowInstancesConfig
instances :: JobFlowInstancesConfig
$sel:instances:RunJobFlow' :: RunJobFlow -> JobFlowInstancesConfig
instances} -> JobFlowInstancesConfig
instances) (\s :: RunJobFlow
s@RunJobFlow' {} JobFlowInstancesConfig
a -> RunJobFlow
s {$sel:instances:RunJobFlow' :: JobFlowInstancesConfig
instances = JobFlowInstancesConfig
a} :: RunJobFlow)

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

instance Prelude.Hashable RunJobFlow

instance Prelude.NFData RunJobFlow

instance Core.ToHeaders RunJobFlow where
  toHeaders :: RunJobFlow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RunJobFlow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ElasticMapReduce.RunJobFlow" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON RunJobFlow where
  toJSON :: RunJobFlow -> Value
toJSON RunJobFlow' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Application]
Maybe [Configuration]
Maybe [PlacementGroupConfig]
Maybe [BootstrapActionConfig]
Maybe [StepConfig]
Maybe [SupportedProductConfig]
Maybe [Tag]
Maybe Text
Maybe AutoTerminationPolicy
Maybe KerberosAttributes
Maybe ManagedScalingPolicy
Maybe RepoUpgradeOnBoot
Maybe ScaleDownBehavior
Text
JobFlowInstancesConfig
instances :: JobFlowInstancesConfig
name :: Text
serviceRole :: Maybe Text
tags :: Maybe [Tag]
applications :: Maybe [Application]
stepConcurrencyLevel :: Maybe Int
supportedProducts :: Maybe [Text]
visibleToAllUsers :: Maybe Bool
managedScalingPolicy :: Maybe ManagedScalingPolicy
newSupportedProducts' :: Maybe [SupportedProductConfig]
kerberosAttributes :: Maybe KerberosAttributes
logUri :: Maybe Text
placementGroupConfigs :: Maybe [PlacementGroupConfig]
repoUpgradeOnBoot :: Maybe RepoUpgradeOnBoot
releaseLabel :: Maybe Text
bootstrapActions :: Maybe [BootstrapActionConfig]
jobFlowRole :: Maybe Text
steps :: Maybe [StepConfig]
scaleDownBehavior :: Maybe ScaleDownBehavior
securityConfiguration :: Maybe Text
autoScalingRole :: Maybe Text
customAmiId :: Maybe Text
configurations :: Maybe [Configuration]
autoTerminationPolicy :: Maybe AutoTerminationPolicy
additionalInfo :: Maybe Text
ebsRootVolumeSize :: Maybe Int
amiVersion :: Maybe Text
logEncryptionKmsKeyId :: Maybe Text
$sel:instances:RunJobFlow' :: RunJobFlow -> JobFlowInstancesConfig
$sel:name:RunJobFlow' :: RunJobFlow -> Text
$sel:serviceRole:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:tags:RunJobFlow' :: RunJobFlow -> Maybe [Tag]
$sel:applications:RunJobFlow' :: RunJobFlow -> Maybe [Application]
$sel:stepConcurrencyLevel:RunJobFlow' :: RunJobFlow -> Maybe Int
$sel:supportedProducts:RunJobFlow' :: RunJobFlow -> Maybe [Text]
$sel:visibleToAllUsers:RunJobFlow' :: RunJobFlow -> Maybe Bool
$sel:managedScalingPolicy:RunJobFlow' :: RunJobFlow -> Maybe ManagedScalingPolicy
$sel:newSupportedProducts':RunJobFlow' :: RunJobFlow -> Maybe [SupportedProductConfig]
$sel:kerberosAttributes:RunJobFlow' :: RunJobFlow -> Maybe KerberosAttributes
$sel:logUri:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:placementGroupConfigs:RunJobFlow' :: RunJobFlow -> Maybe [PlacementGroupConfig]
$sel:repoUpgradeOnBoot:RunJobFlow' :: RunJobFlow -> Maybe RepoUpgradeOnBoot
$sel:releaseLabel:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:bootstrapActions:RunJobFlow' :: RunJobFlow -> Maybe [BootstrapActionConfig]
$sel:jobFlowRole:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:steps:RunJobFlow' :: RunJobFlow -> Maybe [StepConfig]
$sel:scaleDownBehavior:RunJobFlow' :: RunJobFlow -> Maybe ScaleDownBehavior
$sel:securityConfiguration:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:autoScalingRole:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:customAmiId:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:configurations:RunJobFlow' :: RunJobFlow -> Maybe [Configuration]
$sel:autoTerminationPolicy:RunJobFlow' :: RunJobFlow -> Maybe AutoTerminationPolicy
$sel:additionalInfo:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:ebsRootVolumeSize:RunJobFlow' :: RunJobFlow -> Maybe Int
$sel:amiVersion:RunJobFlow' :: RunJobFlow -> Maybe Text
$sel:logEncryptionKmsKeyId:RunJobFlow' :: RunJobFlow -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LogEncryptionKmsKeyId" 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
logEncryptionKmsKeyId,
            (Text
"AmiVersion" 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
amiVersion,
            (Text
"EbsRootVolumeSize" 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
ebsRootVolumeSize,
            (Text
"AdditionalInfo" 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
additionalInfo,
            (Text
"AutoTerminationPolicy" Text -> AutoTerminationPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AutoTerminationPolicy -> Pair)
-> Maybe AutoTerminationPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoTerminationPolicy
autoTerminationPolicy,
            (Text
"Configurations" Text -> [Configuration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Configuration] -> Pair) -> Maybe [Configuration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Configuration]
configurations,
            (Text
"CustomAmiId" 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
customAmiId,
            (Text
"AutoScalingRole" 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
autoScalingRole,
            (Text
"SecurityConfiguration" 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
securityConfiguration,
            (Text
"ScaleDownBehavior" Text -> ScaleDownBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ScaleDownBehavior -> Pair)
-> Maybe ScaleDownBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScaleDownBehavior
scaleDownBehavior,
            (Text
"Steps" Text -> [StepConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([StepConfig] -> Pair) -> Maybe [StepConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [StepConfig]
steps,
            (Text
"JobFlowRole" 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
jobFlowRole,
            (Text
"BootstrapActions" Text -> [BootstrapActionConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([BootstrapActionConfig] -> Pair)
-> Maybe [BootstrapActionConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [BootstrapActionConfig]
bootstrapActions,
            (Text
"ReleaseLabel" 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
releaseLabel,
            (Text
"RepoUpgradeOnBoot" Text -> RepoUpgradeOnBoot -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RepoUpgradeOnBoot -> Pair)
-> Maybe RepoUpgradeOnBoot -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RepoUpgradeOnBoot
repoUpgradeOnBoot,
            (Text
"PlacementGroupConfigs" Text -> [PlacementGroupConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlacementGroupConfig] -> Pair)
-> Maybe [PlacementGroupConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementGroupConfig]
placementGroupConfigs,
            (Text
"LogUri" 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
logUri,
            (Text
"KerberosAttributes" Text -> KerberosAttributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (KerberosAttributes -> Pair)
-> Maybe KerberosAttributes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KerberosAttributes
kerberosAttributes,
            (Text
"NewSupportedProducts" Text -> [SupportedProductConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([SupportedProductConfig] -> Pair)
-> Maybe [SupportedProductConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SupportedProductConfig]
newSupportedProducts',
            (Text
"ManagedScalingPolicy" Text -> ManagedScalingPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ManagedScalingPolicy -> Pair)
-> Maybe ManagedScalingPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ManagedScalingPolicy
managedScalingPolicy,
            (Text
"VisibleToAllUsers" 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
visibleToAllUsers,
            (Text
"SupportedProducts" 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]
supportedProducts,
            (Text
"StepConcurrencyLevel" 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
stepConcurrencyLevel,
            (Text
"Applications" Text -> [Application] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Application] -> Pair) -> Maybe [Application] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Application]
applications,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"ServiceRole" 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
serviceRole,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Instances" Text -> JobFlowInstancesConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobFlowInstancesConfig
instances)
          ]
      )

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

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

-- | The result of the RunJobFlow operation.
--
-- /See:/ 'newRunJobFlowResponse' smart constructor.
data RunJobFlowResponse = RunJobFlowResponse'
  { -- | The Amazon Resource Name (ARN) of the cluster.
    RunJobFlowResponse -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the job flow.
    RunJobFlowResponse -> Maybe Text
jobFlowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    RunJobFlowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RunJobFlowResponse -> RunJobFlowResponse -> Bool
(RunJobFlowResponse -> RunJobFlowResponse -> Bool)
-> (RunJobFlowResponse -> RunJobFlowResponse -> Bool)
-> Eq RunJobFlowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunJobFlowResponse -> RunJobFlowResponse -> Bool
$c/= :: RunJobFlowResponse -> RunJobFlowResponse -> Bool
== :: RunJobFlowResponse -> RunJobFlowResponse -> Bool
$c== :: RunJobFlowResponse -> RunJobFlowResponse -> Bool
Prelude.Eq, ReadPrec [RunJobFlowResponse]
ReadPrec RunJobFlowResponse
Int -> ReadS RunJobFlowResponse
ReadS [RunJobFlowResponse]
(Int -> ReadS RunJobFlowResponse)
-> ReadS [RunJobFlowResponse]
-> ReadPrec RunJobFlowResponse
-> ReadPrec [RunJobFlowResponse]
-> Read RunJobFlowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunJobFlowResponse]
$creadListPrec :: ReadPrec [RunJobFlowResponse]
readPrec :: ReadPrec RunJobFlowResponse
$creadPrec :: ReadPrec RunJobFlowResponse
readList :: ReadS [RunJobFlowResponse]
$creadList :: ReadS [RunJobFlowResponse]
readsPrec :: Int -> ReadS RunJobFlowResponse
$creadsPrec :: Int -> ReadS RunJobFlowResponse
Prelude.Read, Int -> RunJobFlowResponse -> ShowS
[RunJobFlowResponse] -> ShowS
RunJobFlowResponse -> String
(Int -> RunJobFlowResponse -> ShowS)
-> (RunJobFlowResponse -> String)
-> ([RunJobFlowResponse] -> ShowS)
-> Show RunJobFlowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunJobFlowResponse] -> ShowS
$cshowList :: [RunJobFlowResponse] -> ShowS
show :: RunJobFlowResponse -> String
$cshow :: RunJobFlowResponse -> String
showsPrec :: Int -> RunJobFlowResponse -> ShowS
$cshowsPrec :: Int -> RunJobFlowResponse -> ShowS
Prelude.Show, (forall x. RunJobFlowResponse -> Rep RunJobFlowResponse x)
-> (forall x. Rep RunJobFlowResponse x -> RunJobFlowResponse)
-> Generic RunJobFlowResponse
forall x. Rep RunJobFlowResponse x -> RunJobFlowResponse
forall x. RunJobFlowResponse -> Rep RunJobFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunJobFlowResponse x -> RunJobFlowResponse
$cfrom :: forall x. RunJobFlowResponse -> Rep RunJobFlowResponse x
Prelude.Generic)

-- |
-- Create a value of 'RunJobFlowResponse' 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:
--
-- 'clusterArn', 'runJobFlowResponse_clusterArn' - The Amazon Resource Name (ARN) of the cluster.
--
-- 'jobFlowId', 'runJobFlowResponse_jobFlowId' - A unique identifier for the job flow.
--
-- 'httpStatus', 'runJobFlowResponse_httpStatus' - The response's http status code.
newRunJobFlowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RunJobFlowResponse
newRunJobFlowResponse :: Int -> RunJobFlowResponse
newRunJobFlowResponse Int
pHttpStatus_ =
  RunJobFlowResponse' :: Maybe Text -> Maybe Text -> Int -> RunJobFlowResponse
RunJobFlowResponse'
    { $sel:clusterArn:RunJobFlowResponse' :: Maybe Text
clusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobFlowId:RunJobFlowResponse' :: Maybe Text
jobFlowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RunJobFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the cluster.
runJobFlowResponse_clusterArn :: Lens.Lens' RunJobFlowResponse (Prelude.Maybe Prelude.Text)
runJobFlowResponse_clusterArn :: (Maybe Text -> f (Maybe Text))
-> RunJobFlowResponse -> f RunJobFlowResponse
runJobFlowResponse_clusterArn = (RunJobFlowResponse -> Maybe Text)
-> (RunJobFlowResponse -> Maybe Text -> RunJobFlowResponse)
-> Lens
     RunJobFlowResponse RunJobFlowResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlowResponse' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:RunJobFlowResponse' :: RunJobFlowResponse -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: RunJobFlowResponse
s@RunJobFlowResponse' {} Maybe Text
a -> RunJobFlowResponse
s {$sel:clusterArn:RunJobFlowResponse' :: Maybe Text
clusterArn = Maybe Text
a} :: RunJobFlowResponse)

-- | A unique identifier for the job flow.
runJobFlowResponse_jobFlowId :: Lens.Lens' RunJobFlowResponse (Prelude.Maybe Prelude.Text)
runJobFlowResponse_jobFlowId :: (Maybe Text -> f (Maybe Text))
-> RunJobFlowResponse -> f RunJobFlowResponse
runJobFlowResponse_jobFlowId = (RunJobFlowResponse -> Maybe Text)
-> (RunJobFlowResponse -> Maybe Text -> RunJobFlowResponse)
-> Lens
     RunJobFlowResponse RunJobFlowResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunJobFlowResponse' {Maybe Text
jobFlowId :: Maybe Text
$sel:jobFlowId:RunJobFlowResponse' :: RunJobFlowResponse -> Maybe Text
jobFlowId} -> Maybe Text
jobFlowId) (\s :: RunJobFlowResponse
s@RunJobFlowResponse' {} Maybe Text
a -> RunJobFlowResponse
s {$sel:jobFlowId:RunJobFlowResponse' :: Maybe Text
jobFlowId = Maybe Text
a} :: RunJobFlowResponse)

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

instance Prelude.NFData RunJobFlowResponse