{-# 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.UpdateInfrastructureConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a new infrastructure configuration. An infrastructure
-- configuration defines the environment in which your image will be built
-- and tested.
module Amazonka.ImageBuilder.UpdateInfrastructureConfiguration
  ( -- * Creating a Request
    UpdateInfrastructureConfiguration (..),
    newUpdateInfrastructureConfiguration,

    -- * Request Lenses
    updateInfrastructureConfiguration_description,
    updateInfrastructureConfiguration_instanceMetadataOptions,
    updateInfrastructureConfiguration_instanceTypes,
    updateInfrastructureConfiguration_keyPair,
    updateInfrastructureConfiguration_logging,
    updateInfrastructureConfiguration_resourceTags,
    updateInfrastructureConfiguration_securityGroupIds,
    updateInfrastructureConfiguration_snsTopicArn,
    updateInfrastructureConfiguration_subnetId,
    updateInfrastructureConfiguration_terminateInstanceOnFailure,
    updateInfrastructureConfiguration_infrastructureConfigurationArn,
    updateInfrastructureConfiguration_instanceProfileName,
    updateInfrastructureConfiguration_clientToken,

    -- * Destructuring the Response
    UpdateInfrastructureConfigurationResponse (..),
    newUpdateInfrastructureConfigurationResponse,

    -- * Response Lenses
    updateInfrastructureConfigurationResponse_clientToken,
    updateInfrastructureConfigurationResponse_infrastructureConfigurationArn,
    updateInfrastructureConfigurationResponse_requestId,
    updateInfrastructureConfigurationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateInfrastructureConfiguration' smart constructor.
data UpdateInfrastructureConfiguration = UpdateInfrastructureConfiguration'
  { -- | The description of the infrastructure configuration.
    UpdateInfrastructureConfiguration -> Maybe Text
description :: 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. For
    -- more information about instance metadata options, see one of the
    -- following links:
    --
    -- -   <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
    --     in the //Amazon EC2 User Guide// for Linux instances.
    --
    -- -   <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
    --     in the //Amazon EC2 Windows Guide// for Windows instances.
    UpdateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
instanceMetadataOptions :: Prelude.Maybe InstanceMetadataOptions,
    -- | 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.
    UpdateInfrastructureConfiguration -> 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.
    UpdateInfrastructureConfiguration -> Maybe Text
keyPair :: Prelude.Maybe Prelude.Text,
    -- | The logging configuration of the infrastructure configuration.
    UpdateInfrastructureConfiguration -> Maybe Logging
logging :: Prelude.Maybe Logging,
    -- | The tags attached to the resource created by Image Builder.
    UpdateInfrastructureConfiguration -> Maybe (HashMap Text Text)
resourceTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The security group IDs to associate with the instance used to customize
    -- your Amazon EC2 AMI.
    UpdateInfrastructureConfiguration -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) for the SNS topic to which we send image
    -- build event notifications.
    --
    -- EC2 Image Builder is unable to send notifications to SNS topics that are
    -- encrypted using keys from other accounts. The key that is used to
    -- encrypt the SNS topic must reside in the account that the Image Builder
    -- service runs under.
    UpdateInfrastructureConfiguration -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The subnet ID to place the instance used to customize your Amazon EC2
    -- AMI in.
    UpdateInfrastructureConfiguration -> Maybe Text
subnetId :: Prelude.Maybe 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.
    UpdateInfrastructureConfiguration -> Maybe Bool
terminateInstanceOnFailure :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of the infrastructure configuration that
    -- you want to update.
    UpdateInfrastructureConfiguration -> Text
infrastructureConfigurationArn :: Prelude.Text,
    -- | The instance profile to associate with the instance used to customize
    -- your Amazon EC2 AMI.
    UpdateInfrastructureConfiguration -> Text
instanceProfileName :: Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    UpdateInfrastructureConfiguration -> Text
clientToken :: Prelude.Text
  }
  deriving (UpdateInfrastructureConfiguration
-> UpdateInfrastructureConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInfrastructureConfiguration
-> UpdateInfrastructureConfiguration -> Bool
$c/= :: UpdateInfrastructureConfiguration
-> UpdateInfrastructureConfiguration -> Bool
== :: UpdateInfrastructureConfiguration
-> UpdateInfrastructureConfiguration -> Bool
$c== :: UpdateInfrastructureConfiguration
-> UpdateInfrastructureConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateInfrastructureConfiguration]
ReadPrec UpdateInfrastructureConfiguration
Int -> ReadS UpdateInfrastructureConfiguration
ReadS [UpdateInfrastructureConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInfrastructureConfiguration]
$creadListPrec :: ReadPrec [UpdateInfrastructureConfiguration]
readPrec :: ReadPrec UpdateInfrastructureConfiguration
$creadPrec :: ReadPrec UpdateInfrastructureConfiguration
readList :: ReadS [UpdateInfrastructureConfiguration]
$creadList :: ReadS [UpdateInfrastructureConfiguration]
readsPrec :: Int -> ReadS UpdateInfrastructureConfiguration
$creadsPrec :: Int -> ReadS UpdateInfrastructureConfiguration
Prelude.Read, Int -> UpdateInfrastructureConfiguration -> ShowS
[UpdateInfrastructureConfiguration] -> ShowS
UpdateInfrastructureConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInfrastructureConfiguration] -> ShowS
$cshowList :: [UpdateInfrastructureConfiguration] -> ShowS
show :: UpdateInfrastructureConfiguration -> String
$cshow :: UpdateInfrastructureConfiguration -> String
showsPrec :: Int -> UpdateInfrastructureConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateInfrastructureConfiguration -> ShowS
Prelude.Show, forall x.
Rep UpdateInfrastructureConfiguration x
-> UpdateInfrastructureConfiguration
forall x.
UpdateInfrastructureConfiguration
-> Rep UpdateInfrastructureConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateInfrastructureConfiguration x
-> UpdateInfrastructureConfiguration
$cfrom :: forall x.
UpdateInfrastructureConfiguration
-> Rep UpdateInfrastructureConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateInfrastructureConfiguration' 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:
--
-- 'description', 'updateInfrastructureConfiguration_description' - The description of the infrastructure configuration.
--
-- 'instanceMetadataOptions', 'updateInfrastructureConfiguration_instanceMetadataOptions' - The instance metadata options that you can set for the HTTP requests
-- that pipeline builds use to launch EC2 build and test instances. For
-- more information about instance metadata options, see one of the
-- following links:
--
-- -   <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
--     in the //Amazon EC2 User Guide// for Linux instances.
--
-- -   <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
--     in the //Amazon EC2 Windows Guide// for Windows instances.
--
-- 'instanceTypes', 'updateInfrastructureConfiguration_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', 'updateInfrastructureConfiguration_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.
--
-- 'logging', 'updateInfrastructureConfiguration_logging' - The logging configuration of the infrastructure configuration.
--
-- 'resourceTags', 'updateInfrastructureConfiguration_resourceTags' - The tags attached to the resource created by Image Builder.
--
-- 'securityGroupIds', 'updateInfrastructureConfiguration_securityGroupIds' - The security group IDs to associate with the instance used to customize
-- your Amazon EC2 AMI.
--
-- 'snsTopicArn', 'updateInfrastructureConfiguration_snsTopicArn' - The Amazon Resource Name (ARN) for the SNS topic to which we send image
-- build event notifications.
--
-- EC2 Image Builder is unable to send notifications to SNS topics that are
-- encrypted using keys from other accounts. The key that is used to
-- encrypt the SNS topic must reside in the account that the Image Builder
-- service runs under.
--
-- 'subnetId', 'updateInfrastructureConfiguration_subnetId' - The subnet ID to place the instance used to customize your Amazon EC2
-- AMI in.
--
-- 'terminateInstanceOnFailure', 'updateInfrastructureConfiguration_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.
--
-- 'infrastructureConfigurationArn', 'updateInfrastructureConfiguration_infrastructureConfigurationArn' - The Amazon Resource Name (ARN) of the infrastructure configuration that
-- you want to update.
--
-- 'instanceProfileName', 'updateInfrastructureConfiguration_instanceProfileName' - The instance profile to associate with the instance used to customize
-- your Amazon EC2 AMI.
--
-- 'clientToken', 'updateInfrastructureConfiguration_clientToken' - The idempotency token used to make this request idempotent.
newUpdateInfrastructureConfiguration ::
  -- | 'infrastructureConfigurationArn'
  Prelude.Text ->
  -- | 'instanceProfileName'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  UpdateInfrastructureConfiguration
newUpdateInfrastructureConfiguration :: Text -> Text -> Text -> UpdateInfrastructureConfiguration
newUpdateInfrastructureConfiguration
  Text
pInfrastructureConfigurationArn_
  Text
pInstanceProfileName_
  Text
pClientToken_ =
    UpdateInfrastructureConfiguration'
      { $sel:description:UpdateInfrastructureConfiguration' :: Maybe Text
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: Maybe InstanceMetadataOptions
instanceMetadataOptions =
          forall a. Maybe a
Prelude.Nothing,
        $sel:instanceTypes:UpdateInfrastructureConfiguration' :: Maybe [Text]
instanceTypes = forall a. Maybe a
Prelude.Nothing,
        $sel:keyPair:UpdateInfrastructureConfiguration' :: Maybe Text
keyPair = forall a. Maybe a
Prelude.Nothing,
        $sel:logging:UpdateInfrastructureConfiguration' :: Maybe Logging
logging = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceTags:UpdateInfrastructureConfiguration' :: Maybe (HashMap Text Text)
resourceTags = forall a. Maybe a
Prelude.Nothing,
        $sel:securityGroupIds:UpdateInfrastructureConfiguration' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
        $sel:snsTopicArn:UpdateInfrastructureConfiguration' :: Maybe Text
snsTopicArn = forall a. Maybe a
Prelude.Nothing,
        $sel:subnetId:UpdateInfrastructureConfiguration' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing,
        $sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: Maybe Bool
terminateInstanceOnFailure =
          forall a. Maybe a
Prelude.Nothing,
        $sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: Text
infrastructureConfigurationArn =
          Text
pInfrastructureConfigurationArn_,
        $sel:instanceProfileName:UpdateInfrastructureConfiguration' :: Text
instanceProfileName =
          Text
pInstanceProfileName_,
        $sel:clientToken:UpdateInfrastructureConfiguration' :: Text
clientToken = Text
pClientToken_
      }

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

-- | The instance metadata options that you can set for the HTTP requests
-- that pipeline builds use to launch EC2 build and test instances. For
-- more information about instance metadata options, see one of the
-- following links:
--
-- -   <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
--     in the //Amazon EC2 User Guide// for Linux instances.
--
-- -   <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html Configure the instance metadata options>
--     in the //Amazon EC2 Windows Guide// for Windows instances.
updateInfrastructureConfiguration_instanceMetadataOptions :: Lens.Lens' UpdateInfrastructureConfiguration (Prelude.Maybe InstanceMetadataOptions)
updateInfrastructureConfiguration_instanceMetadataOptions :: Lens'
  UpdateInfrastructureConfiguration (Maybe InstanceMetadataOptions)
updateInfrastructureConfiguration_instanceMetadataOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInfrastructureConfiguration' {Maybe InstanceMetadataOptions
instanceMetadataOptions :: Maybe InstanceMetadataOptions
$sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
instanceMetadataOptions} -> Maybe InstanceMetadataOptions
instanceMetadataOptions) (\s :: UpdateInfrastructureConfiguration
s@UpdateInfrastructureConfiguration' {} Maybe InstanceMetadataOptions
a -> UpdateInfrastructureConfiguration
s {$sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: Maybe InstanceMetadataOptions
instanceMetadataOptions = Maybe InstanceMetadataOptions
a} :: UpdateInfrastructureConfiguration)

-- | 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.
updateInfrastructureConfiguration_instanceTypes :: Lens.Lens' UpdateInfrastructureConfiguration (Prelude.Maybe [Prelude.Text])
updateInfrastructureConfiguration_instanceTypes :: Lens' UpdateInfrastructureConfiguration (Maybe [Text])
updateInfrastructureConfiguration_instanceTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInfrastructureConfiguration' {Maybe [Text]
instanceTypes :: Maybe [Text]
$sel:instanceTypes:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
instanceTypes} -> Maybe [Text]
instanceTypes) (\s :: UpdateInfrastructureConfiguration
s@UpdateInfrastructureConfiguration' {} Maybe [Text]
a -> UpdateInfrastructureConfiguration
s {$sel:instanceTypes:UpdateInfrastructureConfiguration' :: Maybe [Text]
instanceTypes = Maybe [Text]
a} :: UpdateInfrastructureConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

-- | The Amazon Resource Name (ARN) for the SNS topic to which we send image
-- build event notifications.
--
-- EC2 Image Builder is unable to send notifications to SNS topics that are
-- encrypted using keys from other accounts. The key that is used to
-- encrypt the SNS topic must reside in the account that the Image Builder
-- service runs under.
updateInfrastructureConfiguration_snsTopicArn :: Lens.Lens' UpdateInfrastructureConfiguration (Prelude.Maybe Prelude.Text)
updateInfrastructureConfiguration_snsTopicArn :: Lens' UpdateInfrastructureConfiguration (Maybe Text)
updateInfrastructureConfiguration_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInfrastructureConfiguration' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: UpdateInfrastructureConfiguration
s@UpdateInfrastructureConfiguration' {} Maybe Text
a -> UpdateInfrastructureConfiguration
s {$sel:snsTopicArn:UpdateInfrastructureConfiguration' :: Maybe Text
snsTopicArn = Maybe Text
a} :: UpdateInfrastructureConfiguration)

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

-- | 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.
updateInfrastructureConfiguration_terminateInstanceOnFailure :: Lens.Lens' UpdateInfrastructureConfiguration (Prelude.Maybe Prelude.Bool)
updateInfrastructureConfiguration_terminateInstanceOnFailure :: Lens' UpdateInfrastructureConfiguration (Maybe Bool)
updateInfrastructureConfiguration_terminateInstanceOnFailure = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInfrastructureConfiguration' {Maybe Bool
terminateInstanceOnFailure :: Maybe Bool
$sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Bool
terminateInstanceOnFailure} -> Maybe Bool
terminateInstanceOnFailure) (\s :: UpdateInfrastructureConfiguration
s@UpdateInfrastructureConfiguration' {} Maybe Bool
a -> UpdateInfrastructureConfiguration
s {$sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: Maybe Bool
terminateInstanceOnFailure = Maybe Bool
a} :: UpdateInfrastructureConfiguration)

-- | The Amazon Resource Name (ARN) of the infrastructure configuration that
-- you want to update.
updateInfrastructureConfiguration_infrastructureConfigurationArn :: Lens.Lens' UpdateInfrastructureConfiguration Prelude.Text
updateInfrastructureConfiguration_infrastructureConfigurationArn :: Lens' UpdateInfrastructureConfiguration Text
updateInfrastructureConfiguration_infrastructureConfigurationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInfrastructureConfiguration' {Text
infrastructureConfigurationArn :: Text
$sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
infrastructureConfigurationArn} -> Text
infrastructureConfigurationArn) (\s :: UpdateInfrastructureConfiguration
s@UpdateInfrastructureConfiguration' {} Text
a -> UpdateInfrastructureConfiguration
s {$sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: Text
infrastructureConfigurationArn = Text
a} :: UpdateInfrastructureConfiguration)

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

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

instance
  Core.AWSRequest
    UpdateInfrastructureConfiguration
  where
  type
    AWSResponse UpdateInfrastructureConfiguration =
      UpdateInfrastructureConfigurationResponse
  request :: (Service -> Service)
-> UpdateInfrastructureConfiguration
-> Request UpdateInfrastructureConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateInfrastructureConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateInfrastructureConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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
-> UpdateInfrastructureConfigurationResponse
UpdateInfrastructureConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"clientToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"infrastructureConfigurationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"requestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateInfrastructureConfiguration
  where
  hashWithSalt :: Int -> UpdateInfrastructureConfiguration -> Int
hashWithSalt
    Int
_salt
    UpdateInfrastructureConfiguration' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe InstanceMetadataOptions
Maybe Logging
Text
clientToken :: Text
instanceProfileName :: Text
infrastructureConfigurationArn :: Text
terminateInstanceOnFailure :: Maybe Bool
subnetId :: Maybe Text
snsTopicArn :: Maybe Text
securityGroupIds :: Maybe [Text]
resourceTags :: Maybe (HashMap Text Text)
logging :: Maybe Logging
keyPair :: Maybe Text
instanceTypes :: Maybe [Text]
instanceMetadataOptions :: Maybe InstanceMetadataOptions
description :: Maybe Text
$sel:clientToken:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:instanceProfileName:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Bool
$sel:subnetId:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:snsTopicArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:securityGroupIds:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:resourceTags:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe (HashMap Text Text)
$sel:logging:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Logging
$sel:keyPair:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:instanceTypes:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
$sel:description:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceMetadataOptions
instanceMetadataOptions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
instanceTypes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
keyPair
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Logging
logging
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
resourceTags
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopicArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
terminateInstanceOnFailure
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
infrastructureConfigurationArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceProfileName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken

instance
  Prelude.NFData
    UpdateInfrastructureConfiguration
  where
  rnf :: UpdateInfrastructureConfiguration -> ()
rnf UpdateInfrastructureConfiguration' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe InstanceMetadataOptions
Maybe Logging
Text
clientToken :: Text
instanceProfileName :: Text
infrastructureConfigurationArn :: Text
terminateInstanceOnFailure :: Maybe Bool
subnetId :: Maybe Text
snsTopicArn :: Maybe Text
securityGroupIds :: Maybe [Text]
resourceTags :: Maybe (HashMap Text Text)
logging :: Maybe Logging
keyPair :: Maybe Text
instanceTypes :: Maybe [Text]
instanceMetadataOptions :: Maybe InstanceMetadataOptions
description :: Maybe Text
$sel:clientToken:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:instanceProfileName:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Bool
$sel:subnetId:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:snsTopicArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:securityGroupIds:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:resourceTags:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe (HashMap Text Text)
$sel:logging:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Logging
$sel:keyPair:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:instanceTypes:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
$sel:description:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceMetadataOptions
instanceMetadataOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
keyPair
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Logging
logging
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
resourceTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
terminateInstanceOnFailure
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
infrastructureConfigurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken

instance
  Data.ToHeaders
    UpdateInfrastructureConfiguration
  where
  toHeaders :: UpdateInfrastructureConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    UpdateInfrastructureConfiguration
  where
  toJSON :: UpdateInfrastructureConfiguration -> Value
toJSON UpdateInfrastructureConfiguration' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe InstanceMetadataOptions
Maybe Logging
Text
clientToken :: Text
instanceProfileName :: Text
infrastructureConfigurationArn :: Text
terminateInstanceOnFailure :: Maybe Bool
subnetId :: Maybe Text
snsTopicArn :: Maybe Text
securityGroupIds :: Maybe [Text]
resourceTags :: Maybe (HashMap Text Text)
logging :: Maybe Logging
keyPair :: Maybe Text
instanceTypes :: Maybe [Text]
instanceMetadataOptions :: Maybe InstanceMetadataOptions
description :: Maybe Text
$sel:clientToken:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:instanceProfileName:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:infrastructureConfigurationArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Text
$sel:terminateInstanceOnFailure:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Bool
$sel:subnetId:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:snsTopicArn:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:securityGroupIds:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:resourceTags:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe (HashMap Text Text)
$sel:logging:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Logging
$sel:keyPair:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
$sel:instanceTypes:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe [Text]
$sel:instanceMetadataOptions:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe InstanceMetadataOptions
$sel:description:UpdateInfrastructureConfiguration' :: UpdateInfrastructureConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"instanceMetadataOptions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceMetadataOptions
instanceMetadataOptions,
            (Key
"instanceTypes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
instanceTypes,
            (Key
"keyPair" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
keyPair,
            (Key
"logging" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Logging
logging,
            (Key
"resourceTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
resourceTags,
            (Key
"securityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
            (Key
"snsTopicArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicArn,
            (Key
"subnetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subnetId,
            (Key
"terminateInstanceOnFailure" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
terminateInstanceOnFailure,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"infrastructureConfigurationArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
infrastructureConfigurationArn
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"instanceProfileName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceProfileName),
            forall a. a -> Maybe a
Prelude.Just (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken)
          ]
      )

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

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

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

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

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

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

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

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

instance
  Prelude.NFData
    UpdateInfrastructureConfigurationResponse
  where
  rnf :: UpdateInfrastructureConfigurationResponse -> ()
rnf UpdateInfrastructureConfigurationResponse' {Int
Maybe Text
httpStatus :: Int
requestId :: Maybe Text
infrastructureConfigurationArn :: Maybe Text
clientToken :: Maybe Text
$sel:httpStatus:UpdateInfrastructureConfigurationResponse' :: UpdateInfrastructureConfigurationResponse -> Int
$sel:requestId:UpdateInfrastructureConfigurationResponse' :: UpdateInfrastructureConfigurationResponse -> Maybe Text
$sel:infrastructureConfigurationArn:UpdateInfrastructureConfigurationResponse' :: UpdateInfrastructureConfigurationResponse -> Maybe Text
$sel:clientToken:UpdateInfrastructureConfigurationResponse' :: UpdateInfrastructureConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
infrastructureConfigurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus