{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ImageBuilder.CreateInfrastructureConfiguration
-- 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)
--
-- Creates a new infrastructure configuration. An infrastructure
-- configuration defines the environment in which your image will be built
-- and tested.
module Amazonka.ImageBuilder.CreateInfrastructureConfiguration
  ( -- * Creating a Request
    CreateInfrastructureConfiguration (..),
    newCreateInfrastructureConfiguration,

    -- * Request Lenses
    createInfrastructureConfiguration_securityGroupIds,
    createInfrastructureConfiguration_snsTopicArn,
    createInfrastructureConfiguration_instanceTypes,
    createInfrastructureConfiguration_keyPair,
    createInfrastructureConfiguration_resourceTags,
    createInfrastructureConfiguration_subnetId,
    createInfrastructureConfiguration_instanceMetadataOptions,
    createInfrastructureConfiguration_logging,
    createInfrastructureConfiguration_description,
    createInfrastructureConfiguration_tags,
    createInfrastructureConfiguration_terminateInstanceOnFailure,
    createInfrastructureConfiguration_name,
    createInfrastructureConfiguration_instanceProfileName,
    createInfrastructureConfiguration_clientToken,

    -- * Destructuring the Response
    CreateInfrastructureConfigurationResponse (..),
    newCreateInfrastructureConfigurationResponse,

    -- * Response Lenses
    createInfrastructureConfigurationResponse_requestId,
    createInfrastructureConfigurationResponse_infrastructureConfigurationArn,
    createInfrastructureConfigurationResponse_clientToken,
    createInfrastructureConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateInfrastructureConfiguration' smart constructor.
data CreateInfrastructureConfiguration = CreateInfrastructureConfiguration'
  { -- | The security group IDs to associate with the instance used to customize
    -- your Amazon EC2 AMI.
    CreateInfrastructureConfiguration -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The SNS topic on which to send image build events.
    CreateInfrastructureConfiguration -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The instance types of the infrastructure configuration. You can specify
    -- one or more instance types to use for this build. The service will pick
    -- one of these instance types based on availability.
    CreateInfrastructureConfiguration -> Maybe [Text]
instanceTypes :: Prelude.Maybe [Prelude.Text],
    -- | The key pair of the infrastructure configuration. You can use this to
    -- log on to and debug the instance used to create your image.
    CreateInfrastructureConfiguration -> Maybe Text
keyPair :: Prelude.Maybe Prelude.Text,
    -- | The tags attached to the resource created by Image Builder.
    CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
resourceTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The subnet ID in which to place the instance used to customize your
    -- Amazon EC2 AMI.
    CreateInfrastructureConfiguration -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The instance metadata options that you can set for the HTTP requests
    -- that pipeline builds use to launch EC2 build and test instances.
    CreateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
instanceMetadataOptions :: Prelude.Maybe InstanceMetadataOptions,
    -- | The logging configuration of the infrastructure configuration.
    CreateInfrastructureConfiguration -> Maybe Logging
logging :: Prelude.Maybe Logging,
    -- | The description of the infrastructure configuration.
    CreateInfrastructureConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags of the infrastructure configuration.
    CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The terminate instance on failure setting of the infrastructure
    -- configuration. Set to false if you want Image Builder to retain the
    -- instance used to configure your AMI if the build or test phase of your
    -- workflow fails.
    CreateInfrastructureConfiguration -> Maybe Bool
terminateInstanceOnFailure :: Prelude.Maybe Prelude.Bool,
    -- | The name of the infrastructure configuration.
    CreateInfrastructureConfiguration -> Text
name :: Prelude.Text,
    -- | The instance profile to associate with the instance used to customize
    -- your Amazon EC2 AMI.
    CreateInfrastructureConfiguration -> Text
instanceProfileName :: Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    CreateInfrastructureConfiguration -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateInfrastructureConfiguration
-> CreateInfrastructureConfiguration -> Bool
(CreateInfrastructureConfiguration
 -> CreateInfrastructureConfiguration -> Bool)
-> (CreateInfrastructureConfiguration
    -> CreateInfrastructureConfiguration -> Bool)
-> Eq CreateInfrastructureConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInfrastructureConfiguration
-> CreateInfrastructureConfiguration -> Bool
$c/= :: CreateInfrastructureConfiguration
-> CreateInfrastructureConfiguration -> Bool
== :: CreateInfrastructureConfiguration
-> CreateInfrastructureConfiguration -> Bool
$c== :: CreateInfrastructureConfiguration
-> CreateInfrastructureConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateInfrastructureConfiguration]
ReadPrec CreateInfrastructureConfiguration
Int -> ReadS CreateInfrastructureConfiguration
ReadS [CreateInfrastructureConfiguration]
(Int -> ReadS CreateInfrastructureConfiguration)
-> ReadS [CreateInfrastructureConfiguration]
-> ReadPrec CreateInfrastructureConfiguration
-> ReadPrec [CreateInfrastructureConfiguration]
-> Read CreateInfrastructureConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInfrastructureConfiguration]
$creadListPrec :: ReadPrec [CreateInfrastructureConfiguration]
readPrec :: ReadPrec CreateInfrastructureConfiguration
$creadPrec :: ReadPrec CreateInfrastructureConfiguration
readList :: ReadS [CreateInfrastructureConfiguration]
$creadList :: ReadS [CreateInfrastructureConfiguration]
readsPrec :: Int -> ReadS CreateInfrastructureConfiguration
$creadsPrec :: Int -> ReadS CreateInfrastructureConfiguration
Prelude.Read, Int -> CreateInfrastructureConfiguration -> ShowS
[CreateInfrastructureConfiguration] -> ShowS
CreateInfrastructureConfiguration -> String
(Int -> CreateInfrastructureConfiguration -> ShowS)
-> (CreateInfrastructureConfiguration -> String)
-> ([CreateInfrastructureConfiguration] -> ShowS)
-> Show CreateInfrastructureConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInfrastructureConfiguration] -> ShowS
$cshowList :: [CreateInfrastructureConfiguration] -> ShowS
show :: CreateInfrastructureConfiguration -> String
$cshow :: CreateInfrastructureConfiguration -> String
showsPrec :: Int -> CreateInfrastructureConfiguration -> ShowS
$cshowsPrec :: Int -> CreateInfrastructureConfiguration -> ShowS
Prelude.Show, (forall x.
 CreateInfrastructureConfiguration
 -> Rep CreateInfrastructureConfiguration x)
-> (forall x.
    Rep CreateInfrastructureConfiguration x
    -> CreateInfrastructureConfiguration)
-> Generic CreateInfrastructureConfiguration
forall x.
Rep CreateInfrastructureConfiguration x
-> CreateInfrastructureConfiguration
forall x.
CreateInfrastructureConfiguration
-> Rep CreateInfrastructureConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInfrastructureConfiguration x
-> CreateInfrastructureConfiguration
$cfrom :: forall x.
CreateInfrastructureConfiguration
-> Rep CreateInfrastructureConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateInfrastructureConfiguration' 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:
--
-- 'securityGroupIds', 'createInfrastructureConfiguration_securityGroupIds' - The security group IDs to associate with the instance used to customize
-- your Amazon EC2 AMI.
--
-- 'snsTopicArn', 'createInfrastructureConfiguration_snsTopicArn' - The SNS topic on which to send image build events.
--
-- 'instanceTypes', 'createInfrastructureConfiguration_instanceTypes' - The instance types of the infrastructure configuration. You can specify
-- one or more instance types to use for this build. The service will pick
-- one of these instance types based on availability.
--
-- 'keyPair', 'createInfrastructureConfiguration_keyPair' - The key pair of the infrastructure configuration. You can use this to
-- log on to and debug the instance used to create your image.
--
-- 'resourceTags', 'createInfrastructureConfiguration_resourceTags' - The tags attached to the resource created by Image Builder.
--
-- 'subnetId', 'createInfrastructureConfiguration_subnetId' - The subnet ID in which to place the instance used to customize your
-- Amazon EC2 AMI.
--
-- 'instanceMetadataOptions', 'createInfrastructureConfiguration_instanceMetadataOptions' - The instance metadata options that you can set for the HTTP requests
-- that pipeline builds use to launch EC2 build and test instances.
--
-- 'logging', 'createInfrastructureConfiguration_logging' - The logging configuration of the infrastructure configuration.
--
-- 'description', 'createInfrastructureConfiguration_description' - The description of the infrastructure configuration.
--
-- 'tags', 'createInfrastructureConfiguration_tags' - The tags of the infrastructure configuration.
--
-- 'terminateInstanceOnFailure', 'createInfrastructureConfiguration_terminateInstanceOnFailure' - The terminate instance on failure setting of the infrastructure
-- configuration. Set to false if you want Image Builder to retain the
-- instance used to configure your AMI if the build or test phase of your
-- workflow fails.
--
-- 'name', 'createInfrastructureConfiguration_name' - The name of the infrastructure configuration.
--
-- 'instanceProfileName', 'createInfrastructureConfiguration_instanceProfileName' - The instance profile to associate with the instance used to customize
-- your Amazon EC2 AMI.
--
-- 'clientToken', 'createInfrastructureConfiguration_clientToken' - The idempotency token used to make this request idempotent.
newCreateInfrastructureConfiguration ::
  -- | 'name'
  Prelude.Text ->
  -- | 'instanceProfileName'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateInfrastructureConfiguration
newCreateInfrastructureConfiguration :: Text -> Text -> Text -> CreateInfrastructureConfiguration
newCreateInfrastructureConfiguration
  Text
pName_
  Text
pInstanceProfileName_
  Text
pClientToken_ =
    CreateInfrastructureConfiguration' :: Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe InstanceMetadataOptions
-> Maybe Logging
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Text
-> Text
-> Text
-> CreateInfrastructureConfiguration
CreateInfrastructureConfiguration'
      { $sel:securityGroupIds:CreateInfrastructureConfiguration' :: Maybe [Text]
securityGroupIds =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:snsTopicArn:CreateInfrastructureConfiguration' :: Maybe Text
snsTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceTypes:CreateInfrastructureConfiguration' :: Maybe [Text]
instanceTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:keyPair:CreateInfrastructureConfiguration' :: Maybe Text
keyPair = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceTags:CreateInfrastructureConfiguration' :: Maybe (HashMap Text Text)
resourceTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:subnetId:CreateInfrastructureConfiguration' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceMetadataOptions:CreateInfrastructureConfiguration' :: Maybe InstanceMetadataOptions
instanceMetadataOptions =
          Maybe InstanceMetadataOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:logging:CreateInfrastructureConfiguration' :: Maybe Logging
logging = Maybe Logging
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateInfrastructureConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateInfrastructureConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:terminateInstanceOnFailure:CreateInfrastructureConfiguration' :: Maybe Bool
terminateInstanceOnFailure =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateInfrastructureConfiguration' :: Text
name = Text
pName_,
        $sel:instanceProfileName:CreateInfrastructureConfiguration' :: Text
instanceProfileName =
          Text
pInstanceProfileName_,
        $sel:clientToken:CreateInfrastructureConfiguration' :: Text
clientToken = Text
pClientToken_
      }

-- | The security group IDs to associate with the instance used to customize
-- your Amazon EC2 AMI.
createInfrastructureConfiguration_securityGroupIds :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe [Prelude.Text])
createInfrastructureConfiguration_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_securityGroupIds = (CreateInfrastructureConfiguration -> Maybe [Text])
-> (CreateInfrastructureConfiguration
    -> Maybe [Text] -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe [Text]
a -> CreateInfrastructureConfiguration
s {$sel:securityGroupIds:CreateInfrastructureConfiguration' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateInfrastructureConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateInfrastructureConfiguration
 -> f CreateInfrastructureConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The SNS topic on which to send image build events.
createInfrastructureConfiguration_snsTopicArn :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Prelude.Text)
createInfrastructureConfiguration_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_snsTopicArn = (CreateInfrastructureConfiguration -> Maybe Text)
-> (CreateInfrastructureConfiguration
    -> Maybe Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Text
a -> CreateInfrastructureConfiguration
s {$sel:snsTopicArn:CreateInfrastructureConfiguration' :: Maybe Text
snsTopicArn = Maybe Text
a} :: CreateInfrastructureConfiguration)

-- | The instance types of the infrastructure configuration. You can specify
-- one or more instance types to use for this build. The service will pick
-- one of these instance types based on availability.
createInfrastructureConfiguration_instanceTypes :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe [Prelude.Text])
createInfrastructureConfiguration_instanceTypes :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_instanceTypes = (CreateInfrastructureConfiguration -> Maybe [Text])
-> (CreateInfrastructureConfiguration
    -> Maybe [Text] -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe [Text]
instanceTypes :: Maybe [Text]
$sel:instanceTypes:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe [Text]
instanceTypes} -> Maybe [Text]
instanceTypes) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe [Text]
a -> CreateInfrastructureConfiguration
s {$sel:instanceTypes:CreateInfrastructureConfiguration' :: Maybe [Text]
instanceTypes = Maybe [Text]
a} :: CreateInfrastructureConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateInfrastructureConfiguration
 -> f CreateInfrastructureConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The key pair of the infrastructure configuration. You can use this to
-- log on to and debug the instance used to create your image.
createInfrastructureConfiguration_keyPair :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Prelude.Text)
createInfrastructureConfiguration_keyPair :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_keyPair = (CreateInfrastructureConfiguration -> Maybe Text)
-> (CreateInfrastructureConfiguration
    -> Maybe Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Text
keyPair :: Maybe Text
$sel:keyPair:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
keyPair} -> Maybe Text
keyPair) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Text
a -> CreateInfrastructureConfiguration
s {$sel:keyPair:CreateInfrastructureConfiguration' :: Maybe Text
keyPair = Maybe Text
a} :: CreateInfrastructureConfiguration)

-- | The tags attached to the resource created by Image Builder.
createInfrastructureConfiguration_resourceTags :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createInfrastructureConfiguration_resourceTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_resourceTags = (CreateInfrastructureConfiguration -> Maybe (HashMap Text Text))
-> (CreateInfrastructureConfiguration
    -> Maybe (HashMap Text Text) -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe (HashMap Text Text)
resourceTags :: Maybe (HashMap Text Text)
$sel:resourceTags:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
resourceTags} -> Maybe (HashMap Text Text)
resourceTags) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe (HashMap Text Text)
a -> CreateInfrastructureConfiguration
s {$sel:resourceTags:CreateInfrastructureConfiguration' :: Maybe (HashMap Text Text)
resourceTags = Maybe (HashMap Text Text)
a} :: CreateInfrastructureConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateInfrastructureConfiguration
 -> f CreateInfrastructureConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The subnet ID in which to place the instance used to customize your
-- Amazon EC2 AMI.
createInfrastructureConfiguration_subnetId :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Prelude.Text)
createInfrastructureConfiguration_subnetId :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_subnetId = (CreateInfrastructureConfiguration -> Maybe Text)
-> (CreateInfrastructureConfiguration
    -> Maybe Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Text
a -> CreateInfrastructureConfiguration
s {$sel:subnetId:CreateInfrastructureConfiguration' :: Maybe Text
subnetId = Maybe Text
a} :: CreateInfrastructureConfiguration)

-- | The instance metadata options that you can set for the HTTP requests
-- that pipeline builds use to launch EC2 build and test instances.
createInfrastructureConfiguration_instanceMetadataOptions :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe InstanceMetadataOptions)
createInfrastructureConfiguration_instanceMetadataOptions :: (Maybe InstanceMetadataOptions
 -> f (Maybe InstanceMetadataOptions))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_instanceMetadataOptions = (CreateInfrastructureConfiguration
 -> Maybe InstanceMetadataOptions)
-> (CreateInfrastructureConfiguration
    -> Maybe InstanceMetadataOptions
    -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe InstanceMetadataOptions)
     (Maybe InstanceMetadataOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe InstanceMetadataOptions
instanceMetadataOptions :: Maybe InstanceMetadataOptions
$sel:instanceMetadataOptions:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
instanceMetadataOptions} -> Maybe InstanceMetadataOptions
instanceMetadataOptions) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe InstanceMetadataOptions
a -> CreateInfrastructureConfiguration
s {$sel:instanceMetadataOptions:CreateInfrastructureConfiguration' :: Maybe InstanceMetadataOptions
instanceMetadataOptions = Maybe InstanceMetadataOptions
a} :: CreateInfrastructureConfiguration)

-- | The logging configuration of the infrastructure configuration.
createInfrastructureConfiguration_logging :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Logging)
createInfrastructureConfiguration_logging :: (Maybe Logging -> f (Maybe Logging))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_logging = (CreateInfrastructureConfiguration -> Maybe Logging)
-> (CreateInfrastructureConfiguration
    -> Maybe Logging -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Logging)
     (Maybe Logging)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Logging
logging :: Maybe Logging
$sel:logging:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Logging
logging} -> Maybe Logging
logging) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Logging
a -> CreateInfrastructureConfiguration
s {$sel:logging:CreateInfrastructureConfiguration' :: Maybe Logging
logging = Maybe Logging
a} :: CreateInfrastructureConfiguration)

-- | The description of the infrastructure configuration.
createInfrastructureConfiguration_description :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Prelude.Text)
createInfrastructureConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_description = (CreateInfrastructureConfiguration -> Maybe Text)
-> (CreateInfrastructureConfiguration
    -> Maybe Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Text
a -> CreateInfrastructureConfiguration
s {$sel:description:CreateInfrastructureConfiguration' :: Maybe Text
description = Maybe Text
a} :: CreateInfrastructureConfiguration)

-- | The tags of the infrastructure configuration.
createInfrastructureConfiguration_tags :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createInfrastructureConfiguration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_tags = (CreateInfrastructureConfiguration -> Maybe (HashMap Text Text))
-> (CreateInfrastructureConfiguration
    -> Maybe (HashMap Text Text) -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe (HashMap Text Text)
a -> CreateInfrastructureConfiguration
s {$sel:tags:CreateInfrastructureConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateInfrastructureConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateInfrastructureConfiguration
 -> f CreateInfrastructureConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The terminate instance on failure setting of the infrastructure
-- configuration. Set to false if you want Image Builder to retain the
-- instance used to configure your AMI if the build or test phase of your
-- workflow fails.
createInfrastructureConfiguration_terminateInstanceOnFailure :: Lens.Lens' CreateInfrastructureConfiguration (Prelude.Maybe Prelude.Bool)
createInfrastructureConfiguration_terminateInstanceOnFailure :: (Maybe Bool -> f (Maybe Bool))
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_terminateInstanceOnFailure = (CreateInfrastructureConfiguration -> Maybe Bool)
-> (CreateInfrastructureConfiguration
    -> Maybe Bool -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Maybe Bool
terminateInstanceOnFailure :: Maybe Bool
$sel:terminateInstanceOnFailure:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Bool
terminateInstanceOnFailure} -> Maybe Bool
terminateInstanceOnFailure) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Maybe Bool
a -> CreateInfrastructureConfiguration
s {$sel:terminateInstanceOnFailure:CreateInfrastructureConfiguration' :: Maybe Bool
terminateInstanceOnFailure = Maybe Bool
a} :: CreateInfrastructureConfiguration)

-- | The name of the infrastructure configuration.
createInfrastructureConfiguration_name :: Lens.Lens' CreateInfrastructureConfiguration Prelude.Text
createInfrastructureConfiguration_name :: (Text -> f Text)
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_name = (CreateInfrastructureConfiguration -> Text)
-> (CreateInfrastructureConfiguration
    -> Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Text
name :: Text
$sel:name:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
name} -> Text
name) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Text
a -> CreateInfrastructureConfiguration
s {$sel:name:CreateInfrastructureConfiguration' :: Text
name = Text
a} :: CreateInfrastructureConfiguration)

-- | The instance profile to associate with the instance used to customize
-- your Amazon EC2 AMI.
createInfrastructureConfiguration_instanceProfileName :: Lens.Lens' CreateInfrastructureConfiguration Prelude.Text
createInfrastructureConfiguration_instanceProfileName :: (Text -> f Text)
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_instanceProfileName = (CreateInfrastructureConfiguration -> Text)
-> (CreateInfrastructureConfiguration
    -> Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Text
instanceProfileName :: Text
$sel:instanceProfileName:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
instanceProfileName} -> Text
instanceProfileName) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Text
a -> CreateInfrastructureConfiguration
s {$sel:instanceProfileName:CreateInfrastructureConfiguration' :: Text
instanceProfileName = Text
a} :: CreateInfrastructureConfiguration)

-- | The idempotency token used to make this request idempotent.
createInfrastructureConfiguration_clientToken :: Lens.Lens' CreateInfrastructureConfiguration Prelude.Text
createInfrastructureConfiguration_clientToken :: (Text -> f Text)
-> CreateInfrastructureConfiguration
-> f CreateInfrastructureConfiguration
createInfrastructureConfiguration_clientToken = (CreateInfrastructureConfiguration -> Text)
-> (CreateInfrastructureConfiguration
    -> Text -> CreateInfrastructureConfiguration)
-> Lens
     CreateInfrastructureConfiguration
     CreateInfrastructureConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfiguration' {Text
clientToken :: Text
$sel:clientToken:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
clientToken} -> Text
clientToken) (\s :: CreateInfrastructureConfiguration
s@CreateInfrastructureConfiguration' {} Text
a -> CreateInfrastructureConfiguration
s {$sel:clientToken:CreateInfrastructureConfiguration' :: Text
clientToken = Text
a} :: CreateInfrastructureConfiguration)

instance
  Core.AWSRequest
    CreateInfrastructureConfiguration
  where
  type
    AWSResponse CreateInfrastructureConfiguration =
      CreateInfrastructureConfigurationResponse
  request :: CreateInfrastructureConfiguration
-> Request CreateInfrastructureConfiguration
request = Service
-> CreateInfrastructureConfiguration
-> Request CreateInfrastructureConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateInfrastructureConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateInfrastructureConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateInfrastructureConfiguration))
-> Logger
-> Service
-> Proxy CreateInfrastructureConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateInfrastructureConfiguration)))
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
-> Maybe Text
-> Maybe Text
-> Int
-> CreateInfrastructureConfigurationResponse
CreateInfrastructureConfigurationResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateInfrastructureConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateInfrastructureConfigurationResponse)
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
"requestId")
              Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> CreateInfrastructureConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> CreateInfrastructureConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => 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
"infrastructureConfigurationArn")
              Either
  String
  (Maybe Text -> Int -> CreateInfrastructureConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateInfrastructureConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => 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
"clientToken")
              Either String (Int -> CreateInfrastructureConfigurationResponse)
-> Either String Int
-> Either String CreateInfrastructureConfigurationResponse
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
    CreateInfrastructureConfiguration

instance
  Prelude.NFData
    CreateInfrastructureConfiguration

instance
  Core.ToHeaders
    CreateInfrastructureConfiguration
  where
  toHeaders :: CreateInfrastructureConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateInfrastructureConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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
    CreateInfrastructureConfiguration
  where
  toJSON :: CreateInfrastructureConfiguration -> Value
toJSON CreateInfrastructureConfiguration' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe InstanceMetadataOptions
Maybe Logging
Text
clientToken :: Text
instanceProfileName :: Text
name :: Text
terminateInstanceOnFailure :: Maybe Bool
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
logging :: Maybe Logging
instanceMetadataOptions :: Maybe InstanceMetadataOptions
subnetId :: Maybe Text
resourceTags :: Maybe (HashMap Text Text)
keyPair :: Maybe Text
instanceTypes :: Maybe [Text]
snsTopicArn :: Maybe Text
securityGroupIds :: Maybe [Text]
$sel:clientToken:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
$sel:instanceProfileName:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
$sel:name:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Text
$sel:terminateInstanceOnFailure:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Bool
$sel:tags:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
$sel:description:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
$sel:logging:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Logging
$sel:instanceMetadataOptions:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
$sel:subnetId:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
$sel:resourceTags:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe (HashMap Text Text)
$sel:keyPair:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
$sel:instanceTypes:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe [Text]
$sel:snsTopicArn:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe Text
$sel:securityGroupIds:CreateInfrastructureConfiguration' :: CreateInfrastructureConfiguration -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"securityGroupIds" 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]
securityGroupIds,
            (Text
"snsTopicArn" 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
snsTopicArn,
            (Text
"instanceTypes" 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]
instanceTypes,
            (Text
"keyPair" 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
keyPair,
            (Text
"resourceTags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
resourceTags,
            (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
"instanceMetadataOptions" Text -> InstanceMetadataOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InstanceMetadataOptions -> Pair)
-> Maybe InstanceMetadataOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceMetadataOptions
instanceMetadataOptions,
            (Text
"logging" Text -> Logging -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Logging -> Pair) -> Maybe Logging -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Logging
logging,
            (Text
"description" 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
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Text
"terminateInstanceOnFailure" 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
terminateInstanceOnFailure,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"instanceProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceProfileName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

instance
  Core.ToPath
    CreateInfrastructureConfiguration
  where
  toPath :: CreateInfrastructureConfiguration -> ByteString
toPath =
    ByteString -> CreateInfrastructureConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/CreateInfrastructureConfiguration"

instance
  Core.ToQuery
    CreateInfrastructureConfiguration
  where
  toQuery :: CreateInfrastructureConfiguration -> QueryString
toQuery = QueryString -> CreateInfrastructureConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateInfrastructureConfigurationResponse' smart constructor.
data CreateInfrastructureConfigurationResponse = CreateInfrastructureConfigurationResponse'
  { -- | The request ID that uniquely identifies this request.
    CreateInfrastructureConfigurationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the infrastructure configuration that
    -- was created by this request.
    CreateInfrastructureConfigurationResponse -> Maybe Text
infrastructureConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    CreateInfrastructureConfigurationResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateInfrastructureConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateInfrastructureConfigurationResponse
-> CreateInfrastructureConfigurationResponse -> Bool
(CreateInfrastructureConfigurationResponse
 -> CreateInfrastructureConfigurationResponse -> Bool)
-> (CreateInfrastructureConfigurationResponse
    -> CreateInfrastructureConfigurationResponse -> Bool)
-> Eq CreateInfrastructureConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInfrastructureConfigurationResponse
-> CreateInfrastructureConfigurationResponse -> Bool
$c/= :: CreateInfrastructureConfigurationResponse
-> CreateInfrastructureConfigurationResponse -> Bool
== :: CreateInfrastructureConfigurationResponse
-> CreateInfrastructureConfigurationResponse -> Bool
$c== :: CreateInfrastructureConfigurationResponse
-> CreateInfrastructureConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateInfrastructureConfigurationResponse]
ReadPrec CreateInfrastructureConfigurationResponse
Int -> ReadS CreateInfrastructureConfigurationResponse
ReadS [CreateInfrastructureConfigurationResponse]
(Int -> ReadS CreateInfrastructureConfigurationResponse)
-> ReadS [CreateInfrastructureConfigurationResponse]
-> ReadPrec CreateInfrastructureConfigurationResponse
-> ReadPrec [CreateInfrastructureConfigurationResponse]
-> Read CreateInfrastructureConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInfrastructureConfigurationResponse]
$creadListPrec :: ReadPrec [CreateInfrastructureConfigurationResponse]
readPrec :: ReadPrec CreateInfrastructureConfigurationResponse
$creadPrec :: ReadPrec CreateInfrastructureConfigurationResponse
readList :: ReadS [CreateInfrastructureConfigurationResponse]
$creadList :: ReadS [CreateInfrastructureConfigurationResponse]
readsPrec :: Int -> ReadS CreateInfrastructureConfigurationResponse
$creadsPrec :: Int -> ReadS CreateInfrastructureConfigurationResponse
Prelude.Read, Int -> CreateInfrastructureConfigurationResponse -> ShowS
[CreateInfrastructureConfigurationResponse] -> ShowS
CreateInfrastructureConfigurationResponse -> String
(Int -> CreateInfrastructureConfigurationResponse -> ShowS)
-> (CreateInfrastructureConfigurationResponse -> String)
-> ([CreateInfrastructureConfigurationResponse] -> ShowS)
-> Show CreateInfrastructureConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInfrastructureConfigurationResponse] -> ShowS
$cshowList :: [CreateInfrastructureConfigurationResponse] -> ShowS
show :: CreateInfrastructureConfigurationResponse -> String
$cshow :: CreateInfrastructureConfigurationResponse -> String
showsPrec :: Int -> CreateInfrastructureConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateInfrastructureConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 CreateInfrastructureConfigurationResponse
 -> Rep CreateInfrastructureConfigurationResponse x)
-> (forall x.
    Rep CreateInfrastructureConfigurationResponse x
    -> CreateInfrastructureConfigurationResponse)
-> Generic CreateInfrastructureConfigurationResponse
forall x.
Rep CreateInfrastructureConfigurationResponse x
-> CreateInfrastructureConfigurationResponse
forall x.
CreateInfrastructureConfigurationResponse
-> Rep CreateInfrastructureConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInfrastructureConfigurationResponse x
-> CreateInfrastructureConfigurationResponse
$cfrom :: forall x.
CreateInfrastructureConfigurationResponse
-> Rep CreateInfrastructureConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateInfrastructureConfigurationResponse' 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:
--
-- 'requestId', 'createInfrastructureConfigurationResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'infrastructureConfigurationArn', 'createInfrastructureConfigurationResponse_infrastructureConfigurationArn' - The Amazon Resource Name (ARN) of the infrastructure configuration that
-- was created by this request.
--
-- 'clientToken', 'createInfrastructureConfigurationResponse_clientToken' - The idempotency token used to make this request idempotent.
--
-- 'httpStatus', 'createInfrastructureConfigurationResponse_httpStatus' - The response's http status code.
newCreateInfrastructureConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateInfrastructureConfigurationResponse
newCreateInfrastructureConfigurationResponse :: Int -> CreateInfrastructureConfigurationResponse
newCreateInfrastructureConfigurationResponse
  Int
pHttpStatus_ =
    CreateInfrastructureConfigurationResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateInfrastructureConfigurationResponse
CreateInfrastructureConfigurationResponse'
      { $sel:requestId:CreateInfrastructureConfigurationResponse' :: Maybe Text
requestId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:infrastructureConfigurationArn:CreateInfrastructureConfigurationResponse' :: Maybe Text
infrastructureConfigurationArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:CreateInfrastructureConfigurationResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateInfrastructureConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The request ID that uniquely identifies this request.
createInfrastructureConfigurationResponse_requestId :: Lens.Lens' CreateInfrastructureConfigurationResponse (Prelude.Maybe Prelude.Text)
createInfrastructureConfigurationResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfigurationResponse
-> f CreateInfrastructureConfigurationResponse
createInfrastructureConfigurationResponse_requestId = (CreateInfrastructureConfigurationResponse -> Maybe Text)
-> (CreateInfrastructureConfigurationResponse
    -> Maybe Text -> CreateInfrastructureConfigurationResponse)
-> Lens
     CreateInfrastructureConfigurationResponse
     CreateInfrastructureConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfigurationResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateInfrastructureConfigurationResponse' :: CreateInfrastructureConfigurationResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateInfrastructureConfigurationResponse
s@CreateInfrastructureConfigurationResponse' {} Maybe Text
a -> CreateInfrastructureConfigurationResponse
s {$sel:requestId:CreateInfrastructureConfigurationResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateInfrastructureConfigurationResponse)

-- | The Amazon Resource Name (ARN) of the infrastructure configuration that
-- was created by this request.
createInfrastructureConfigurationResponse_infrastructureConfigurationArn :: Lens.Lens' CreateInfrastructureConfigurationResponse (Prelude.Maybe Prelude.Text)
createInfrastructureConfigurationResponse_infrastructureConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfigurationResponse
-> f CreateInfrastructureConfigurationResponse
createInfrastructureConfigurationResponse_infrastructureConfigurationArn = (CreateInfrastructureConfigurationResponse -> Maybe Text)
-> (CreateInfrastructureConfigurationResponse
    -> Maybe Text -> CreateInfrastructureConfigurationResponse)
-> Lens
     CreateInfrastructureConfigurationResponse
     CreateInfrastructureConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfigurationResponse' {Maybe Text
infrastructureConfigurationArn :: Maybe Text
$sel:infrastructureConfigurationArn:CreateInfrastructureConfigurationResponse' :: CreateInfrastructureConfigurationResponse -> Maybe Text
infrastructureConfigurationArn} -> Maybe Text
infrastructureConfigurationArn) (\s :: CreateInfrastructureConfigurationResponse
s@CreateInfrastructureConfigurationResponse' {} Maybe Text
a -> CreateInfrastructureConfigurationResponse
s {$sel:infrastructureConfigurationArn:CreateInfrastructureConfigurationResponse' :: Maybe Text
infrastructureConfigurationArn = Maybe Text
a} :: CreateInfrastructureConfigurationResponse)

-- | The idempotency token used to make this request idempotent.
createInfrastructureConfigurationResponse_clientToken :: Lens.Lens' CreateInfrastructureConfigurationResponse (Prelude.Maybe Prelude.Text)
createInfrastructureConfigurationResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateInfrastructureConfigurationResponse
-> f CreateInfrastructureConfigurationResponse
createInfrastructureConfigurationResponse_clientToken = (CreateInfrastructureConfigurationResponse -> Maybe Text)
-> (CreateInfrastructureConfigurationResponse
    -> Maybe Text -> CreateInfrastructureConfigurationResponse)
-> Lens
     CreateInfrastructureConfigurationResponse
     CreateInfrastructureConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfigurationResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateInfrastructureConfigurationResponse' :: CreateInfrastructureConfigurationResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateInfrastructureConfigurationResponse
s@CreateInfrastructureConfigurationResponse' {} Maybe Text
a -> CreateInfrastructureConfigurationResponse
s {$sel:clientToken:CreateInfrastructureConfigurationResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateInfrastructureConfigurationResponse)

-- | The response's http status code.
createInfrastructureConfigurationResponse_httpStatus :: Lens.Lens' CreateInfrastructureConfigurationResponse Prelude.Int
createInfrastructureConfigurationResponse_httpStatus :: (Int -> f Int)
-> CreateInfrastructureConfigurationResponse
-> f CreateInfrastructureConfigurationResponse
createInfrastructureConfigurationResponse_httpStatus = (CreateInfrastructureConfigurationResponse -> Int)
-> (CreateInfrastructureConfigurationResponse
    -> Int -> CreateInfrastructureConfigurationResponse)
-> Lens
     CreateInfrastructureConfigurationResponse
     CreateInfrastructureConfigurationResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInfrastructureConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateInfrastructureConfigurationResponse' :: CreateInfrastructureConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateInfrastructureConfigurationResponse
s@CreateInfrastructureConfigurationResponse' {} Int
a -> CreateInfrastructureConfigurationResponse
s {$sel:httpStatus:CreateInfrastructureConfigurationResponse' :: Int
httpStatus = Int
a} :: CreateInfrastructureConfigurationResponse)

instance
  Prelude.NFData
    CreateInfrastructureConfigurationResponse