{-# 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.Ec2InstanceAttributes
-- 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.Ec2InstanceAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the EC2 instances in a cluster grouped by
-- category. For example, key name, subnet ID, IAM instance profile, and so
-- on.
--
-- /See:/ 'newEc2InstanceAttributes' smart constructor.
data Ec2InstanceAttributes = Ec2InstanceAttributes'
  { -- | The name of the Amazon EC2 key pair to use when connecting with SSH into
    -- the master node as a user named \"hadoop\".
    Ec2InstanceAttributes -> Maybe Text
ec2KeyName :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon EC2 security group for the core and task
    -- nodes.
    Ec2InstanceAttributes -> Maybe Text
emrManagedSlaveSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | A list of additional Amazon EC2 security group IDs for the core and task
    -- nodes.
    Ec2InstanceAttributes -> Maybe [Text]
additionalSlaveSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | Applies to clusters configured with the instance fleets option.
    -- Specifies the unique identifier of one or more Amazon EC2 subnets in
    -- which to launch EC2 cluster instances. Subnets must exist within the
    -- same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among
    -- the list of @RequestedEc2SubnetIds@, and then launches all cluster
    -- instances within that Subnet. If this value is not specified, and the
    -- account and Region support EC2-Classic networks, the cluster launches
    -- instances in the EC2-Classic network and uses
    -- @RequestedEc2AvailabilityZones@ instead of this setting. If EC2-Classic
    -- is not supported, and no Subnet is specified, Amazon EMR chooses the
    -- subnet for you. @RequestedEc2SubnetIDs@ and
    -- @RequestedEc2AvailabilityZones@ cannot be specified together.
    Ec2InstanceAttributes -> Maybe [Text]
requestedEc2SubnetIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of additional Amazon EC2 security group IDs for the master node.
    Ec2InstanceAttributes -> Maybe [Text]
additionalMasterSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The IAM role that was specified when the cluster was launched. The EC2
    -- instances of the cluster assume this role.
    Ec2InstanceAttributes -> Maybe Text
iamInstanceProfile :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon EC2 security group for the master node.
    Ec2InstanceAttributes -> Maybe Text
emrManagedMasterSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | 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.
    Ec2InstanceAttributes -> Maybe Text
ec2SubnetId :: Prelude.Maybe Prelude.Text,
    -- | Applies to clusters configured with the instance fleets option.
    -- Specifies one or more Availability Zones in which to launch EC2 cluster
    -- instances when the EC2-Classic network configuration is supported.
    -- Amazon EMR chooses the Availability Zone with the best fit from among
    -- the list of @RequestedEc2AvailabilityZones@, and then launches all
    -- cluster instances within that Availability Zone. If you do not specify
    -- this value, Amazon EMR chooses the Availability Zone for you.
    -- @RequestedEc2SubnetIDs@ and @RequestedEc2AvailabilityZones@ cannot be
    -- specified together.
    Ec2InstanceAttributes -> Maybe [Text]
requestedEc2AvailabilityZones :: Prelude.Maybe [Prelude.Text],
    -- | The identifier of the Amazon EC2 security group for the Amazon EMR
    -- service to access clusters in VPC private subnets.
    Ec2InstanceAttributes -> Maybe Text
serviceAccessSecurityGroup :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone in which the cluster will run.
    Ec2InstanceAttributes -> Maybe Text
ec2AvailabilityZone :: Prelude.Maybe Prelude.Text
  }
  deriving (Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool
(Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool)
-> (Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool)
-> Eq Ec2InstanceAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool
$c/= :: Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool
== :: Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool
$c== :: Ec2InstanceAttributes -> Ec2InstanceAttributes -> Bool
Prelude.Eq, ReadPrec [Ec2InstanceAttributes]
ReadPrec Ec2InstanceAttributes
Int -> ReadS Ec2InstanceAttributes
ReadS [Ec2InstanceAttributes]
(Int -> ReadS Ec2InstanceAttributes)
-> ReadS [Ec2InstanceAttributes]
-> ReadPrec Ec2InstanceAttributes
-> ReadPrec [Ec2InstanceAttributes]
-> Read Ec2InstanceAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ec2InstanceAttributes]
$creadListPrec :: ReadPrec [Ec2InstanceAttributes]
readPrec :: ReadPrec Ec2InstanceAttributes
$creadPrec :: ReadPrec Ec2InstanceAttributes
readList :: ReadS [Ec2InstanceAttributes]
$creadList :: ReadS [Ec2InstanceAttributes]
readsPrec :: Int -> ReadS Ec2InstanceAttributes
$creadsPrec :: Int -> ReadS Ec2InstanceAttributes
Prelude.Read, Int -> Ec2InstanceAttributes -> ShowS
[Ec2InstanceAttributes] -> ShowS
Ec2InstanceAttributes -> String
(Int -> Ec2InstanceAttributes -> ShowS)
-> (Ec2InstanceAttributes -> String)
-> ([Ec2InstanceAttributes] -> ShowS)
-> Show Ec2InstanceAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ec2InstanceAttributes] -> ShowS
$cshowList :: [Ec2InstanceAttributes] -> ShowS
show :: Ec2InstanceAttributes -> String
$cshow :: Ec2InstanceAttributes -> String
showsPrec :: Int -> Ec2InstanceAttributes -> ShowS
$cshowsPrec :: Int -> Ec2InstanceAttributes -> ShowS
Prelude.Show, (forall x. Ec2InstanceAttributes -> Rep Ec2InstanceAttributes x)
-> (forall x. Rep Ec2InstanceAttributes x -> Ec2InstanceAttributes)
-> Generic Ec2InstanceAttributes
forall x. Rep Ec2InstanceAttributes x -> Ec2InstanceAttributes
forall x. Ec2InstanceAttributes -> Rep Ec2InstanceAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ec2InstanceAttributes x -> Ec2InstanceAttributes
$cfrom :: forall x. Ec2InstanceAttributes -> Rep Ec2InstanceAttributes x
Prelude.Generic)

-- |
-- Create a value of 'Ec2InstanceAttributes' 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:
--
-- 'ec2KeyName', 'ec2InstanceAttributes_ec2KeyName' - The name of the Amazon EC2 key pair to use when connecting with SSH into
-- the master node as a user named \"hadoop\".
--
-- 'emrManagedSlaveSecurityGroup', 'ec2InstanceAttributes_emrManagedSlaveSecurityGroup' - The identifier of the Amazon EC2 security group for the core and task
-- nodes.
--
-- 'additionalSlaveSecurityGroups', 'ec2InstanceAttributes_additionalSlaveSecurityGroups' - A list of additional Amazon EC2 security group IDs for the core and task
-- nodes.
--
-- 'requestedEc2SubnetIds', 'ec2InstanceAttributes_requestedEc2SubnetIds' - Applies to clusters configured with the instance fleets option.
-- Specifies the unique identifier of one or more Amazon EC2 subnets in
-- which to launch EC2 cluster instances. Subnets must exist within the
-- same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among
-- the list of @RequestedEc2SubnetIds@, and then launches all cluster
-- instances within that Subnet. If this value is not specified, and the
-- account and Region support EC2-Classic networks, the cluster launches
-- instances in the EC2-Classic network and uses
-- @RequestedEc2AvailabilityZones@ instead of this setting. If EC2-Classic
-- is not supported, and no Subnet is specified, Amazon EMR chooses the
-- subnet for you. @RequestedEc2SubnetIDs@ and
-- @RequestedEc2AvailabilityZones@ cannot be specified together.
--
-- 'additionalMasterSecurityGroups', 'ec2InstanceAttributes_additionalMasterSecurityGroups' - A list of additional Amazon EC2 security group IDs for the master node.
--
-- 'iamInstanceProfile', 'ec2InstanceAttributes_iamInstanceProfile' - The IAM role that was specified when the cluster was launched. The EC2
-- instances of the cluster assume this role.
--
-- 'emrManagedMasterSecurityGroup', 'ec2InstanceAttributes_emrManagedMasterSecurityGroup' - The identifier of the Amazon EC2 security group for the master node.
--
-- 'ec2SubnetId', 'ec2InstanceAttributes_ec2SubnetId' - 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.
--
-- 'requestedEc2AvailabilityZones', 'ec2InstanceAttributes_requestedEc2AvailabilityZones' - Applies to clusters configured with the instance fleets option.
-- Specifies one or more Availability Zones in which to launch EC2 cluster
-- instances when the EC2-Classic network configuration is supported.
-- Amazon EMR chooses the Availability Zone with the best fit from among
-- the list of @RequestedEc2AvailabilityZones@, and then launches all
-- cluster instances within that Availability Zone. If you do not specify
-- this value, Amazon EMR chooses the Availability Zone for you.
-- @RequestedEc2SubnetIDs@ and @RequestedEc2AvailabilityZones@ cannot be
-- specified together.
--
-- 'serviceAccessSecurityGroup', 'ec2InstanceAttributes_serviceAccessSecurityGroup' - The identifier of the Amazon EC2 security group for the Amazon EMR
-- service to access clusters in VPC private subnets.
--
-- 'ec2AvailabilityZone', 'ec2InstanceAttributes_ec2AvailabilityZone' - The Availability Zone in which the cluster will run.
newEc2InstanceAttributes ::
  Ec2InstanceAttributes
newEc2InstanceAttributes :: Ec2InstanceAttributes
newEc2InstanceAttributes =
  Ec2InstanceAttributes' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Ec2InstanceAttributes
Ec2InstanceAttributes'
    { $sel:ec2KeyName:Ec2InstanceAttributes' :: Maybe Text
ec2KeyName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:emrManagedSlaveSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
emrManagedSlaveSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalSlaveSecurityGroups:Ec2InstanceAttributes' :: Maybe [Text]
additionalSlaveSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:requestedEc2SubnetIds:Ec2InstanceAttributes' :: Maybe [Text]
requestedEc2SubnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMasterSecurityGroups:Ec2InstanceAttributes' :: Maybe [Text]
additionalMasterSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:iamInstanceProfile:Ec2InstanceAttributes' :: Maybe Text
iamInstanceProfile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:emrManagedMasterSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
emrManagedMasterSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2SubnetId:Ec2InstanceAttributes' :: Maybe Text
ec2SubnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestedEc2AvailabilityZones:Ec2InstanceAttributes' :: Maybe [Text]
requestedEc2AvailabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceAccessSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
serviceAccessSecurityGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2AvailabilityZone:Ec2InstanceAttributes' :: Maybe Text
ec2AvailabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the Amazon EC2 key pair to use when connecting with SSH into
-- the master node as a user named \"hadoop\".
ec2InstanceAttributes_ec2KeyName :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_ec2KeyName :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_ec2KeyName = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
ec2KeyName :: Maybe Text
$sel:ec2KeyName:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
ec2KeyName} -> Maybe Text
ec2KeyName) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:ec2KeyName:Ec2InstanceAttributes' :: Maybe Text
ec2KeyName = Maybe Text
a} :: Ec2InstanceAttributes)

-- | The identifier of the Amazon EC2 security group for the core and task
-- nodes.
ec2InstanceAttributes_emrManagedSlaveSecurityGroup :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_emrManagedSlaveSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_emrManagedSlaveSecurityGroup = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
emrManagedSlaveSecurityGroup :: Maybe Text
$sel:emrManagedSlaveSecurityGroup:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
emrManagedSlaveSecurityGroup} -> Maybe Text
emrManagedSlaveSecurityGroup) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:emrManagedSlaveSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
emrManagedSlaveSecurityGroup = Maybe Text
a} :: Ec2InstanceAttributes)

-- | A list of additional Amazon EC2 security group IDs for the core and task
-- nodes.
ec2InstanceAttributes_additionalSlaveSecurityGroups :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe [Prelude.Text])
ec2InstanceAttributes_additionalSlaveSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_additionalSlaveSecurityGroups = (Ec2InstanceAttributes -> Maybe [Text])
-> (Ec2InstanceAttributes -> Maybe [Text] -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe [Text]
additionalSlaveSecurityGroups :: Maybe [Text]
$sel:additionalSlaveSecurityGroups:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe [Text]
additionalSlaveSecurityGroups} -> Maybe [Text]
additionalSlaveSecurityGroups) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe [Text]
a -> Ec2InstanceAttributes
s {$sel:additionalSlaveSecurityGroups:Ec2InstanceAttributes' :: Maybe [Text]
additionalSlaveSecurityGroups = Maybe [Text]
a} :: Ec2InstanceAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> Ec2InstanceAttributes -> f Ec2InstanceAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes
-> f Ec2InstanceAttributes
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 configured with the instance fleets option.
-- Specifies the unique identifier of one or more Amazon EC2 subnets in
-- which to launch EC2 cluster instances. Subnets must exist within the
-- same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among
-- the list of @RequestedEc2SubnetIds@, and then launches all cluster
-- instances within that Subnet. If this value is not specified, and the
-- account and Region support EC2-Classic networks, the cluster launches
-- instances in the EC2-Classic network and uses
-- @RequestedEc2AvailabilityZones@ instead of this setting. If EC2-Classic
-- is not supported, and no Subnet is specified, Amazon EMR chooses the
-- subnet for you. @RequestedEc2SubnetIDs@ and
-- @RequestedEc2AvailabilityZones@ cannot be specified together.
ec2InstanceAttributes_requestedEc2SubnetIds :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe [Prelude.Text])
ec2InstanceAttributes_requestedEc2SubnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_requestedEc2SubnetIds = (Ec2InstanceAttributes -> Maybe [Text])
-> (Ec2InstanceAttributes -> Maybe [Text] -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe [Text]
requestedEc2SubnetIds :: Maybe [Text]
$sel:requestedEc2SubnetIds:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe [Text]
requestedEc2SubnetIds} -> Maybe [Text]
requestedEc2SubnetIds) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe [Text]
a -> Ec2InstanceAttributes
s {$sel:requestedEc2SubnetIds:Ec2InstanceAttributes' :: Maybe [Text]
requestedEc2SubnetIds = Maybe [Text]
a} :: Ec2InstanceAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> Ec2InstanceAttributes -> f Ec2InstanceAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes
-> f Ec2InstanceAttributes
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

-- | A list of additional Amazon EC2 security group IDs for the master node.
ec2InstanceAttributes_additionalMasterSecurityGroups :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe [Prelude.Text])
ec2InstanceAttributes_additionalMasterSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_additionalMasterSecurityGroups = (Ec2InstanceAttributes -> Maybe [Text])
-> (Ec2InstanceAttributes -> Maybe [Text] -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe [Text]
additionalMasterSecurityGroups :: Maybe [Text]
$sel:additionalMasterSecurityGroups:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe [Text]
additionalMasterSecurityGroups} -> Maybe [Text]
additionalMasterSecurityGroups) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe [Text]
a -> Ec2InstanceAttributes
s {$sel:additionalMasterSecurityGroups:Ec2InstanceAttributes' :: Maybe [Text]
additionalMasterSecurityGroups = Maybe [Text]
a} :: Ec2InstanceAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> Ec2InstanceAttributes -> f Ec2InstanceAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes
-> f Ec2InstanceAttributes
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 IAM role that was specified when the cluster was launched. The EC2
-- instances of the cluster assume this role.
ec2InstanceAttributes_iamInstanceProfile :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_iamInstanceProfile :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_iamInstanceProfile = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
iamInstanceProfile :: Maybe Text
$sel:iamInstanceProfile:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
iamInstanceProfile} -> Maybe Text
iamInstanceProfile) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:iamInstanceProfile:Ec2InstanceAttributes' :: Maybe Text
iamInstanceProfile = Maybe Text
a} :: Ec2InstanceAttributes)

-- | The identifier of the Amazon EC2 security group for the master node.
ec2InstanceAttributes_emrManagedMasterSecurityGroup :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_emrManagedMasterSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_emrManagedMasterSecurityGroup = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
emrManagedMasterSecurityGroup :: Maybe Text
$sel:emrManagedMasterSecurityGroup:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
emrManagedMasterSecurityGroup} -> Maybe Text
emrManagedMasterSecurityGroup) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:emrManagedMasterSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
emrManagedMasterSecurityGroup = Maybe Text
a} :: Ec2InstanceAttributes)

-- | 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.
ec2InstanceAttributes_ec2SubnetId :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_ec2SubnetId :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_ec2SubnetId = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
ec2SubnetId :: Maybe Text
$sel:ec2SubnetId:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
ec2SubnetId} -> Maybe Text
ec2SubnetId) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:ec2SubnetId:Ec2InstanceAttributes' :: Maybe Text
ec2SubnetId = Maybe Text
a} :: Ec2InstanceAttributes)

-- | Applies to clusters configured with the instance fleets option.
-- Specifies one or more Availability Zones in which to launch EC2 cluster
-- instances when the EC2-Classic network configuration is supported.
-- Amazon EMR chooses the Availability Zone with the best fit from among
-- the list of @RequestedEc2AvailabilityZones@, and then launches all
-- cluster instances within that Availability Zone. If you do not specify
-- this value, Amazon EMR chooses the Availability Zone for you.
-- @RequestedEc2SubnetIDs@ and @RequestedEc2AvailabilityZones@ cannot be
-- specified together.
ec2InstanceAttributes_requestedEc2AvailabilityZones :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe [Prelude.Text])
ec2InstanceAttributes_requestedEc2AvailabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_requestedEc2AvailabilityZones = (Ec2InstanceAttributes -> Maybe [Text])
-> (Ec2InstanceAttributes -> Maybe [Text] -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe [Text]
requestedEc2AvailabilityZones :: Maybe [Text]
$sel:requestedEc2AvailabilityZones:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe [Text]
requestedEc2AvailabilityZones} -> Maybe [Text]
requestedEc2AvailabilityZones) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe [Text]
a -> Ec2InstanceAttributes
s {$sel:requestedEc2AvailabilityZones:Ec2InstanceAttributes' :: Maybe [Text]
requestedEc2AvailabilityZones = Maybe [Text]
a} :: Ec2InstanceAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> Ec2InstanceAttributes -> f Ec2InstanceAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Ec2InstanceAttributes
-> f Ec2InstanceAttributes
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 Amazon EMR
-- service to access clusters in VPC private subnets.
ec2InstanceAttributes_serviceAccessSecurityGroup :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_serviceAccessSecurityGroup :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_serviceAccessSecurityGroup = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
serviceAccessSecurityGroup :: Maybe Text
$sel:serviceAccessSecurityGroup:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
serviceAccessSecurityGroup} -> Maybe Text
serviceAccessSecurityGroup) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:serviceAccessSecurityGroup:Ec2InstanceAttributes' :: Maybe Text
serviceAccessSecurityGroup = Maybe Text
a} :: Ec2InstanceAttributes)

-- | The Availability Zone in which the cluster will run.
ec2InstanceAttributes_ec2AvailabilityZone :: Lens.Lens' Ec2InstanceAttributes (Prelude.Maybe Prelude.Text)
ec2InstanceAttributes_ec2AvailabilityZone :: (Maybe Text -> f (Maybe Text))
-> Ec2InstanceAttributes -> f Ec2InstanceAttributes
ec2InstanceAttributes_ec2AvailabilityZone = (Ec2InstanceAttributes -> Maybe Text)
-> (Ec2InstanceAttributes -> Maybe Text -> Ec2InstanceAttributes)
-> Lens
     Ec2InstanceAttributes
     Ec2InstanceAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ec2InstanceAttributes' {Maybe Text
ec2AvailabilityZone :: Maybe Text
$sel:ec2AvailabilityZone:Ec2InstanceAttributes' :: Ec2InstanceAttributes -> Maybe Text
ec2AvailabilityZone} -> Maybe Text
ec2AvailabilityZone) (\s :: Ec2InstanceAttributes
s@Ec2InstanceAttributes' {} Maybe Text
a -> Ec2InstanceAttributes
s {$sel:ec2AvailabilityZone:Ec2InstanceAttributes' :: Maybe Text
ec2AvailabilityZone = Maybe Text
a} :: Ec2InstanceAttributes)

instance Core.FromJSON Ec2InstanceAttributes where
  parseJSON :: Value -> Parser Ec2InstanceAttributes
parseJSON =
    String
-> (Object -> Parser Ec2InstanceAttributes)
-> Value
-> Parser Ec2InstanceAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Ec2InstanceAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Ec2InstanceAttributes
Ec2InstanceAttributes'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Ec2KeyName")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EmrManagedSlaveSecurityGroup")
            Parser
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdditionalSlaveSecurityGroups"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestedEc2SubnetIds"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdditionalMasterSecurityGroups"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IamInstanceProfile")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EmrManagedMasterSecurityGroup")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text] -> Maybe Text -> Maybe Text -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Ec2SubnetId")
            Parser
  (Maybe [Text] -> Maybe Text -> Maybe Text -> Ec2InstanceAttributes)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestedEc2AvailabilityZones"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Maybe Text -> Ec2InstanceAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Ec2InstanceAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceAccessSecurityGroup")
            Parser (Maybe Text -> Ec2InstanceAttributes)
-> Parser (Maybe Text) -> Parser Ec2InstanceAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Ec2AvailabilityZone")
      )

instance Prelude.Hashable Ec2InstanceAttributes

instance Prelude.NFData Ec2InstanceAttributes