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

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.Configuration
import Amazonka.EMR.Types.EbsConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An instance type configuration for each instance type in an instance
-- fleet, which determines the EC2 instances Amazon EMR attempts to
-- provision to fulfill On-Demand and Spot target capacities. When you use
-- an allocation strategy, you can include a maximum of 30 instance type
-- configurations for a fleet. For more information about how to use an
-- allocation strategy, see
-- <https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html Configure Instance Fleets>.
-- Without an allocation strategy, you may specify a maximum of five
-- instance type configurations for a fleet.
--
-- The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
--
-- /See:/ 'newInstanceTypeConfig' smart constructor.
data InstanceTypeConfig = InstanceTypeConfig'
  { -- | The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
    -- each instance as defined by @InstanceType@.
    InstanceTypeConfig -> Maybe EbsConfiguration
ebsConfiguration :: Prelude.Maybe EbsConfiguration,
    -- | The bid price for each EC2 Spot Instance type as defined by
    -- @InstanceType@. Expressed in USD. If neither @BidPrice@ nor
    -- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
    -- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
    InstanceTypeConfig -> Maybe Text
bidPrice :: Prelude.Maybe Prelude.Text,
    -- | The number of units that a provisioned instance of this type provides
    -- toward fulfilling the target capacities defined in InstanceFleetConfig.
    -- This value is 1 for a master instance fleet, and must be 1 or greater
    -- for core and task instance fleets. Defaults to 1 if not specified.
    InstanceTypeConfig -> Maybe Natural
weightedCapacity :: Prelude.Maybe Prelude.Natural,
    -- | A configuration classification that applies when provisioning cluster
    -- instances, which can include configurations for applications and
    -- software that run on the cluster.
    InstanceTypeConfig -> Maybe [Configuration]
configurations :: Prelude.Maybe [Configuration],
    -- | The custom AMI ID to use for the instance type.
    InstanceTypeConfig -> Maybe Text
customAmiId :: Prelude.Maybe Prelude.Text,
    -- | The bid price, as a percentage of On-Demand price, for each EC2 Spot
    -- Instance as defined by @InstanceType@. Expressed as a number (for
    -- example, 20 specifies 20%). If neither @BidPrice@ nor
    -- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
    -- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
    InstanceTypeConfig -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice :: Prelude.Maybe Prelude.Double,
    -- | An EC2 instance type, such as @m3.xlarge@.
    InstanceTypeConfig -> Text
instanceType :: Prelude.Text
  }
  deriving (InstanceTypeConfig -> InstanceTypeConfig -> Bool
(InstanceTypeConfig -> InstanceTypeConfig -> Bool)
-> (InstanceTypeConfig -> InstanceTypeConfig -> Bool)
-> Eq InstanceTypeConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceTypeConfig -> InstanceTypeConfig -> Bool
$c/= :: InstanceTypeConfig -> InstanceTypeConfig -> Bool
== :: InstanceTypeConfig -> InstanceTypeConfig -> Bool
$c== :: InstanceTypeConfig -> InstanceTypeConfig -> Bool
Prelude.Eq, ReadPrec [InstanceTypeConfig]
ReadPrec InstanceTypeConfig
Int -> ReadS InstanceTypeConfig
ReadS [InstanceTypeConfig]
(Int -> ReadS InstanceTypeConfig)
-> ReadS [InstanceTypeConfig]
-> ReadPrec InstanceTypeConfig
-> ReadPrec [InstanceTypeConfig]
-> Read InstanceTypeConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceTypeConfig]
$creadListPrec :: ReadPrec [InstanceTypeConfig]
readPrec :: ReadPrec InstanceTypeConfig
$creadPrec :: ReadPrec InstanceTypeConfig
readList :: ReadS [InstanceTypeConfig]
$creadList :: ReadS [InstanceTypeConfig]
readsPrec :: Int -> ReadS InstanceTypeConfig
$creadsPrec :: Int -> ReadS InstanceTypeConfig
Prelude.Read, Int -> InstanceTypeConfig -> ShowS
[InstanceTypeConfig] -> ShowS
InstanceTypeConfig -> String
(Int -> InstanceTypeConfig -> ShowS)
-> (InstanceTypeConfig -> String)
-> ([InstanceTypeConfig] -> ShowS)
-> Show InstanceTypeConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceTypeConfig] -> ShowS
$cshowList :: [InstanceTypeConfig] -> ShowS
show :: InstanceTypeConfig -> String
$cshow :: InstanceTypeConfig -> String
showsPrec :: Int -> InstanceTypeConfig -> ShowS
$cshowsPrec :: Int -> InstanceTypeConfig -> ShowS
Prelude.Show, (forall x. InstanceTypeConfig -> Rep InstanceTypeConfig x)
-> (forall x. Rep InstanceTypeConfig x -> InstanceTypeConfig)
-> Generic InstanceTypeConfig
forall x. Rep InstanceTypeConfig x -> InstanceTypeConfig
forall x. InstanceTypeConfig -> Rep InstanceTypeConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceTypeConfig x -> InstanceTypeConfig
$cfrom :: forall x. InstanceTypeConfig -> Rep InstanceTypeConfig x
Prelude.Generic)

-- |
-- Create a value of 'InstanceTypeConfig' 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:
--
-- 'ebsConfiguration', 'instanceTypeConfig_ebsConfiguration' - The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
-- each instance as defined by @InstanceType@.
--
-- 'bidPrice', 'instanceTypeConfig_bidPrice' - The bid price for each EC2 Spot Instance type as defined by
-- @InstanceType@. Expressed in USD. If neither @BidPrice@ nor
-- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
-- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
--
-- 'weightedCapacity', 'instanceTypeConfig_weightedCapacity' - The number of units that a provisioned instance of this type provides
-- toward fulfilling the target capacities defined in InstanceFleetConfig.
-- This value is 1 for a master instance fleet, and must be 1 or greater
-- for core and task instance fleets. Defaults to 1 if not specified.
--
-- 'configurations', 'instanceTypeConfig_configurations' - A configuration classification that applies when provisioning cluster
-- instances, which can include configurations for applications and
-- software that run on the cluster.
--
-- 'customAmiId', 'instanceTypeConfig_customAmiId' - The custom AMI ID to use for the instance type.
--
-- 'bidPriceAsPercentageOfOnDemandPrice', 'instanceTypeConfig_bidPriceAsPercentageOfOnDemandPrice' - The bid price, as a percentage of On-Demand price, for each EC2 Spot
-- Instance as defined by @InstanceType@. Expressed as a number (for
-- example, 20 specifies 20%). If neither @BidPrice@ nor
-- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
-- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
--
-- 'instanceType', 'instanceTypeConfig_instanceType' - An EC2 instance type, such as @m3.xlarge@.
newInstanceTypeConfig ::
  -- | 'instanceType'
  Prelude.Text ->
  InstanceTypeConfig
newInstanceTypeConfig :: Text -> InstanceTypeConfig
newInstanceTypeConfig Text
pInstanceType_ =
  InstanceTypeConfig' :: Maybe EbsConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe [Configuration]
-> Maybe Text
-> Maybe Double
-> Text
-> InstanceTypeConfig
InstanceTypeConfig'
    { $sel:ebsConfiguration:InstanceTypeConfig' :: Maybe EbsConfiguration
ebsConfiguration =
        Maybe EbsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:bidPrice:InstanceTypeConfig' :: Maybe Text
bidPrice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:weightedCapacity:InstanceTypeConfig' :: Maybe Natural
weightedCapacity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:configurations:InstanceTypeConfig' :: Maybe [Configuration]
configurations = Maybe [Configuration]
forall a. Maybe a
Prelude.Nothing,
      $sel:customAmiId:InstanceTypeConfig' :: Maybe Text
customAmiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeConfig' :: Maybe Double
bidPriceAsPercentageOfOnDemandPrice =
        Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceTypeConfig' :: Text
instanceType = Text
pInstanceType_
    }

-- | The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
-- each instance as defined by @InstanceType@.
instanceTypeConfig_ebsConfiguration :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe EbsConfiguration)
instanceTypeConfig_ebsConfiguration :: (Maybe EbsConfiguration -> f (Maybe EbsConfiguration))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_ebsConfiguration = (InstanceTypeConfig -> Maybe EbsConfiguration)
-> (InstanceTypeConfig
    -> Maybe EbsConfiguration -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig
     InstanceTypeConfig
     (Maybe EbsConfiguration)
     (Maybe EbsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe EbsConfiguration
ebsConfiguration :: Maybe EbsConfiguration
$sel:ebsConfiguration:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe EbsConfiguration
ebsConfiguration} -> Maybe EbsConfiguration
ebsConfiguration) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe EbsConfiguration
a -> InstanceTypeConfig
s {$sel:ebsConfiguration:InstanceTypeConfig' :: Maybe EbsConfiguration
ebsConfiguration = Maybe EbsConfiguration
a} :: InstanceTypeConfig)

-- | The bid price for each EC2 Spot Instance type as defined by
-- @InstanceType@. Expressed in USD. If neither @BidPrice@ nor
-- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
-- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
instanceTypeConfig_bidPrice :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe Prelude.Text)
instanceTypeConfig_bidPrice :: (Maybe Text -> f (Maybe Text))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_bidPrice = (InstanceTypeConfig -> Maybe Text)
-> (InstanceTypeConfig -> Maybe Text -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig InstanceTypeConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe Text
bidPrice :: Maybe Text
$sel:bidPrice:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Text
bidPrice} -> Maybe Text
bidPrice) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe Text
a -> InstanceTypeConfig
s {$sel:bidPrice:InstanceTypeConfig' :: Maybe Text
bidPrice = Maybe Text
a} :: InstanceTypeConfig)

-- | The number of units that a provisioned instance of this type provides
-- toward fulfilling the target capacities defined in InstanceFleetConfig.
-- This value is 1 for a master instance fleet, and must be 1 or greater
-- for core and task instance fleets. Defaults to 1 if not specified.
instanceTypeConfig_weightedCapacity :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe Prelude.Natural)
instanceTypeConfig_weightedCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_weightedCapacity = (InstanceTypeConfig -> Maybe Natural)
-> (InstanceTypeConfig -> Maybe Natural -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig
     InstanceTypeConfig
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe Natural
weightedCapacity :: Maybe Natural
$sel:weightedCapacity:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Natural
weightedCapacity} -> Maybe Natural
weightedCapacity) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe Natural
a -> InstanceTypeConfig
s {$sel:weightedCapacity:InstanceTypeConfig' :: Maybe Natural
weightedCapacity = Maybe Natural
a} :: InstanceTypeConfig)

-- | A configuration classification that applies when provisioning cluster
-- instances, which can include configurations for applications and
-- software that run on the cluster.
instanceTypeConfig_configurations :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe [Configuration])
instanceTypeConfig_configurations :: (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_configurations = (InstanceTypeConfig -> Maybe [Configuration])
-> (InstanceTypeConfig
    -> Maybe [Configuration] -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig
     InstanceTypeConfig
     (Maybe [Configuration])
     (Maybe [Configuration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe [Configuration]
configurations :: Maybe [Configuration]
$sel:configurations:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe [Configuration]
configurations} -> Maybe [Configuration]
configurations) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe [Configuration]
a -> InstanceTypeConfig
s {$sel:configurations:InstanceTypeConfig' :: Maybe [Configuration]
configurations = Maybe [Configuration]
a} :: InstanceTypeConfig) ((Maybe [Configuration] -> f (Maybe [Configuration]))
 -> InstanceTypeConfig -> f InstanceTypeConfig)
-> ((Maybe [Configuration] -> f (Maybe [Configuration]))
    -> Maybe [Configuration] -> f (Maybe [Configuration]))
-> (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceTypeConfig
-> f InstanceTypeConfig
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 instance type.
instanceTypeConfig_customAmiId :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe Prelude.Text)
instanceTypeConfig_customAmiId :: (Maybe Text -> f (Maybe Text))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_customAmiId = (InstanceTypeConfig -> Maybe Text)
-> (InstanceTypeConfig -> Maybe Text -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig InstanceTypeConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe Text
customAmiId :: Maybe Text
$sel:customAmiId:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Text
customAmiId} -> Maybe Text
customAmiId) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe Text
a -> InstanceTypeConfig
s {$sel:customAmiId:InstanceTypeConfig' :: Maybe Text
customAmiId = Maybe Text
a} :: InstanceTypeConfig)

-- | The bid price, as a percentage of On-Demand price, for each EC2 Spot
-- Instance as defined by @InstanceType@. Expressed as a number (for
-- example, 20 specifies 20%). If neither @BidPrice@ nor
-- @BidPriceAsPercentageOfOnDemandPrice@ is provided,
-- @BidPriceAsPercentageOfOnDemandPrice@ defaults to 100%.
instanceTypeConfig_bidPriceAsPercentageOfOnDemandPrice :: Lens.Lens' InstanceTypeConfig (Prelude.Maybe Prelude.Double)
instanceTypeConfig_bidPriceAsPercentageOfOnDemandPrice :: (Maybe Double -> f (Maybe Double))
-> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_bidPriceAsPercentageOfOnDemandPrice = (InstanceTypeConfig -> Maybe Double)
-> (InstanceTypeConfig -> Maybe Double -> InstanceTypeConfig)
-> Lens
     InstanceTypeConfig InstanceTypeConfig (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Maybe Double
bidPriceAsPercentageOfOnDemandPrice :: Maybe Double
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice} -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Maybe Double
a -> InstanceTypeConfig
s {$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeConfig' :: Maybe Double
bidPriceAsPercentageOfOnDemandPrice = Maybe Double
a} :: InstanceTypeConfig)

-- | An EC2 instance type, such as @m3.xlarge@.
instanceTypeConfig_instanceType :: Lens.Lens' InstanceTypeConfig Prelude.Text
instanceTypeConfig_instanceType :: (Text -> f Text) -> InstanceTypeConfig -> f InstanceTypeConfig
instanceTypeConfig_instanceType = (InstanceTypeConfig -> Text)
-> (InstanceTypeConfig -> Text -> InstanceTypeConfig)
-> Lens InstanceTypeConfig InstanceTypeConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeConfig' {Text
instanceType :: Text
$sel:instanceType:InstanceTypeConfig' :: InstanceTypeConfig -> Text
instanceType} -> Text
instanceType) (\s :: InstanceTypeConfig
s@InstanceTypeConfig' {} Text
a -> InstanceTypeConfig
s {$sel:instanceType:InstanceTypeConfig' :: Text
instanceType = Text
a} :: InstanceTypeConfig)

instance Prelude.Hashable InstanceTypeConfig

instance Prelude.NFData InstanceTypeConfig

instance Core.ToJSON InstanceTypeConfig where
  toJSON :: InstanceTypeConfig -> Value
toJSON InstanceTypeConfig' {Maybe Double
Maybe Natural
Maybe [Configuration]
Maybe Text
Maybe EbsConfiguration
Text
instanceType :: Text
bidPriceAsPercentageOfOnDemandPrice :: Maybe Double
customAmiId :: Maybe Text
configurations :: Maybe [Configuration]
weightedCapacity :: Maybe Natural
bidPrice :: Maybe Text
ebsConfiguration :: Maybe EbsConfiguration
$sel:instanceType:InstanceTypeConfig' :: InstanceTypeConfig -> Text
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Double
$sel:customAmiId:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Text
$sel:configurations:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe [Configuration]
$sel:weightedCapacity:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Natural
$sel:bidPrice:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe Text
$sel:ebsConfiguration:InstanceTypeConfig' :: InstanceTypeConfig -> Maybe EbsConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EbsConfiguration" Text -> EbsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EbsConfiguration -> Pair) -> Maybe EbsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EbsConfiguration
ebsConfiguration,
            (Text
"BidPrice" 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
bidPrice,
            (Text
"WeightedCapacity" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
weightedCapacity,
            (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
"BidPriceAsPercentageOfOnDemandPrice" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
bidPriceAsPercentageOfOnDemandPrice,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceType)
          ]
      )