{-# 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.EC2.Types.LaunchSpecification
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.LaunchSpecification where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.BlockDeviceMapping
import Amazonka.EC2.Types.GroupIdentifier
import Amazonka.EC2.Types.IamInstanceProfileSpecification
import Amazonka.EC2.Types.InstanceNetworkInterfaceSpecification
import Amazonka.EC2.Types.InstanceType
import Amazonka.EC2.Types.RunInstancesMonitoringEnabled
import Amazonka.EC2.Types.SpotPlacement
import qualified Amazonka.Prelude as Prelude

-- | Describes the launch specification for an instance.
--
-- /See:/ 'newLaunchSpecification' smart constructor.
data LaunchSpecification = LaunchSpecification'
  { -- | Deprecated.
    LaunchSpecification -> Maybe Text
addressingType :: Prelude.Maybe Prelude.Text,
    -- | One or more block device mapping entries.
    LaunchSpecification -> Maybe [BlockDeviceMapping]
blockDeviceMappings :: Prelude.Maybe [BlockDeviceMapping],
    -- | Indicates whether the instance is optimized for EBS I\/O. This
    -- optimization provides dedicated throughput to Amazon EBS and an
    -- optimized configuration stack to provide optimal EBS I\/O performance.
    -- This optimization isn\'t available with all instance types. Additional
    -- usage charges apply when using an EBS Optimized instance.
    --
    -- Default: @false@
    LaunchSpecification -> Maybe Bool
ebsOptimized :: Prelude.Maybe Prelude.Bool,
    -- | The IAM instance profile.
    LaunchSpecification -> Maybe IamInstanceProfileSpecification
iamInstanceProfile :: Prelude.Maybe IamInstanceProfileSpecification,
    -- | The ID of the AMI.
    LaunchSpecification -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | The instance type. Only one instance type can be specified.
    LaunchSpecification -> Maybe InstanceType
instanceType :: Prelude.Maybe InstanceType,
    -- | The ID of the kernel.
    LaunchSpecification -> Maybe Text
kernelId :: Prelude.Maybe Prelude.Text,
    -- | The name of the key pair.
    LaunchSpecification -> Maybe Text
keyName :: Prelude.Maybe Prelude.Text,
    LaunchSpecification -> Maybe RunInstancesMonitoringEnabled
monitoring :: Prelude.Maybe RunInstancesMonitoringEnabled,
    -- | One or more network interfaces. If you specify a network interface, you
    -- must specify subnet IDs and security group IDs using the network
    -- interface.
    LaunchSpecification
-> Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces :: Prelude.Maybe [InstanceNetworkInterfaceSpecification],
    -- | The placement information for the instance.
    LaunchSpecification -> Maybe SpotPlacement
placement :: Prelude.Maybe SpotPlacement,
    -- | The ID of the RAM disk.
    LaunchSpecification -> Maybe Text
ramdiskId :: Prelude.Maybe Prelude.Text,
    -- | One or more security groups. When requesting instances in a VPC, you
    -- must specify the IDs of the security groups. When requesting instances
    -- in EC2-Classic, you can specify the names or the IDs of the security
    -- groups.
    LaunchSpecification -> Maybe [GroupIdentifier]
securityGroups :: Prelude.Maybe [GroupIdentifier],
    -- | The ID of the subnet in which to launch the instance.
    LaunchSpecification -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The Base64-encoded user data for the instance.
    LaunchSpecification -> Maybe Text
userData :: Prelude.Maybe Prelude.Text
  }
  deriving (LaunchSpecification -> LaunchSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchSpecification -> LaunchSpecification -> Bool
$c/= :: LaunchSpecification -> LaunchSpecification -> Bool
== :: LaunchSpecification -> LaunchSpecification -> Bool
$c== :: LaunchSpecification -> LaunchSpecification -> Bool
Prelude.Eq, ReadPrec [LaunchSpecification]
ReadPrec LaunchSpecification
Int -> ReadS LaunchSpecification
ReadS [LaunchSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchSpecification]
$creadListPrec :: ReadPrec [LaunchSpecification]
readPrec :: ReadPrec LaunchSpecification
$creadPrec :: ReadPrec LaunchSpecification
readList :: ReadS [LaunchSpecification]
$creadList :: ReadS [LaunchSpecification]
readsPrec :: Int -> ReadS LaunchSpecification
$creadsPrec :: Int -> ReadS LaunchSpecification
Prelude.Read, Int -> LaunchSpecification -> ShowS
[LaunchSpecification] -> ShowS
LaunchSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchSpecification] -> ShowS
$cshowList :: [LaunchSpecification] -> ShowS
show :: LaunchSpecification -> String
$cshow :: LaunchSpecification -> String
showsPrec :: Int -> LaunchSpecification -> ShowS
$cshowsPrec :: Int -> LaunchSpecification -> ShowS
Prelude.Show, forall x. Rep LaunchSpecification x -> LaunchSpecification
forall x. LaunchSpecification -> Rep LaunchSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchSpecification x -> LaunchSpecification
$cfrom :: forall x. LaunchSpecification -> Rep LaunchSpecification x
Prelude.Generic)

-- |
-- Create a value of 'LaunchSpecification' 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:
--
-- 'addressingType', 'launchSpecification_addressingType' - Deprecated.
--
-- 'blockDeviceMappings', 'launchSpecification_blockDeviceMappings' - One or more block device mapping entries.
--
-- 'ebsOptimized', 'launchSpecification_ebsOptimized' - Indicates whether the instance is optimized for EBS I\/O. This
-- optimization provides dedicated throughput to Amazon EBS and an
-- optimized configuration stack to provide optimal EBS I\/O performance.
-- This optimization isn\'t available with all instance types. Additional
-- usage charges apply when using an EBS Optimized instance.
--
-- Default: @false@
--
-- 'iamInstanceProfile', 'launchSpecification_iamInstanceProfile' - The IAM instance profile.
--
-- 'imageId', 'launchSpecification_imageId' - The ID of the AMI.
--
-- 'instanceType', 'launchSpecification_instanceType' - The instance type. Only one instance type can be specified.
--
-- 'kernelId', 'launchSpecification_kernelId' - The ID of the kernel.
--
-- 'keyName', 'launchSpecification_keyName' - The name of the key pair.
--
-- 'monitoring', 'launchSpecification_monitoring' - Undocumented member.
--
-- 'networkInterfaces', 'launchSpecification_networkInterfaces' - One or more network interfaces. If you specify a network interface, you
-- must specify subnet IDs and security group IDs using the network
-- interface.
--
-- 'placement', 'launchSpecification_placement' - The placement information for the instance.
--
-- 'ramdiskId', 'launchSpecification_ramdiskId' - The ID of the RAM disk.
--
-- 'securityGroups', 'launchSpecification_securityGroups' - One or more security groups. When requesting instances in a VPC, you
-- must specify the IDs of the security groups. When requesting instances
-- in EC2-Classic, you can specify the names or the IDs of the security
-- groups.
--
-- 'subnetId', 'launchSpecification_subnetId' - The ID of the subnet in which to launch the instance.
--
-- 'userData', 'launchSpecification_userData' - The Base64-encoded user data for the instance.
newLaunchSpecification ::
  LaunchSpecification
newLaunchSpecification :: LaunchSpecification
newLaunchSpecification =
  LaunchSpecification'
    { $sel:addressingType:LaunchSpecification' :: Maybe Text
addressingType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:blockDeviceMappings:LaunchSpecification' :: Maybe [BlockDeviceMapping]
blockDeviceMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:ebsOptimized:LaunchSpecification' :: Maybe Bool
ebsOptimized = forall a. Maybe a
Prelude.Nothing,
      $sel:iamInstanceProfile:LaunchSpecification' :: Maybe IamInstanceProfileSpecification
iamInstanceProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:imageId:LaunchSpecification' :: Maybe Text
imageId = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:LaunchSpecification' :: Maybe InstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:kernelId:LaunchSpecification' :: Maybe Text
kernelId = forall a. Maybe a
Prelude.Nothing,
      $sel:keyName:LaunchSpecification' :: Maybe Text
keyName = forall a. Maybe a
Prelude.Nothing,
      $sel:monitoring:LaunchSpecification' :: Maybe RunInstancesMonitoringEnabled
monitoring = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:LaunchSpecification' :: Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces = forall a. Maybe a
Prelude.Nothing,
      $sel:placement:LaunchSpecification' :: Maybe SpotPlacement
placement = forall a. Maybe a
Prelude.Nothing,
      $sel:ramdiskId:LaunchSpecification' :: Maybe Text
ramdiskId = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:LaunchSpecification' :: Maybe [GroupIdentifier]
securityGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:LaunchSpecification' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing,
      $sel:userData:LaunchSpecification' :: Maybe Text
userData = forall a. Maybe a
Prelude.Nothing
    }

-- | Deprecated.
launchSpecification_addressingType :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_addressingType :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_addressingType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
addressingType :: Maybe Text
$sel:addressingType:LaunchSpecification' :: LaunchSpecification -> Maybe Text
addressingType} -> Maybe Text
addressingType) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:addressingType:LaunchSpecification' :: Maybe Text
addressingType = Maybe Text
a} :: LaunchSpecification)

-- | One or more block device mapping entries.
launchSpecification_blockDeviceMappings :: Lens.Lens' LaunchSpecification (Prelude.Maybe [BlockDeviceMapping])
launchSpecification_blockDeviceMappings :: Lens' LaunchSpecification (Maybe [BlockDeviceMapping])
launchSpecification_blockDeviceMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe [BlockDeviceMapping]
blockDeviceMappings :: Maybe [BlockDeviceMapping]
$sel:blockDeviceMappings:LaunchSpecification' :: LaunchSpecification -> Maybe [BlockDeviceMapping]
blockDeviceMappings} -> Maybe [BlockDeviceMapping]
blockDeviceMappings) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe [BlockDeviceMapping]
a -> LaunchSpecification
s {$sel:blockDeviceMappings:LaunchSpecification' :: Maybe [BlockDeviceMapping]
blockDeviceMappings = Maybe [BlockDeviceMapping]
a} :: LaunchSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the instance is optimized for EBS I\/O. This
-- optimization provides dedicated throughput to Amazon EBS and an
-- optimized configuration stack to provide optimal EBS I\/O performance.
-- This optimization isn\'t available with all instance types. Additional
-- usage charges apply when using an EBS Optimized instance.
--
-- Default: @false@
launchSpecification_ebsOptimized :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Bool)
launchSpecification_ebsOptimized :: Lens' LaunchSpecification (Maybe Bool)
launchSpecification_ebsOptimized = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Bool
ebsOptimized :: Maybe Bool
$sel:ebsOptimized:LaunchSpecification' :: LaunchSpecification -> Maybe Bool
ebsOptimized} -> Maybe Bool
ebsOptimized) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Bool
a -> LaunchSpecification
s {$sel:ebsOptimized:LaunchSpecification' :: Maybe Bool
ebsOptimized = Maybe Bool
a} :: LaunchSpecification)

-- | The IAM instance profile.
launchSpecification_iamInstanceProfile :: Lens.Lens' LaunchSpecification (Prelude.Maybe IamInstanceProfileSpecification)
launchSpecification_iamInstanceProfile :: Lens' LaunchSpecification (Maybe IamInstanceProfileSpecification)
launchSpecification_iamInstanceProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe IamInstanceProfileSpecification
iamInstanceProfile :: Maybe IamInstanceProfileSpecification
$sel:iamInstanceProfile:LaunchSpecification' :: LaunchSpecification -> Maybe IamInstanceProfileSpecification
iamInstanceProfile} -> Maybe IamInstanceProfileSpecification
iamInstanceProfile) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe IamInstanceProfileSpecification
a -> LaunchSpecification
s {$sel:iamInstanceProfile:LaunchSpecification' :: Maybe IamInstanceProfileSpecification
iamInstanceProfile = Maybe IamInstanceProfileSpecification
a} :: LaunchSpecification)

-- | The ID of the AMI.
launchSpecification_imageId :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_imageId :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_imageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
imageId :: Maybe Text
$sel:imageId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:imageId:LaunchSpecification' :: Maybe Text
imageId = Maybe Text
a} :: LaunchSpecification)

-- | The instance type. Only one instance type can be specified.
launchSpecification_instanceType :: Lens.Lens' LaunchSpecification (Prelude.Maybe InstanceType)
launchSpecification_instanceType :: Lens' LaunchSpecification (Maybe InstanceType)
launchSpecification_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe InstanceType
instanceType :: Maybe InstanceType
$sel:instanceType:LaunchSpecification' :: LaunchSpecification -> Maybe InstanceType
instanceType} -> Maybe InstanceType
instanceType) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe InstanceType
a -> LaunchSpecification
s {$sel:instanceType:LaunchSpecification' :: Maybe InstanceType
instanceType = Maybe InstanceType
a} :: LaunchSpecification)

-- | The ID of the kernel.
launchSpecification_kernelId :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_kernelId :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_kernelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
kernelId :: Maybe Text
$sel:kernelId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
kernelId} -> Maybe Text
kernelId) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:kernelId:LaunchSpecification' :: Maybe Text
kernelId = Maybe Text
a} :: LaunchSpecification)

-- | The name of the key pair.
launchSpecification_keyName :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_keyName :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_keyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
keyName :: Maybe Text
$sel:keyName:LaunchSpecification' :: LaunchSpecification -> Maybe Text
keyName} -> Maybe Text
keyName) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:keyName:LaunchSpecification' :: Maybe Text
keyName = Maybe Text
a} :: LaunchSpecification)

-- | Undocumented member.
launchSpecification_monitoring :: Lens.Lens' LaunchSpecification (Prelude.Maybe RunInstancesMonitoringEnabled)
launchSpecification_monitoring :: Lens' LaunchSpecification (Maybe RunInstancesMonitoringEnabled)
launchSpecification_monitoring = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe RunInstancesMonitoringEnabled
monitoring :: Maybe RunInstancesMonitoringEnabled
$sel:monitoring:LaunchSpecification' :: LaunchSpecification -> Maybe RunInstancesMonitoringEnabled
monitoring} -> Maybe RunInstancesMonitoringEnabled
monitoring) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe RunInstancesMonitoringEnabled
a -> LaunchSpecification
s {$sel:monitoring:LaunchSpecification' :: Maybe RunInstancesMonitoringEnabled
monitoring = Maybe RunInstancesMonitoringEnabled
a} :: LaunchSpecification)

-- | One or more network interfaces. If you specify a network interface, you
-- must specify subnet IDs and security group IDs using the network
-- interface.
launchSpecification_networkInterfaces :: Lens.Lens' LaunchSpecification (Prelude.Maybe [InstanceNetworkInterfaceSpecification])
launchSpecification_networkInterfaces :: Lens'
  LaunchSpecification (Maybe [InstanceNetworkInterfaceSpecification])
launchSpecification_networkInterfaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces :: Maybe [InstanceNetworkInterfaceSpecification]
$sel:networkInterfaces:LaunchSpecification' :: LaunchSpecification
-> Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces} -> Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe [InstanceNetworkInterfaceSpecification]
a -> LaunchSpecification
s {$sel:networkInterfaces:LaunchSpecification' :: Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces = Maybe [InstanceNetworkInterfaceSpecification]
a} :: LaunchSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The placement information for the instance.
launchSpecification_placement :: Lens.Lens' LaunchSpecification (Prelude.Maybe SpotPlacement)
launchSpecification_placement :: Lens' LaunchSpecification (Maybe SpotPlacement)
launchSpecification_placement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe SpotPlacement
placement :: Maybe SpotPlacement
$sel:placement:LaunchSpecification' :: LaunchSpecification -> Maybe SpotPlacement
placement} -> Maybe SpotPlacement
placement) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe SpotPlacement
a -> LaunchSpecification
s {$sel:placement:LaunchSpecification' :: Maybe SpotPlacement
placement = Maybe SpotPlacement
a} :: LaunchSpecification)

-- | The ID of the RAM disk.
launchSpecification_ramdiskId :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_ramdiskId :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_ramdiskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
ramdiskId :: Maybe Text
$sel:ramdiskId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
ramdiskId} -> Maybe Text
ramdiskId) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:ramdiskId:LaunchSpecification' :: Maybe Text
ramdiskId = Maybe Text
a} :: LaunchSpecification)

-- | One or more security groups. When requesting instances in a VPC, you
-- must specify the IDs of the security groups. When requesting instances
-- in EC2-Classic, you can specify the names or the IDs of the security
-- groups.
launchSpecification_securityGroups :: Lens.Lens' LaunchSpecification (Prelude.Maybe [GroupIdentifier])
launchSpecification_securityGroups :: Lens' LaunchSpecification (Maybe [GroupIdentifier])
launchSpecification_securityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe [GroupIdentifier]
securityGroups :: Maybe [GroupIdentifier]
$sel:securityGroups:LaunchSpecification' :: LaunchSpecification -> Maybe [GroupIdentifier]
securityGroups} -> Maybe [GroupIdentifier]
securityGroups) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe [GroupIdentifier]
a -> LaunchSpecification
s {$sel:securityGroups:LaunchSpecification' :: Maybe [GroupIdentifier]
securityGroups = Maybe [GroupIdentifier]
a} :: LaunchSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the subnet in which to launch the instance.
launchSpecification_subnetId :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_subnetId :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_subnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:subnetId:LaunchSpecification' :: Maybe Text
subnetId = Maybe Text
a} :: LaunchSpecification)

-- | The Base64-encoded user data for the instance.
launchSpecification_userData :: Lens.Lens' LaunchSpecification (Prelude.Maybe Prelude.Text)
launchSpecification_userData :: Lens' LaunchSpecification (Maybe Text)
launchSpecification_userData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchSpecification' {Maybe Text
userData :: Maybe Text
$sel:userData:LaunchSpecification' :: LaunchSpecification -> Maybe Text
userData} -> Maybe Text
userData) (\s :: LaunchSpecification
s@LaunchSpecification' {} Maybe Text
a -> LaunchSpecification
s {$sel:userData:LaunchSpecification' :: Maybe Text
userData = Maybe Text
a} :: LaunchSpecification)

instance Data.FromXML LaunchSpecification where
  parseXML :: [Node] -> Either String LaunchSpecification
parseXML [Node]
x =
    Maybe Text
-> Maybe [BlockDeviceMapping]
-> Maybe Bool
-> Maybe IamInstanceProfileSpecification
-> Maybe Text
-> Maybe InstanceType
-> Maybe Text
-> Maybe Text
-> Maybe RunInstancesMonitoringEnabled
-> Maybe [InstanceNetworkInterfaceSpecification]
-> Maybe SpotPlacement
-> Maybe Text
-> Maybe [GroupIdentifier]
-> Maybe Text
-> Maybe Text
-> LaunchSpecification
LaunchSpecification'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"addressingType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"blockDeviceMapping"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ebsOptimized")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"iamInstanceProfile")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"imageId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"kernelId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"keyName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"monitoring")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"networkInterfaceSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"placement")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ramdiskId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"groupSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"subnetId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"userData")

instance Prelude.Hashable LaunchSpecification where
  hashWithSalt :: Int -> LaunchSpecification -> Int
hashWithSalt Int
_salt LaunchSpecification' {Maybe Bool
Maybe [GroupIdentifier]
Maybe [InstanceNetworkInterfaceSpecification]
Maybe [BlockDeviceMapping]
Maybe Text
Maybe IamInstanceProfileSpecification
Maybe InstanceType
Maybe RunInstancesMonitoringEnabled
Maybe SpotPlacement
userData :: Maybe Text
subnetId :: Maybe Text
securityGroups :: Maybe [GroupIdentifier]
ramdiskId :: Maybe Text
placement :: Maybe SpotPlacement
networkInterfaces :: Maybe [InstanceNetworkInterfaceSpecification]
monitoring :: Maybe RunInstancesMonitoringEnabled
keyName :: Maybe Text
kernelId :: Maybe Text
instanceType :: Maybe InstanceType
imageId :: Maybe Text
iamInstanceProfile :: Maybe IamInstanceProfileSpecification
ebsOptimized :: Maybe Bool
blockDeviceMappings :: Maybe [BlockDeviceMapping]
addressingType :: Maybe Text
$sel:userData:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:subnetId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:securityGroups:LaunchSpecification' :: LaunchSpecification -> Maybe [GroupIdentifier]
$sel:ramdiskId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:placement:LaunchSpecification' :: LaunchSpecification -> Maybe SpotPlacement
$sel:networkInterfaces:LaunchSpecification' :: LaunchSpecification
-> Maybe [InstanceNetworkInterfaceSpecification]
$sel:monitoring:LaunchSpecification' :: LaunchSpecification -> Maybe RunInstancesMonitoringEnabled
$sel:keyName:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:kernelId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:instanceType:LaunchSpecification' :: LaunchSpecification -> Maybe InstanceType
$sel:imageId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:iamInstanceProfile:LaunchSpecification' :: LaunchSpecification -> Maybe IamInstanceProfileSpecification
$sel:ebsOptimized:LaunchSpecification' :: LaunchSpecification -> Maybe Bool
$sel:blockDeviceMappings:LaunchSpecification' :: LaunchSpecification -> Maybe [BlockDeviceMapping]
$sel:addressingType:LaunchSpecification' :: LaunchSpecification -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addressingType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [BlockDeviceMapping]
blockDeviceMappings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ebsOptimized
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IamInstanceProfileSpecification
iamInstanceProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kernelId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
keyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RunInstancesMonitoringEnabled
monitoring
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpotPlacement
placement
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ramdiskId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GroupIdentifier]
securityGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userData

instance Prelude.NFData LaunchSpecification where
  rnf :: LaunchSpecification -> ()
rnf LaunchSpecification' {Maybe Bool
Maybe [GroupIdentifier]
Maybe [InstanceNetworkInterfaceSpecification]
Maybe [BlockDeviceMapping]
Maybe Text
Maybe IamInstanceProfileSpecification
Maybe InstanceType
Maybe RunInstancesMonitoringEnabled
Maybe SpotPlacement
userData :: Maybe Text
subnetId :: Maybe Text
securityGroups :: Maybe [GroupIdentifier]
ramdiskId :: Maybe Text
placement :: Maybe SpotPlacement
networkInterfaces :: Maybe [InstanceNetworkInterfaceSpecification]
monitoring :: Maybe RunInstancesMonitoringEnabled
keyName :: Maybe Text
kernelId :: Maybe Text
instanceType :: Maybe InstanceType
imageId :: Maybe Text
iamInstanceProfile :: Maybe IamInstanceProfileSpecification
ebsOptimized :: Maybe Bool
blockDeviceMappings :: Maybe [BlockDeviceMapping]
addressingType :: Maybe Text
$sel:userData:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:subnetId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:securityGroups:LaunchSpecification' :: LaunchSpecification -> Maybe [GroupIdentifier]
$sel:ramdiskId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:placement:LaunchSpecification' :: LaunchSpecification -> Maybe SpotPlacement
$sel:networkInterfaces:LaunchSpecification' :: LaunchSpecification
-> Maybe [InstanceNetworkInterfaceSpecification]
$sel:monitoring:LaunchSpecification' :: LaunchSpecification -> Maybe RunInstancesMonitoringEnabled
$sel:keyName:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:kernelId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:instanceType:LaunchSpecification' :: LaunchSpecification -> Maybe InstanceType
$sel:imageId:LaunchSpecification' :: LaunchSpecification -> Maybe Text
$sel:iamInstanceProfile:LaunchSpecification' :: LaunchSpecification -> Maybe IamInstanceProfileSpecification
$sel:ebsOptimized:LaunchSpecification' :: LaunchSpecification -> Maybe Bool
$sel:blockDeviceMappings:LaunchSpecification' :: LaunchSpecification -> Maybe [BlockDeviceMapping]
$sel:addressingType:LaunchSpecification' :: LaunchSpecification -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addressingType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [BlockDeviceMapping]
blockDeviceMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ebsOptimized
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IamInstanceProfileSpecification
iamInstanceProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kernelId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
keyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RunInstancesMonitoringEnabled
monitoring
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceNetworkInterfaceSpecification]
networkInterfaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpotPlacement
placement
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ramdiskId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GroupIdentifier]
securityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userData