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

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.AutoScalingPolicyDescription
import Amazonka.EMR.Types.Configuration
import Amazonka.EMR.Types.EbsBlockDevice
import Amazonka.EMR.Types.InstanceGroupStatus
import Amazonka.EMR.Types.InstanceGroupType
import Amazonka.EMR.Types.MarketType
import Amazonka.EMR.Types.ShrinkPolicy
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This entity represents an instance group, which is a group of instances
-- that have common purpose. For example, CORE instance group is used for
-- HDFS.
--
-- /See:/ 'newInstanceGroup' smart constructor.
data InstanceGroup = InstanceGroup'
  { -- | The current status of the instance group.
    InstanceGroup -> Maybe InstanceGroupStatus
status :: Prelude.Maybe InstanceGroupStatus,
    -- | The version number of a configuration specification that was
    -- successfully applied for an instance group last time.
    InstanceGroup -> Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion :: Prelude.Maybe Prelude.Integer,
    -- | If specified, indicates that the instance group uses Spot Instances.
    -- This is the maximum price you are willing to pay for Spot Instances.
    -- Specify @OnDemandPrice@ to set the amount equal to the On-Demand price,
    -- or specify an amount in USD.
    InstanceGroup -> Maybe Text
bidPrice :: Prelude.Maybe Prelude.Text,
    -- | The target number of instances for the instance group.
    InstanceGroup -> Maybe Int
requestedInstanceCount :: Prelude.Maybe Prelude.Int,
    -- | The number of instances currently running in this instance group.
    InstanceGroup -> Maybe Int
runningInstanceCount :: Prelude.Maybe Prelude.Int,
    -- | A list of configurations that were successfully applied for an instance
    -- group last time.
    InstanceGroup -> Maybe [Configuration]
lastSuccessfullyAppliedConfigurations :: Prelude.Maybe [Configuration],
    -- | Amazon EMR releases 4.x or later.
    --
    -- The list of configurations supplied for an Amazon EMR cluster instance
    -- group. You can specify a separate configuration for each instance group
    -- (master, core, and task).
    InstanceGroup -> Maybe [Configuration]
configurations :: Prelude.Maybe [Configuration],
    -- | The custom AMI ID to use for the provisioned instance group.
    InstanceGroup -> Maybe Text
customAmiId :: Prelude.Maybe Prelude.Text,
    -- | The type of the instance group. Valid values are MASTER, CORE or TASK.
    InstanceGroup -> Maybe InstanceGroupType
instanceGroupType :: Prelude.Maybe InstanceGroupType,
    -- | The EBS block devices that are mapped to this instance group.
    InstanceGroup -> Maybe [EbsBlockDevice]
ebsBlockDevices :: Prelude.Maybe [EbsBlockDevice],
    -- | The EC2 instance type for all instances in the instance group.
    InstanceGroup -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The version number of the requested configuration specification for this
    -- instance group.
    InstanceGroup -> Maybe Integer
configurationsVersion :: Prelude.Maybe Prelude.Integer,
    -- | If the instance group is EBS-optimized. An Amazon EBS-optimized instance
    -- uses an optimized configuration stack and provides additional, dedicated
    -- capacity for Amazon EBS I\/O.
    InstanceGroup -> Maybe Bool
ebsOptimized :: Prelude.Maybe Prelude.Bool,
    -- | The marketplace to provision instances for this group. Valid values are
    -- ON_DEMAND or SPOT.
    InstanceGroup -> Maybe MarketType
market :: Prelude.Maybe MarketType,
    -- | The name of the instance group.
    InstanceGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An automatic scaling policy for a core instance group or task instance
    -- group in an Amazon EMR cluster. The automatic scaling policy defines how
    -- an instance group dynamically adds and terminates EC2 instances in
    -- response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
    InstanceGroup -> Maybe AutoScalingPolicyDescription
autoScalingPolicy :: Prelude.Maybe AutoScalingPolicyDescription,
    -- | Policy for customizing shrink operations.
    InstanceGroup -> Maybe ShrinkPolicy
shrinkPolicy :: Prelude.Maybe ShrinkPolicy,
    -- | The identifier of the instance group.
    InstanceGroup -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceGroup -> InstanceGroup -> Bool
(InstanceGroup -> InstanceGroup -> Bool)
-> (InstanceGroup -> InstanceGroup -> Bool) -> Eq InstanceGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceGroup -> InstanceGroup -> Bool
$c/= :: InstanceGroup -> InstanceGroup -> Bool
== :: InstanceGroup -> InstanceGroup -> Bool
$c== :: InstanceGroup -> InstanceGroup -> Bool
Prelude.Eq, ReadPrec [InstanceGroup]
ReadPrec InstanceGroup
Int -> ReadS InstanceGroup
ReadS [InstanceGroup]
(Int -> ReadS InstanceGroup)
-> ReadS [InstanceGroup]
-> ReadPrec InstanceGroup
-> ReadPrec [InstanceGroup]
-> Read InstanceGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceGroup]
$creadListPrec :: ReadPrec [InstanceGroup]
readPrec :: ReadPrec InstanceGroup
$creadPrec :: ReadPrec InstanceGroup
readList :: ReadS [InstanceGroup]
$creadList :: ReadS [InstanceGroup]
readsPrec :: Int -> ReadS InstanceGroup
$creadsPrec :: Int -> ReadS InstanceGroup
Prelude.Read, Int -> InstanceGroup -> ShowS
[InstanceGroup] -> ShowS
InstanceGroup -> String
(Int -> InstanceGroup -> ShowS)
-> (InstanceGroup -> String)
-> ([InstanceGroup] -> ShowS)
-> Show InstanceGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceGroup] -> ShowS
$cshowList :: [InstanceGroup] -> ShowS
show :: InstanceGroup -> String
$cshow :: InstanceGroup -> String
showsPrec :: Int -> InstanceGroup -> ShowS
$cshowsPrec :: Int -> InstanceGroup -> ShowS
Prelude.Show, (forall x. InstanceGroup -> Rep InstanceGroup x)
-> (forall x. Rep InstanceGroup x -> InstanceGroup)
-> Generic InstanceGroup
forall x. Rep InstanceGroup x -> InstanceGroup
forall x. InstanceGroup -> Rep InstanceGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceGroup x -> InstanceGroup
$cfrom :: forall x. InstanceGroup -> Rep InstanceGroup x
Prelude.Generic)

-- |
-- Create a value of 'InstanceGroup' 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:
--
-- 'status', 'instanceGroup_status' - The current status of the instance group.
--
-- 'lastSuccessfullyAppliedConfigurationsVersion', 'instanceGroup_lastSuccessfullyAppliedConfigurationsVersion' - The version number of a configuration specification that was
-- successfully applied for an instance group last time.
--
-- 'bidPrice', 'instanceGroup_bidPrice' - If specified, indicates that the instance group uses Spot Instances.
-- This is the maximum price you are willing to pay for Spot Instances.
-- Specify @OnDemandPrice@ to set the amount equal to the On-Demand price,
-- or specify an amount in USD.
--
-- 'requestedInstanceCount', 'instanceGroup_requestedInstanceCount' - The target number of instances for the instance group.
--
-- 'runningInstanceCount', 'instanceGroup_runningInstanceCount' - The number of instances currently running in this instance group.
--
-- 'lastSuccessfullyAppliedConfigurations', 'instanceGroup_lastSuccessfullyAppliedConfigurations' - A list of configurations that were successfully applied for an instance
-- group last time.
--
-- 'configurations', 'instanceGroup_configurations' - Amazon EMR releases 4.x or later.
--
-- The list of configurations supplied for an Amazon EMR cluster instance
-- group. You can specify a separate configuration for each instance group
-- (master, core, and task).
--
-- 'customAmiId', 'instanceGroup_customAmiId' - The custom AMI ID to use for the provisioned instance group.
--
-- 'instanceGroupType', 'instanceGroup_instanceGroupType' - The type of the instance group. Valid values are MASTER, CORE or TASK.
--
-- 'ebsBlockDevices', 'instanceGroup_ebsBlockDevices' - The EBS block devices that are mapped to this instance group.
--
-- 'instanceType', 'instanceGroup_instanceType' - The EC2 instance type for all instances in the instance group.
--
-- 'configurationsVersion', 'instanceGroup_configurationsVersion' - The version number of the requested configuration specification for this
-- instance group.
--
-- 'ebsOptimized', 'instanceGroup_ebsOptimized' - If the instance group is EBS-optimized. An Amazon EBS-optimized instance
-- uses an optimized configuration stack and provides additional, dedicated
-- capacity for Amazon EBS I\/O.
--
-- 'market', 'instanceGroup_market' - The marketplace to provision instances for this group. Valid values are
-- ON_DEMAND or SPOT.
--
-- 'name', 'instanceGroup_name' - The name of the instance group.
--
-- 'autoScalingPolicy', 'instanceGroup_autoScalingPolicy' - An automatic scaling policy for a core instance group or task instance
-- group in an Amazon EMR cluster. The automatic scaling policy defines how
-- an instance group dynamically adds and terminates EC2 instances in
-- response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
--
-- 'shrinkPolicy', 'instanceGroup_shrinkPolicy' - Policy for customizing shrink operations.
--
-- 'id', 'instanceGroup_id' - The identifier of the instance group.
newInstanceGroup ::
  InstanceGroup
newInstanceGroup :: InstanceGroup
newInstanceGroup =
  InstanceGroup' :: Maybe InstanceGroupStatus
-> Maybe Integer
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe [Configuration]
-> Maybe [Configuration]
-> Maybe Text
-> Maybe InstanceGroupType
-> Maybe [EbsBlockDevice]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe MarketType
-> Maybe Text
-> Maybe AutoScalingPolicyDescription
-> Maybe ShrinkPolicy
-> Maybe Text
-> InstanceGroup
InstanceGroup'
    { $sel:status:InstanceGroup' :: Maybe InstanceGroupStatus
status = Maybe InstanceGroupStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSuccessfullyAppliedConfigurationsVersion:InstanceGroup' :: Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:bidPrice:InstanceGroup' :: Maybe Text
bidPrice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestedInstanceCount:InstanceGroup' :: Maybe Int
requestedInstanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:runningInstanceCount:InstanceGroup' :: Maybe Int
runningInstanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSuccessfullyAppliedConfigurations:InstanceGroup' :: Maybe [Configuration]
lastSuccessfullyAppliedConfigurations =
        Maybe [Configuration]
forall a. Maybe a
Prelude.Nothing,
      $sel:configurations:InstanceGroup' :: Maybe [Configuration]
configurations = Maybe [Configuration]
forall a. Maybe a
Prelude.Nothing,
      $sel:customAmiId:InstanceGroup' :: Maybe Text
customAmiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceGroupType:InstanceGroup' :: Maybe InstanceGroupType
instanceGroupType = Maybe InstanceGroupType
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsBlockDevices:InstanceGroup' :: Maybe [EbsBlockDevice]
ebsBlockDevices = Maybe [EbsBlockDevice]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceGroup' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationsVersion:InstanceGroup' :: Maybe Integer
configurationsVersion = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsOptimized:InstanceGroup' :: Maybe Bool
ebsOptimized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:market:InstanceGroup' :: Maybe MarketType
market = Maybe MarketType
forall a. Maybe a
Prelude.Nothing,
      $sel:name:InstanceGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingPolicy:InstanceGroup' :: Maybe AutoScalingPolicyDescription
autoScalingPolicy = Maybe AutoScalingPolicyDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:shrinkPolicy:InstanceGroup' :: Maybe ShrinkPolicy
shrinkPolicy = Maybe ShrinkPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:id:InstanceGroup' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the instance group.
instanceGroup_status :: Lens.Lens' InstanceGroup (Prelude.Maybe InstanceGroupStatus)
instanceGroup_status :: (Maybe InstanceGroupStatus -> f (Maybe InstanceGroupStatus))
-> InstanceGroup -> f InstanceGroup
instanceGroup_status = (InstanceGroup -> Maybe InstanceGroupStatus)
-> (InstanceGroup -> Maybe InstanceGroupStatus -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe InstanceGroupStatus)
     (Maybe InstanceGroupStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe InstanceGroupStatus
status :: Maybe InstanceGroupStatus
$sel:status:InstanceGroup' :: InstanceGroup -> Maybe InstanceGroupStatus
status} -> Maybe InstanceGroupStatus
status) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe InstanceGroupStatus
a -> InstanceGroup
s {$sel:status:InstanceGroup' :: Maybe InstanceGroupStatus
status = Maybe InstanceGroupStatus
a} :: InstanceGroup)

-- | The version number of a configuration specification that was
-- successfully applied for an instance group last time.
instanceGroup_lastSuccessfullyAppliedConfigurationsVersion :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Integer)
instanceGroup_lastSuccessfullyAppliedConfigurationsVersion :: (Maybe Integer -> f (Maybe Integer))
-> InstanceGroup -> f InstanceGroup
instanceGroup_lastSuccessfullyAppliedConfigurationsVersion = (InstanceGroup -> Maybe Integer)
-> (InstanceGroup -> Maybe Integer -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion :: Maybe Integer
$sel:lastSuccessfullyAppliedConfigurationsVersion:InstanceGroup' :: InstanceGroup -> Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion} -> Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Integer
a -> InstanceGroup
s {$sel:lastSuccessfullyAppliedConfigurationsVersion:InstanceGroup' :: Maybe Integer
lastSuccessfullyAppliedConfigurationsVersion = Maybe Integer
a} :: InstanceGroup)

-- | If specified, indicates that the instance group uses Spot Instances.
-- This is the maximum price you are willing to pay for Spot Instances.
-- Specify @OnDemandPrice@ to set the amount equal to the On-Demand price,
-- or specify an amount in USD.
instanceGroup_bidPrice :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Text)
instanceGroup_bidPrice :: (Maybe Text -> f (Maybe Text)) -> InstanceGroup -> f InstanceGroup
instanceGroup_bidPrice = (InstanceGroup -> Maybe Text)
-> (InstanceGroup -> Maybe Text -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Text
bidPrice :: Maybe Text
$sel:bidPrice:InstanceGroup' :: InstanceGroup -> Maybe Text
bidPrice} -> Maybe Text
bidPrice) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Text
a -> InstanceGroup
s {$sel:bidPrice:InstanceGroup' :: Maybe Text
bidPrice = Maybe Text
a} :: InstanceGroup)

-- | The target number of instances for the instance group.
instanceGroup_requestedInstanceCount :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Int)
instanceGroup_requestedInstanceCount :: (Maybe Int -> f (Maybe Int)) -> InstanceGroup -> f InstanceGroup
instanceGroup_requestedInstanceCount = (InstanceGroup -> Maybe Int)
-> (InstanceGroup -> Maybe Int -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Int
requestedInstanceCount :: Maybe Int
$sel:requestedInstanceCount:InstanceGroup' :: InstanceGroup -> Maybe Int
requestedInstanceCount} -> Maybe Int
requestedInstanceCount) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Int
a -> InstanceGroup
s {$sel:requestedInstanceCount:InstanceGroup' :: Maybe Int
requestedInstanceCount = Maybe Int
a} :: InstanceGroup)

-- | The number of instances currently running in this instance group.
instanceGroup_runningInstanceCount :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Int)
instanceGroup_runningInstanceCount :: (Maybe Int -> f (Maybe Int)) -> InstanceGroup -> f InstanceGroup
instanceGroup_runningInstanceCount = (InstanceGroup -> Maybe Int)
-> (InstanceGroup -> Maybe Int -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Int
runningInstanceCount :: Maybe Int
$sel:runningInstanceCount:InstanceGroup' :: InstanceGroup -> Maybe Int
runningInstanceCount} -> Maybe Int
runningInstanceCount) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Int
a -> InstanceGroup
s {$sel:runningInstanceCount:InstanceGroup' :: Maybe Int
runningInstanceCount = Maybe Int
a} :: InstanceGroup)

-- | A list of configurations that were successfully applied for an instance
-- group last time.
instanceGroup_lastSuccessfullyAppliedConfigurations :: Lens.Lens' InstanceGroup (Prelude.Maybe [Configuration])
instanceGroup_lastSuccessfullyAppliedConfigurations :: (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceGroup -> f InstanceGroup
instanceGroup_lastSuccessfullyAppliedConfigurations = (InstanceGroup -> Maybe [Configuration])
-> (InstanceGroup -> Maybe [Configuration] -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe [Configuration])
     (Maybe [Configuration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe [Configuration]
lastSuccessfullyAppliedConfigurations :: Maybe [Configuration]
$sel:lastSuccessfullyAppliedConfigurations:InstanceGroup' :: InstanceGroup -> Maybe [Configuration]
lastSuccessfullyAppliedConfigurations} -> Maybe [Configuration]
lastSuccessfullyAppliedConfigurations) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe [Configuration]
a -> InstanceGroup
s {$sel:lastSuccessfullyAppliedConfigurations:InstanceGroup' :: Maybe [Configuration]
lastSuccessfullyAppliedConfigurations = Maybe [Configuration]
a} :: InstanceGroup) ((Maybe [Configuration] -> f (Maybe [Configuration]))
 -> InstanceGroup -> f InstanceGroup)
-> ((Maybe [Configuration] -> f (Maybe [Configuration]))
    -> Maybe [Configuration] -> f (Maybe [Configuration]))
-> (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceGroup
-> f InstanceGroup
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

-- | Amazon EMR releases 4.x or later.
--
-- The list of configurations supplied for an Amazon EMR cluster instance
-- group. You can specify a separate configuration for each instance group
-- (master, core, and task).
instanceGroup_configurations :: Lens.Lens' InstanceGroup (Prelude.Maybe [Configuration])
instanceGroup_configurations :: (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceGroup -> f InstanceGroup
instanceGroup_configurations = (InstanceGroup -> Maybe [Configuration])
-> (InstanceGroup -> Maybe [Configuration] -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe [Configuration])
     (Maybe [Configuration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe [Configuration]
configurations :: Maybe [Configuration]
$sel:configurations:InstanceGroup' :: InstanceGroup -> Maybe [Configuration]
configurations} -> Maybe [Configuration]
configurations) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe [Configuration]
a -> InstanceGroup
s {$sel:configurations:InstanceGroup' :: Maybe [Configuration]
configurations = Maybe [Configuration]
a} :: InstanceGroup) ((Maybe [Configuration] -> f (Maybe [Configuration]))
 -> InstanceGroup -> f InstanceGroup)
-> ((Maybe [Configuration] -> f (Maybe [Configuration]))
    -> Maybe [Configuration] -> f (Maybe [Configuration]))
-> (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceGroup
-> f InstanceGroup
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

-- | The custom AMI ID to use for the provisioned instance group.
instanceGroup_customAmiId :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Text)
instanceGroup_customAmiId :: (Maybe Text -> f (Maybe Text)) -> InstanceGroup -> f InstanceGroup
instanceGroup_customAmiId = (InstanceGroup -> Maybe Text)
-> (InstanceGroup -> Maybe Text -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Text
customAmiId :: Maybe Text
$sel:customAmiId:InstanceGroup' :: InstanceGroup -> Maybe Text
customAmiId} -> Maybe Text
customAmiId) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Text
a -> InstanceGroup
s {$sel:customAmiId:InstanceGroup' :: Maybe Text
customAmiId = Maybe Text
a} :: InstanceGroup)

-- | The type of the instance group. Valid values are MASTER, CORE or TASK.
instanceGroup_instanceGroupType :: Lens.Lens' InstanceGroup (Prelude.Maybe InstanceGroupType)
instanceGroup_instanceGroupType :: (Maybe InstanceGroupType -> f (Maybe InstanceGroupType))
-> InstanceGroup -> f InstanceGroup
instanceGroup_instanceGroupType = (InstanceGroup -> Maybe InstanceGroupType)
-> (InstanceGroup -> Maybe InstanceGroupType -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe InstanceGroupType)
     (Maybe InstanceGroupType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe InstanceGroupType
instanceGroupType :: Maybe InstanceGroupType
$sel:instanceGroupType:InstanceGroup' :: InstanceGroup -> Maybe InstanceGroupType
instanceGroupType} -> Maybe InstanceGroupType
instanceGroupType) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe InstanceGroupType
a -> InstanceGroup
s {$sel:instanceGroupType:InstanceGroup' :: Maybe InstanceGroupType
instanceGroupType = Maybe InstanceGroupType
a} :: InstanceGroup)

-- | The EBS block devices that are mapped to this instance group.
instanceGroup_ebsBlockDevices :: Lens.Lens' InstanceGroup (Prelude.Maybe [EbsBlockDevice])
instanceGroup_ebsBlockDevices :: (Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> InstanceGroup -> f InstanceGroup
instanceGroup_ebsBlockDevices = (InstanceGroup -> Maybe [EbsBlockDevice])
-> (InstanceGroup -> Maybe [EbsBlockDevice] -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe [EbsBlockDevice]
ebsBlockDevices :: Maybe [EbsBlockDevice]
$sel:ebsBlockDevices:InstanceGroup' :: InstanceGroup -> Maybe [EbsBlockDevice]
ebsBlockDevices} -> Maybe [EbsBlockDevice]
ebsBlockDevices) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe [EbsBlockDevice]
a -> InstanceGroup
s {$sel:ebsBlockDevices:InstanceGroup' :: Maybe [EbsBlockDevice]
ebsBlockDevices = Maybe [EbsBlockDevice]
a} :: InstanceGroup) ((Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
 -> InstanceGroup -> f InstanceGroup)
-> ((Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
    -> Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> (Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> InstanceGroup
-> f InstanceGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice]
-> Iso
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
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
  [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The EC2 instance type for all instances in the instance group.
instanceGroup_instanceType :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Text)
instanceGroup_instanceType :: (Maybe Text -> f (Maybe Text)) -> InstanceGroup -> f InstanceGroup
instanceGroup_instanceType = (InstanceGroup -> Maybe Text)
-> (InstanceGroup -> Maybe Text -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:InstanceGroup' :: InstanceGroup -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Text
a -> InstanceGroup
s {$sel:instanceType:InstanceGroup' :: Maybe Text
instanceType = Maybe Text
a} :: InstanceGroup)

-- | The version number of the requested configuration specification for this
-- instance group.
instanceGroup_configurationsVersion :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Integer)
instanceGroup_configurationsVersion :: (Maybe Integer -> f (Maybe Integer))
-> InstanceGroup -> f InstanceGroup
instanceGroup_configurationsVersion = (InstanceGroup -> Maybe Integer)
-> (InstanceGroup -> Maybe Integer -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Integer
configurationsVersion :: Maybe Integer
$sel:configurationsVersion:InstanceGroup' :: InstanceGroup -> Maybe Integer
configurationsVersion} -> Maybe Integer
configurationsVersion) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Integer
a -> InstanceGroup
s {$sel:configurationsVersion:InstanceGroup' :: Maybe Integer
configurationsVersion = Maybe Integer
a} :: InstanceGroup)

-- | If the instance group is EBS-optimized. An Amazon EBS-optimized instance
-- uses an optimized configuration stack and provides additional, dedicated
-- capacity for Amazon EBS I\/O.
instanceGroup_ebsOptimized :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Bool)
instanceGroup_ebsOptimized :: (Maybe Bool -> f (Maybe Bool)) -> InstanceGroup -> f InstanceGroup
instanceGroup_ebsOptimized = (InstanceGroup -> Maybe Bool)
-> (InstanceGroup -> Maybe Bool -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Bool
ebsOptimized :: Maybe Bool
$sel:ebsOptimized:InstanceGroup' :: InstanceGroup -> Maybe Bool
ebsOptimized} -> Maybe Bool
ebsOptimized) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Bool
a -> InstanceGroup
s {$sel:ebsOptimized:InstanceGroup' :: Maybe Bool
ebsOptimized = Maybe Bool
a} :: InstanceGroup)

-- | The marketplace to provision instances for this group. Valid values are
-- ON_DEMAND or SPOT.
instanceGroup_market :: Lens.Lens' InstanceGroup (Prelude.Maybe MarketType)
instanceGroup_market :: (Maybe MarketType -> f (Maybe MarketType))
-> InstanceGroup -> f InstanceGroup
instanceGroup_market = (InstanceGroup -> Maybe MarketType)
-> (InstanceGroup -> Maybe MarketType -> InstanceGroup)
-> Lens
     InstanceGroup InstanceGroup (Maybe MarketType) (Maybe MarketType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe MarketType
market :: Maybe MarketType
$sel:market:InstanceGroup' :: InstanceGroup -> Maybe MarketType
market} -> Maybe MarketType
market) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe MarketType
a -> InstanceGroup
s {$sel:market:InstanceGroup' :: Maybe MarketType
market = Maybe MarketType
a} :: InstanceGroup)

-- | The name of the instance group.
instanceGroup_name :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Text)
instanceGroup_name :: (Maybe Text -> f (Maybe Text)) -> InstanceGroup -> f InstanceGroup
instanceGroup_name = (InstanceGroup -> Maybe Text)
-> (InstanceGroup -> Maybe Text -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Text
name :: Maybe Text
$sel:name:InstanceGroup' :: InstanceGroup -> Maybe Text
name} -> Maybe Text
name) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Text
a -> InstanceGroup
s {$sel:name:InstanceGroup' :: Maybe Text
name = Maybe Text
a} :: InstanceGroup)

-- | An automatic scaling policy for a core instance group or task instance
-- group in an Amazon EMR cluster. The automatic scaling policy defines how
-- an instance group dynamically adds and terminates EC2 instances in
-- response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
instanceGroup_autoScalingPolicy :: Lens.Lens' InstanceGroup (Prelude.Maybe AutoScalingPolicyDescription)
instanceGroup_autoScalingPolicy :: (Maybe AutoScalingPolicyDescription
 -> f (Maybe AutoScalingPolicyDescription))
-> InstanceGroup -> f InstanceGroup
instanceGroup_autoScalingPolicy = (InstanceGroup -> Maybe AutoScalingPolicyDescription)
-> (InstanceGroup
    -> Maybe AutoScalingPolicyDescription -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe AutoScalingPolicyDescription)
     (Maybe AutoScalingPolicyDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe AutoScalingPolicyDescription
autoScalingPolicy :: Maybe AutoScalingPolicyDescription
$sel:autoScalingPolicy:InstanceGroup' :: InstanceGroup -> Maybe AutoScalingPolicyDescription
autoScalingPolicy} -> Maybe AutoScalingPolicyDescription
autoScalingPolicy) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe AutoScalingPolicyDescription
a -> InstanceGroup
s {$sel:autoScalingPolicy:InstanceGroup' :: Maybe AutoScalingPolicyDescription
autoScalingPolicy = Maybe AutoScalingPolicyDescription
a} :: InstanceGroup)

-- | Policy for customizing shrink operations.
instanceGroup_shrinkPolicy :: Lens.Lens' InstanceGroup (Prelude.Maybe ShrinkPolicy)
instanceGroup_shrinkPolicy :: (Maybe ShrinkPolicy -> f (Maybe ShrinkPolicy))
-> InstanceGroup -> f InstanceGroup
instanceGroup_shrinkPolicy = (InstanceGroup -> Maybe ShrinkPolicy)
-> (InstanceGroup -> Maybe ShrinkPolicy -> InstanceGroup)
-> Lens
     InstanceGroup
     InstanceGroup
     (Maybe ShrinkPolicy)
     (Maybe ShrinkPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe ShrinkPolicy
shrinkPolicy :: Maybe ShrinkPolicy
$sel:shrinkPolicy:InstanceGroup' :: InstanceGroup -> Maybe ShrinkPolicy
shrinkPolicy} -> Maybe ShrinkPolicy
shrinkPolicy) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe ShrinkPolicy
a -> InstanceGroup
s {$sel:shrinkPolicy:InstanceGroup' :: Maybe ShrinkPolicy
shrinkPolicy = Maybe ShrinkPolicy
a} :: InstanceGroup)

-- | The identifier of the instance group.
instanceGroup_id :: Lens.Lens' InstanceGroup (Prelude.Maybe Prelude.Text)
instanceGroup_id :: (Maybe Text -> f (Maybe Text)) -> InstanceGroup -> f InstanceGroup
instanceGroup_id = (InstanceGroup -> Maybe Text)
-> (InstanceGroup -> Maybe Text -> InstanceGroup)
-> Lens InstanceGroup InstanceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceGroup' {Maybe Text
id :: Maybe Text
$sel:id:InstanceGroup' :: InstanceGroup -> Maybe Text
id} -> Maybe Text
id) (\s :: InstanceGroup
s@InstanceGroup' {} Maybe Text
a -> InstanceGroup
s {$sel:id:InstanceGroup' :: Maybe Text
id = Maybe Text
a} :: InstanceGroup)

instance Core.FromJSON InstanceGroup where
  parseJSON :: Value -> Parser InstanceGroup
parseJSON =
    String
-> (Object -> Parser InstanceGroup)
-> Value
-> Parser InstanceGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceGroup"
      ( \Object
x ->
          Maybe InstanceGroupStatus
-> Maybe Integer
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe [Configuration]
-> Maybe [Configuration]
-> Maybe Text
-> Maybe InstanceGroupType
-> Maybe [EbsBlockDevice]
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe MarketType
-> Maybe Text
-> Maybe AutoScalingPolicyDescription
-> Maybe ShrinkPolicy
-> Maybe Text
-> InstanceGroup
InstanceGroup'
            (Maybe InstanceGroupStatus
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe [Configuration]
 -> Maybe [Configuration]
 -> Maybe Text
 -> Maybe InstanceGroupType
 -> Maybe [EbsBlockDevice]
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Bool
 -> Maybe MarketType
 -> Maybe Text
 -> Maybe AutoScalingPolicyDescription
 -> Maybe ShrinkPolicy
 -> Maybe Text
 -> InstanceGroup)
-> Parser (Maybe InstanceGroupStatus)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [Configuration]
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InstanceGroupStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe [Configuration]
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [Configuration]
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastSuccessfullyAppliedConfigurationsVersion"
                        )
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe [Configuration]
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe [Configuration]
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
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
"BidPrice")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe [Configuration]
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe [Configuration]
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestedInstanceCount")
            Parser
  (Maybe Int
   -> Maybe [Configuration]
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Configuration]
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RunningInstanceCount")
            Parser
  (Maybe [Configuration]
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe [Configuration])
-> Parser
     (Maybe [Configuration]
      -> Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Configuration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastSuccessfullyAppliedConfigurations"
                            Parser (Maybe (Maybe [Configuration]))
-> Maybe [Configuration] -> Parser (Maybe [Configuration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Configuration]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Configuration]
   -> Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe [Configuration])
-> Parser
     (Maybe Text
      -> Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Configuration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configurations" Parser (Maybe (Maybe [Configuration]))
-> Maybe [Configuration] -> Parser (Maybe [Configuration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Configuration]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe InstanceGroupType
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
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
"CustomAmiId")
            Parser
  (Maybe InstanceGroupType
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe InstanceGroupType)
-> Parser
     (Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceGroupType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceGroupType")
            Parser
  (Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe [EbsBlockDevice])
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [EbsBlockDevice]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EbsBlockDevices"
                            Parser (Maybe (Maybe [EbsBlockDevice]))
-> Maybe [EbsBlockDevice] -> Parser (Maybe [EbsBlockDevice])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EbsBlockDevice]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
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
"InstanceType")
            Parser
  (Maybe Integer
   -> Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Bool
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConfigurationsVersion")
            Parser
  (Maybe Bool
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Bool)
-> Parser
     (Maybe MarketType
      -> Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EbsOptimized")
            Parser
  (Maybe MarketType
   -> Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe MarketType)
-> Parser
     (Maybe Text
      -> Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy
      -> Maybe Text
      -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MarketType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Market")
            Parser
  (Maybe Text
   -> Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy
   -> Maybe Text
   -> InstanceGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe AutoScalingPolicyDescription
      -> Maybe ShrinkPolicy -> Maybe Text -> InstanceGroup)
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
"Name")
            Parser
  (Maybe AutoScalingPolicyDescription
   -> Maybe ShrinkPolicy -> Maybe Text -> InstanceGroup)
-> Parser (Maybe AutoScalingPolicyDescription)
-> Parser (Maybe ShrinkPolicy -> Maybe Text -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoScalingPolicyDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoScalingPolicy")
            Parser (Maybe ShrinkPolicy -> Maybe Text -> InstanceGroup)
-> Parser (Maybe ShrinkPolicy)
-> Parser (Maybe Text -> InstanceGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ShrinkPolicy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShrinkPolicy")
            Parser (Maybe Text -> InstanceGroup)
-> Parser (Maybe Text) -> Parser InstanceGroup
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
"Id")
      )

instance Prelude.Hashable InstanceGroup

instance Prelude.NFData InstanceGroup