{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.OpsWorks.CreateInstance
(
CreateInstance (..),
newCreateInstance,
createInstance_installUpdatesOnBoot,
createInstance_virtualizationType,
createInstance_hostname,
createInstance_sshKeyName,
createInstance_agentVersion,
createInstance_subnetId,
createInstance_ebsOptimized,
createInstance_os,
createInstance_availabilityZone,
createInstance_tenancy,
createInstance_autoScalingType,
createInstance_architecture,
createInstance_amiId,
createInstance_rootDeviceType,
createInstance_blockDeviceMappings,
createInstance_stackId,
createInstance_layerIds,
createInstance_instanceType,
CreateInstanceResponse (..),
newCreateInstanceResponse,
createInstanceResponse_instanceId,
createInstanceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateInstance = CreateInstance'
{
CreateInstance -> Maybe Bool
installUpdatesOnBoot :: Prelude.Maybe Prelude.Bool,
CreateInstance -> Maybe Text
virtualizationType :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
sshKeyName :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
agentVersion :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Bool
ebsOptimized :: Prelude.Maybe Prelude.Bool,
CreateInstance -> Maybe Text
os :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe Text
tenancy :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe AutoScalingType
autoScalingType :: Prelude.Maybe AutoScalingType,
CreateInstance -> Maybe Architecture
architecture :: Prelude.Maybe Architecture,
CreateInstance -> Maybe Text
amiId :: Prelude.Maybe Prelude.Text,
CreateInstance -> Maybe RootDeviceType
rootDeviceType :: Prelude.Maybe RootDeviceType,
CreateInstance -> Maybe [BlockDeviceMapping]
blockDeviceMappings :: Prelude.Maybe [BlockDeviceMapping],
CreateInstance -> Text
stackId :: Prelude.Text,
CreateInstance -> [Text]
layerIds :: [Prelude.Text],
CreateInstance -> Text
instanceType :: Prelude.Text
}
deriving (CreateInstance -> CreateInstance -> Bool
(CreateInstance -> CreateInstance -> Bool)
-> (CreateInstance -> CreateInstance -> Bool) -> Eq CreateInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstance -> CreateInstance -> Bool
$c/= :: CreateInstance -> CreateInstance -> Bool
== :: CreateInstance -> CreateInstance -> Bool
$c== :: CreateInstance -> CreateInstance -> Bool
Prelude.Eq, ReadPrec [CreateInstance]
ReadPrec CreateInstance
Int -> ReadS CreateInstance
ReadS [CreateInstance]
(Int -> ReadS CreateInstance)
-> ReadS [CreateInstance]
-> ReadPrec CreateInstance
-> ReadPrec [CreateInstance]
-> Read CreateInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstance]
$creadListPrec :: ReadPrec [CreateInstance]
readPrec :: ReadPrec CreateInstance
$creadPrec :: ReadPrec CreateInstance
readList :: ReadS [CreateInstance]
$creadList :: ReadS [CreateInstance]
readsPrec :: Int -> ReadS CreateInstance
$creadsPrec :: Int -> ReadS CreateInstance
Prelude.Read, Int -> CreateInstance -> ShowS
[CreateInstance] -> ShowS
CreateInstance -> String
(Int -> CreateInstance -> ShowS)
-> (CreateInstance -> String)
-> ([CreateInstance] -> ShowS)
-> Show CreateInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstance] -> ShowS
$cshowList :: [CreateInstance] -> ShowS
show :: CreateInstance -> String
$cshow :: CreateInstance -> String
showsPrec :: Int -> CreateInstance -> ShowS
$cshowsPrec :: Int -> CreateInstance -> ShowS
Prelude.Show, (forall x. CreateInstance -> Rep CreateInstance x)
-> (forall x. Rep CreateInstance x -> CreateInstance)
-> Generic CreateInstance
forall x. Rep CreateInstance x -> CreateInstance
forall x. CreateInstance -> Rep CreateInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstance x -> CreateInstance
$cfrom :: forall x. CreateInstance -> Rep CreateInstance x
Prelude.Generic)
newCreateInstance ::
Prelude.Text ->
Prelude.Text ->
CreateInstance
newCreateInstance :: Text -> Text -> CreateInstance
newCreateInstance Text
pStackId_ Text
pInstanceType_ =
CreateInstance' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AutoScalingType
-> Maybe Architecture
-> Maybe Text
-> Maybe RootDeviceType
-> Maybe [BlockDeviceMapping]
-> Text
-> [Text]
-> Text
-> CreateInstance
CreateInstance'
{ $sel:installUpdatesOnBoot:CreateInstance' :: Maybe Bool
installUpdatesOnBoot =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:virtualizationType:CreateInstance' :: Maybe Text
virtualizationType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hostname:CreateInstance' :: Maybe Text
hostname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sshKeyName:CreateInstance' :: Maybe Text
sshKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentVersion:CreateInstance' :: Maybe Text
agentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subnetId:CreateInstance' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ebsOptimized:CreateInstance' :: Maybe Bool
ebsOptimized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:os:CreateInstance' :: Maybe Text
os = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:CreateInstance' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tenancy:CreateInstance' :: Maybe Text
tenancy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingType:CreateInstance' :: Maybe AutoScalingType
autoScalingType = Maybe AutoScalingType
forall a. Maybe a
Prelude.Nothing,
$sel:architecture:CreateInstance' :: Maybe Architecture
architecture = Maybe Architecture
forall a. Maybe a
Prelude.Nothing,
$sel:amiId:CreateInstance' :: Maybe Text
amiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:rootDeviceType:CreateInstance' :: Maybe RootDeviceType
rootDeviceType = Maybe RootDeviceType
forall a. Maybe a
Prelude.Nothing,
$sel:blockDeviceMappings:CreateInstance' :: Maybe [BlockDeviceMapping]
blockDeviceMappings = Maybe [BlockDeviceMapping]
forall a. Maybe a
Prelude.Nothing,
$sel:stackId:CreateInstance' :: Text
stackId = Text
pStackId_,
$sel:layerIds:CreateInstance' :: [Text]
layerIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:instanceType:CreateInstance' :: Text
instanceType = Text
pInstanceType_
}
createInstance_installUpdatesOnBoot :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Bool)
createInstance_installUpdatesOnBoot :: (Maybe Bool -> f (Maybe Bool))
-> CreateInstance -> f CreateInstance
createInstance_installUpdatesOnBoot = (CreateInstance -> Maybe Bool)
-> (CreateInstance -> Maybe Bool -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Bool
installUpdatesOnBoot :: Maybe Bool
$sel:installUpdatesOnBoot:CreateInstance' :: CreateInstance -> Maybe Bool
installUpdatesOnBoot} -> Maybe Bool
installUpdatesOnBoot) (\s :: CreateInstance
s@CreateInstance' {} Maybe Bool
a -> CreateInstance
s {$sel:installUpdatesOnBoot:CreateInstance' :: Maybe Bool
installUpdatesOnBoot = Maybe Bool
a} :: CreateInstance)
createInstance_virtualizationType :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_virtualizationType :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_virtualizationType = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
virtualizationType :: Maybe Text
$sel:virtualizationType:CreateInstance' :: CreateInstance -> Maybe Text
virtualizationType} -> Maybe Text
virtualizationType) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:virtualizationType:CreateInstance' :: Maybe Text
virtualizationType = Maybe Text
a} :: CreateInstance)
createInstance_hostname :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_hostname :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_hostname = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
hostname :: Maybe Text
$sel:hostname:CreateInstance' :: CreateInstance -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:hostname:CreateInstance' :: Maybe Text
hostname = Maybe Text
a} :: CreateInstance)
createInstance_sshKeyName :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_sshKeyName :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_sshKeyName = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
sshKeyName :: Maybe Text
$sel:sshKeyName:CreateInstance' :: CreateInstance -> Maybe Text
sshKeyName} -> Maybe Text
sshKeyName) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:sshKeyName:CreateInstance' :: Maybe Text
sshKeyName = Maybe Text
a} :: CreateInstance)
createInstance_agentVersion :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_agentVersion :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_agentVersion = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:CreateInstance' :: CreateInstance -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:agentVersion:CreateInstance' :: Maybe Text
agentVersion = Maybe Text
a} :: CreateInstance)
createInstance_subnetId :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_subnetId :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_subnetId = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:CreateInstance' :: CreateInstance -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:subnetId:CreateInstance' :: Maybe Text
subnetId = Maybe Text
a} :: CreateInstance)
createInstance_ebsOptimized :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Bool)
createInstance_ebsOptimized :: (Maybe Bool -> f (Maybe Bool))
-> CreateInstance -> f CreateInstance
createInstance_ebsOptimized = (CreateInstance -> Maybe Bool)
-> (CreateInstance -> Maybe Bool -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Bool
ebsOptimized :: Maybe Bool
$sel:ebsOptimized:CreateInstance' :: CreateInstance -> Maybe Bool
ebsOptimized} -> Maybe Bool
ebsOptimized) (\s :: CreateInstance
s@CreateInstance' {} Maybe Bool
a -> CreateInstance
s {$sel:ebsOptimized:CreateInstance' :: Maybe Bool
ebsOptimized = Maybe Bool
a} :: CreateInstance)
createInstance_os :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_os :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_os = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
os :: Maybe Text
$sel:os:CreateInstance' :: CreateInstance -> Maybe Text
os} -> Maybe Text
os) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:os:CreateInstance' :: Maybe Text
os = Maybe Text
a} :: CreateInstance)
createInstance_availabilityZone :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_availabilityZone = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateInstance' :: CreateInstance -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:availabilityZone:CreateInstance' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateInstance)
createInstance_tenancy :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_tenancy :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_tenancy = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
tenancy :: Maybe Text
$sel:tenancy:CreateInstance' :: CreateInstance -> Maybe Text
tenancy} -> Maybe Text
tenancy) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:tenancy:CreateInstance' :: Maybe Text
tenancy = Maybe Text
a} :: CreateInstance)
createInstance_autoScalingType :: Lens.Lens' CreateInstance (Prelude.Maybe AutoScalingType)
createInstance_autoScalingType :: (Maybe AutoScalingType -> f (Maybe AutoScalingType))
-> CreateInstance -> f CreateInstance
createInstance_autoScalingType = (CreateInstance -> Maybe AutoScalingType)
-> (CreateInstance -> Maybe AutoScalingType -> CreateInstance)
-> Lens
CreateInstance
CreateInstance
(Maybe AutoScalingType)
(Maybe AutoScalingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe AutoScalingType
autoScalingType :: Maybe AutoScalingType
$sel:autoScalingType:CreateInstance' :: CreateInstance -> Maybe AutoScalingType
autoScalingType} -> Maybe AutoScalingType
autoScalingType) (\s :: CreateInstance
s@CreateInstance' {} Maybe AutoScalingType
a -> CreateInstance
s {$sel:autoScalingType:CreateInstance' :: Maybe AutoScalingType
autoScalingType = Maybe AutoScalingType
a} :: CreateInstance)
createInstance_architecture :: Lens.Lens' CreateInstance (Prelude.Maybe Architecture)
createInstance_architecture :: (Maybe Architecture -> f (Maybe Architecture))
-> CreateInstance -> f CreateInstance
createInstance_architecture = (CreateInstance -> Maybe Architecture)
-> (CreateInstance -> Maybe Architecture -> CreateInstance)
-> Lens
CreateInstance
CreateInstance
(Maybe Architecture)
(Maybe Architecture)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Architecture
architecture :: Maybe Architecture
$sel:architecture:CreateInstance' :: CreateInstance -> Maybe Architecture
architecture} -> Maybe Architecture
architecture) (\s :: CreateInstance
s@CreateInstance' {} Maybe Architecture
a -> CreateInstance
s {$sel:architecture:CreateInstance' :: Maybe Architecture
architecture = Maybe Architecture
a} :: CreateInstance)
createInstance_amiId :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_amiId :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_amiId = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
amiId :: Maybe Text
$sel:amiId:CreateInstance' :: CreateInstance -> Maybe Text
amiId} -> Maybe Text
amiId) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:amiId:CreateInstance' :: Maybe Text
amiId = Maybe Text
a} :: CreateInstance)
createInstance_rootDeviceType :: Lens.Lens' CreateInstance (Prelude.Maybe RootDeviceType)
createInstance_rootDeviceType :: (Maybe RootDeviceType -> f (Maybe RootDeviceType))
-> CreateInstance -> f CreateInstance
createInstance_rootDeviceType = (CreateInstance -> Maybe RootDeviceType)
-> (CreateInstance -> Maybe RootDeviceType -> CreateInstance)
-> Lens
CreateInstance
CreateInstance
(Maybe RootDeviceType)
(Maybe RootDeviceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe RootDeviceType
rootDeviceType :: Maybe RootDeviceType
$sel:rootDeviceType:CreateInstance' :: CreateInstance -> Maybe RootDeviceType
rootDeviceType} -> Maybe RootDeviceType
rootDeviceType) (\s :: CreateInstance
s@CreateInstance' {} Maybe RootDeviceType
a -> CreateInstance
s {$sel:rootDeviceType:CreateInstance' :: Maybe RootDeviceType
rootDeviceType = Maybe RootDeviceType
a} :: CreateInstance)
createInstance_blockDeviceMappings :: Lens.Lens' CreateInstance (Prelude.Maybe [BlockDeviceMapping])
createInstance_blockDeviceMappings :: (Maybe [BlockDeviceMapping] -> f (Maybe [BlockDeviceMapping]))
-> CreateInstance -> f CreateInstance
createInstance_blockDeviceMappings = (CreateInstance -> Maybe [BlockDeviceMapping])
-> (CreateInstance -> Maybe [BlockDeviceMapping] -> CreateInstance)
-> Lens
CreateInstance
CreateInstance
(Maybe [BlockDeviceMapping])
(Maybe [BlockDeviceMapping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe [BlockDeviceMapping]
blockDeviceMappings :: Maybe [BlockDeviceMapping]
$sel:blockDeviceMappings:CreateInstance' :: CreateInstance -> Maybe [BlockDeviceMapping]
blockDeviceMappings} -> Maybe [BlockDeviceMapping]
blockDeviceMappings) (\s :: CreateInstance
s@CreateInstance' {} Maybe [BlockDeviceMapping]
a -> CreateInstance
s {$sel:blockDeviceMappings:CreateInstance' :: Maybe [BlockDeviceMapping]
blockDeviceMappings = Maybe [BlockDeviceMapping]
a} :: CreateInstance) ((Maybe [BlockDeviceMapping] -> f (Maybe [BlockDeviceMapping]))
-> CreateInstance -> f CreateInstance)
-> ((Maybe [BlockDeviceMapping] -> f (Maybe [BlockDeviceMapping]))
-> Maybe [BlockDeviceMapping] -> f (Maybe [BlockDeviceMapping]))
-> (Maybe [BlockDeviceMapping] -> f (Maybe [BlockDeviceMapping]))
-> CreateInstance
-> f CreateInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[BlockDeviceMapping]
[BlockDeviceMapping]
[BlockDeviceMapping]
[BlockDeviceMapping]
-> Iso
(Maybe [BlockDeviceMapping])
(Maybe [BlockDeviceMapping])
(Maybe [BlockDeviceMapping])
(Maybe [BlockDeviceMapping])
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
[BlockDeviceMapping]
[BlockDeviceMapping]
[BlockDeviceMapping]
[BlockDeviceMapping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createInstance_stackId :: Lens.Lens' CreateInstance Prelude.Text
createInstance_stackId :: (Text -> f Text) -> CreateInstance -> f CreateInstance
createInstance_stackId = (CreateInstance -> Text)
-> (CreateInstance -> Text -> CreateInstance)
-> Lens CreateInstance CreateInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Text
stackId :: Text
$sel:stackId:CreateInstance' :: CreateInstance -> Text
stackId} -> Text
stackId) (\s :: CreateInstance
s@CreateInstance' {} Text
a -> CreateInstance
s {$sel:stackId:CreateInstance' :: Text
stackId = Text
a} :: CreateInstance)
createInstance_layerIds :: Lens.Lens' CreateInstance [Prelude.Text]
createInstance_layerIds :: ([Text] -> f [Text]) -> CreateInstance -> f CreateInstance
createInstance_layerIds = (CreateInstance -> [Text])
-> (CreateInstance -> [Text] -> CreateInstance)
-> Lens CreateInstance CreateInstance [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {[Text]
layerIds :: [Text]
$sel:layerIds:CreateInstance' :: CreateInstance -> [Text]
layerIds} -> [Text]
layerIds) (\s :: CreateInstance
s@CreateInstance' {} [Text]
a -> CreateInstance
s {$sel:layerIds:CreateInstance' :: [Text]
layerIds = [Text]
a} :: CreateInstance) (([Text] -> f [Text]) -> CreateInstance -> f CreateInstance)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateInstance
-> f CreateInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createInstance_instanceType :: Lens.Lens' CreateInstance Prelude.Text
createInstance_instanceType :: (Text -> f Text) -> CreateInstance -> f CreateInstance
createInstance_instanceType = (CreateInstance -> Text)
-> (CreateInstance -> Text -> CreateInstance)
-> Lens CreateInstance CreateInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Text
instanceType :: Text
$sel:instanceType:CreateInstance' :: CreateInstance -> Text
instanceType} -> Text
instanceType) (\s :: CreateInstance
s@CreateInstance' {} Text
a -> CreateInstance
s {$sel:instanceType:CreateInstance' :: Text
instanceType = Text
a} :: CreateInstance)
instance Core.AWSRequest CreateInstance where
type
AWSResponse CreateInstance =
CreateInstanceResponse
request :: CreateInstance -> Request CreateInstance
request = Service -> CreateInstance -> Request CreateInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInstance)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateInstance))
-> Logger
-> Service
-> Proxy CreateInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> CreateInstanceResponse
CreateInstanceResponse'
(Maybe Text -> Int -> CreateInstanceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InstanceId")
Either String (Int -> CreateInstanceResponse)
-> Either String Int -> Either String CreateInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateInstance
instance Prelude.NFData CreateInstance
instance Core.ToHeaders CreateInstance where
toHeaders :: CreateInstance -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OpsWorks_20130218.CreateInstance" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateInstance where
toJSON :: CreateInstance -> Value
toJSON CreateInstance' {[Text]
Maybe Bool
Maybe [BlockDeviceMapping]
Maybe Text
Maybe Architecture
Maybe AutoScalingType
Maybe RootDeviceType
Text
instanceType :: Text
layerIds :: [Text]
stackId :: Text
blockDeviceMappings :: Maybe [BlockDeviceMapping]
rootDeviceType :: Maybe RootDeviceType
amiId :: Maybe Text
architecture :: Maybe Architecture
autoScalingType :: Maybe AutoScalingType
tenancy :: Maybe Text
availabilityZone :: Maybe Text
os :: Maybe Text
ebsOptimized :: Maybe Bool
subnetId :: Maybe Text
agentVersion :: Maybe Text
sshKeyName :: Maybe Text
hostname :: Maybe Text
virtualizationType :: Maybe Text
installUpdatesOnBoot :: Maybe Bool
$sel:instanceType:CreateInstance' :: CreateInstance -> Text
$sel:layerIds:CreateInstance' :: CreateInstance -> [Text]
$sel:stackId:CreateInstance' :: CreateInstance -> Text
$sel:blockDeviceMappings:CreateInstance' :: CreateInstance -> Maybe [BlockDeviceMapping]
$sel:rootDeviceType:CreateInstance' :: CreateInstance -> Maybe RootDeviceType
$sel:amiId:CreateInstance' :: CreateInstance -> Maybe Text
$sel:architecture:CreateInstance' :: CreateInstance -> Maybe Architecture
$sel:autoScalingType:CreateInstance' :: CreateInstance -> Maybe AutoScalingType
$sel:tenancy:CreateInstance' :: CreateInstance -> Maybe Text
$sel:availabilityZone:CreateInstance' :: CreateInstance -> Maybe Text
$sel:os:CreateInstance' :: CreateInstance -> Maybe Text
$sel:ebsOptimized:CreateInstance' :: CreateInstance -> Maybe Bool
$sel:subnetId:CreateInstance' :: CreateInstance -> Maybe Text
$sel:agentVersion:CreateInstance' :: CreateInstance -> Maybe Text
$sel:sshKeyName:CreateInstance' :: CreateInstance -> Maybe Text
$sel:hostname:CreateInstance' :: CreateInstance -> Maybe Text
$sel:virtualizationType:CreateInstance' :: CreateInstance -> Maybe Text
$sel:installUpdatesOnBoot:CreateInstance' :: CreateInstance -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InstallUpdatesOnBoot" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
installUpdatesOnBoot,
(Text
"VirtualizationType" 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
virtualizationType,
(Text
"Hostname" 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
hostname,
(Text
"SshKeyName" 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
sshKeyName,
(Text
"AgentVersion" 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
agentVersion,
(Text
"SubnetId" 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
subnetId,
(Text
"EbsOptimized" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
ebsOptimized,
(Text
"Os" 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
os,
(Text
"AvailabilityZone" 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
availabilityZone,
(Text
"Tenancy" 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
tenancy,
(Text
"AutoScalingType" Text -> AutoScalingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AutoScalingType -> Pair) -> Maybe AutoScalingType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoScalingType
autoScalingType,
(Text
"Architecture" Text -> Architecture -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Architecture -> Pair) -> Maybe Architecture -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Architecture
architecture,
(Text
"AmiId" 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
amiId,
(Text
"RootDeviceType" Text -> RootDeviceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RootDeviceType -> Pair) -> Maybe RootDeviceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RootDeviceType
rootDeviceType,
(Text
"BlockDeviceMappings" Text -> [BlockDeviceMapping] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([BlockDeviceMapping] -> Pair)
-> Maybe [BlockDeviceMapping] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [BlockDeviceMapping]
blockDeviceMappings,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StackId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stackId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LayerIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
layerIds),
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)
]
)
instance Core.ToPath CreateInstance where
toPath :: CreateInstance -> ByteString
toPath = ByteString -> CreateInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateInstance where
toQuery :: CreateInstance -> QueryString
toQuery = QueryString -> CreateInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateInstanceResponse = CreateInstanceResponse'
{
CreateInstanceResponse -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
CreateInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateInstanceResponse -> CreateInstanceResponse -> Bool
(CreateInstanceResponse -> CreateInstanceResponse -> Bool)
-> (CreateInstanceResponse -> CreateInstanceResponse -> Bool)
-> Eq CreateInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
$c/= :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
== :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
$c== :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
Prelude.Eq, ReadPrec [CreateInstanceResponse]
ReadPrec CreateInstanceResponse
Int -> ReadS CreateInstanceResponse
ReadS [CreateInstanceResponse]
(Int -> ReadS CreateInstanceResponse)
-> ReadS [CreateInstanceResponse]
-> ReadPrec CreateInstanceResponse
-> ReadPrec [CreateInstanceResponse]
-> Read CreateInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceResponse]
$creadListPrec :: ReadPrec [CreateInstanceResponse]
readPrec :: ReadPrec CreateInstanceResponse
$creadPrec :: ReadPrec CreateInstanceResponse
readList :: ReadS [CreateInstanceResponse]
$creadList :: ReadS [CreateInstanceResponse]
readsPrec :: Int -> ReadS CreateInstanceResponse
$creadsPrec :: Int -> ReadS CreateInstanceResponse
Prelude.Read, Int -> CreateInstanceResponse -> ShowS
[CreateInstanceResponse] -> ShowS
CreateInstanceResponse -> String
(Int -> CreateInstanceResponse -> ShowS)
-> (CreateInstanceResponse -> String)
-> ([CreateInstanceResponse] -> ShowS)
-> Show CreateInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceResponse] -> ShowS
$cshowList :: [CreateInstanceResponse] -> ShowS
show :: CreateInstanceResponse -> String
$cshow :: CreateInstanceResponse -> String
showsPrec :: Int -> CreateInstanceResponse -> ShowS
$cshowsPrec :: Int -> CreateInstanceResponse -> ShowS
Prelude.Show, (forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x)
-> (forall x.
Rep CreateInstanceResponse x -> CreateInstanceResponse)
-> Generic CreateInstanceResponse
forall x. Rep CreateInstanceResponse x -> CreateInstanceResponse
forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstanceResponse x -> CreateInstanceResponse
$cfrom :: forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x
Prelude.Generic)
newCreateInstanceResponse ::
Prelude.Int ->
CreateInstanceResponse
newCreateInstanceResponse :: Int -> CreateInstanceResponse
newCreateInstanceResponse Int
pHttpStatus_ =
CreateInstanceResponse' :: Maybe Text -> Int -> CreateInstanceResponse
CreateInstanceResponse'
{ $sel:instanceId:CreateInstanceResponse' :: Maybe Text
instanceId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createInstanceResponse_instanceId :: Lens.Lens' CreateInstanceResponse (Prelude.Maybe Prelude.Text)
createInstanceResponse_instanceId :: (Maybe Text -> f (Maybe Text))
-> CreateInstanceResponse -> f CreateInstanceResponse
createInstanceResponse_instanceId = (CreateInstanceResponse -> Maybe Text)
-> (CreateInstanceResponse -> Maybe Text -> CreateInstanceResponse)
-> Lens
CreateInstanceResponse
CreateInstanceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceResponse' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:CreateInstanceResponse' :: CreateInstanceResponse -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: CreateInstanceResponse
s@CreateInstanceResponse' {} Maybe Text
a -> CreateInstanceResponse
s {$sel:instanceId:CreateInstanceResponse' :: Maybe Text
instanceId = Maybe Text
a} :: CreateInstanceResponse)
createInstanceResponse_httpStatus :: Lens.Lens' CreateInstanceResponse Prelude.Int
createInstanceResponse_httpStatus :: (Int -> f Int)
-> CreateInstanceResponse -> f CreateInstanceResponse
createInstanceResponse_httpStatus = (CreateInstanceResponse -> Int)
-> (CreateInstanceResponse -> Int -> CreateInstanceResponse)
-> Lens CreateInstanceResponse CreateInstanceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateInstanceResponse' :: CreateInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateInstanceResponse
s@CreateInstanceResponse' {} Int
a -> CreateInstanceResponse
s {$sel:httpStatus:CreateInstanceResponse' :: Int
httpStatus = Int
a} :: CreateInstanceResponse)
instance Prelude.NFData CreateInstanceResponse