{-# 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.OpsWorks.UpdateLayer
-- 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)
--
-- Updates a specified layer.
--
-- __Required Permissions__: To use this action, an IAM user must have a
-- Manage permissions level for the stack, or an attached policy that
-- explicitly grants permissions. For more information on user permissions,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html Managing User Permissions>.
module Amazonka.OpsWorks.UpdateLayer
  ( -- * Creating a Request
    UpdateLayer (..),
    newUpdateLayer,

    -- * Request Lenses
    updateLayer_customInstanceProfileArn,
    updateLayer_customSecurityGroupIds,
    updateLayer_installUpdatesOnBoot,
    updateLayer_cloudWatchLogsConfiguration,
    updateLayer_lifecycleEventConfiguration,
    updateLayer_shortname,
    updateLayer_customRecipes,
    updateLayer_customJson,
    updateLayer_volumeConfigurations,
    updateLayer_enableAutoHealing,
    updateLayer_packages,
    updateLayer_attributes,
    updateLayer_name,
    updateLayer_autoAssignPublicIps,
    updateLayer_useEbsOptimizedInstances,
    updateLayer_autoAssignElasticIps,
    updateLayer_layerId,

    -- * Destructuring the Response
    UpdateLayerResponse (..),
    newUpdateLayerResponse,
  )
where

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

-- | /See:/ 'newUpdateLayer' smart constructor.
data UpdateLayer = UpdateLayer'
  { -- | The ARN of an IAM profile to be used for all of the layer\'s EC2
    -- instances. For more information about IAM ARNs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
    UpdateLayer -> Maybe Text
customInstanceProfileArn :: Prelude.Maybe Prelude.Text,
    -- | An array containing the layer\'s custom security group IDs.
    UpdateLayer -> Maybe [Text]
customSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Whether to install operating system and package updates when the
    -- instance boots. The default value is @true@. To control when updates are
    -- installed, set this value to @false@. You must then update your
    -- instances manually by using CreateDeployment to run the
    -- @update_dependencies@ stack command or manually running @yum@ (Amazon
    -- Linux) or @apt-get@ (Ubuntu) on the instances.
    --
    -- We strongly recommend using the default value of @true@, to ensure that
    -- your instances have the latest security updates.
    UpdateLayer -> Maybe Bool
installUpdatesOnBoot :: Prelude.Maybe Prelude.Bool,
    -- | Specifies CloudWatch Logs configuration options for the layer. For more
    -- information, see CloudWatchLogsLogStream.
    UpdateLayer -> Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration :: Prelude.Maybe CloudWatchLogsConfiguration,
    UpdateLayer -> Maybe LifecycleEventConfiguration
lifecycleEventConfiguration :: Prelude.Maybe LifecycleEventConfiguration,
    -- | For custom layers only, use this parameter to specify the layer\'s short
    -- name, which is used internally by AWS OpsWorks Stacks and by Chef. The
    -- short name is also used as the name for the directory where your app
    -- files are installed. It can have a maximum of 200 characters and must be
    -- in the following format: \/\\A[a-z0-9\\-\\_\\.]+\\Z\/.
    --
    -- The built-in layers\' short names are defined by AWS OpsWorks Stacks.
    -- For more information, see the
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html Layer Reference>
    UpdateLayer -> Maybe Text
shortname :: Prelude.Maybe Prelude.Text,
    -- | A @LayerCustomRecipes@ object that specifies the layer\'s custom
    -- recipes.
    UpdateLayer -> Maybe Recipes
customRecipes :: Prelude.Maybe Recipes,
    -- | A JSON-formatted string containing custom stack configuration and
    -- deployment attributes to be installed on the layer\'s instances. For
    -- more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html Using Custom JSON>.
    UpdateLayer -> Maybe Text
customJson :: Prelude.Maybe Prelude.Text,
    -- | A @VolumeConfigurations@ object that describes the layer\'s Amazon EBS
    -- volumes.
    UpdateLayer -> Maybe [VolumeConfiguration]
volumeConfigurations :: Prelude.Maybe [VolumeConfiguration],
    -- | Whether to disable auto healing for the layer.
    UpdateLayer -> Maybe Bool
enableAutoHealing :: Prelude.Maybe Prelude.Bool,
    -- | An array of @Package@ objects that describe the layer\'s packages.
    UpdateLayer -> Maybe [Text]
packages :: Prelude.Maybe [Prelude.Text],
    -- | One or more user-defined key\/value pairs to be added to the stack
    -- attributes.
    UpdateLayer -> Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes :: Prelude.Maybe (Prelude.HashMap LayerAttributesKeys (Prelude.Maybe Prelude.Text)),
    -- | The layer name, which is used by the console.
    UpdateLayer -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | For stacks that are running in a VPC, whether to automatically assign a
    -- public IP address to the layer\'s instances. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
    UpdateLayer -> Maybe Bool
autoAssignPublicIps :: Prelude.Maybe Prelude.Bool,
    -- | Whether to use Amazon EBS-optimized instances.
    UpdateLayer -> Maybe Bool
useEbsOptimizedInstances :: Prelude.Maybe Prelude.Bool,
    -- | Whether to automatically assign an
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html Elastic IP address>
    -- to the layer\'s instances. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
    UpdateLayer -> Maybe Bool
autoAssignElasticIps :: Prelude.Maybe Prelude.Bool,
    -- | The layer ID.
    UpdateLayer -> Text
layerId :: Prelude.Text
  }
  deriving (UpdateLayer -> UpdateLayer -> Bool
(UpdateLayer -> UpdateLayer -> Bool)
-> (UpdateLayer -> UpdateLayer -> Bool) -> Eq UpdateLayer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLayer -> UpdateLayer -> Bool
$c/= :: UpdateLayer -> UpdateLayer -> Bool
== :: UpdateLayer -> UpdateLayer -> Bool
$c== :: UpdateLayer -> UpdateLayer -> Bool
Prelude.Eq, ReadPrec [UpdateLayer]
ReadPrec UpdateLayer
Int -> ReadS UpdateLayer
ReadS [UpdateLayer]
(Int -> ReadS UpdateLayer)
-> ReadS [UpdateLayer]
-> ReadPrec UpdateLayer
-> ReadPrec [UpdateLayer]
-> Read UpdateLayer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLayer]
$creadListPrec :: ReadPrec [UpdateLayer]
readPrec :: ReadPrec UpdateLayer
$creadPrec :: ReadPrec UpdateLayer
readList :: ReadS [UpdateLayer]
$creadList :: ReadS [UpdateLayer]
readsPrec :: Int -> ReadS UpdateLayer
$creadsPrec :: Int -> ReadS UpdateLayer
Prelude.Read, Int -> UpdateLayer -> ShowS
[UpdateLayer] -> ShowS
UpdateLayer -> String
(Int -> UpdateLayer -> ShowS)
-> (UpdateLayer -> String)
-> ([UpdateLayer] -> ShowS)
-> Show UpdateLayer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLayer] -> ShowS
$cshowList :: [UpdateLayer] -> ShowS
show :: UpdateLayer -> String
$cshow :: UpdateLayer -> String
showsPrec :: Int -> UpdateLayer -> ShowS
$cshowsPrec :: Int -> UpdateLayer -> ShowS
Prelude.Show, (forall x. UpdateLayer -> Rep UpdateLayer x)
-> (forall x. Rep UpdateLayer x -> UpdateLayer)
-> Generic UpdateLayer
forall x. Rep UpdateLayer x -> UpdateLayer
forall x. UpdateLayer -> Rep UpdateLayer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLayer x -> UpdateLayer
$cfrom :: forall x. UpdateLayer -> Rep UpdateLayer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLayer' 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:
--
-- 'customInstanceProfileArn', 'updateLayer_customInstanceProfileArn' - The ARN of an IAM profile to be used for all of the layer\'s EC2
-- instances. For more information about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
--
-- 'customSecurityGroupIds', 'updateLayer_customSecurityGroupIds' - An array containing the layer\'s custom security group IDs.
--
-- 'installUpdatesOnBoot', 'updateLayer_installUpdatesOnBoot' - Whether to install operating system and package updates when the
-- instance boots. The default value is @true@. To control when updates are
-- installed, set this value to @false@. You must then update your
-- instances manually by using CreateDeployment to run the
-- @update_dependencies@ stack command or manually running @yum@ (Amazon
-- Linux) or @apt-get@ (Ubuntu) on the instances.
--
-- We strongly recommend using the default value of @true@, to ensure that
-- your instances have the latest security updates.
--
-- 'cloudWatchLogsConfiguration', 'updateLayer_cloudWatchLogsConfiguration' - Specifies CloudWatch Logs configuration options for the layer. For more
-- information, see CloudWatchLogsLogStream.
--
-- 'lifecycleEventConfiguration', 'updateLayer_lifecycleEventConfiguration' -
--
-- 'shortname', 'updateLayer_shortname' - For custom layers only, use this parameter to specify the layer\'s short
-- name, which is used internally by AWS OpsWorks Stacks and by Chef. The
-- short name is also used as the name for the directory where your app
-- files are installed. It can have a maximum of 200 characters and must be
-- in the following format: \/\\A[a-z0-9\\-\\_\\.]+\\Z\/.
--
-- The built-in layers\' short names are defined by AWS OpsWorks Stacks.
-- For more information, see the
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html Layer Reference>
--
-- 'customRecipes', 'updateLayer_customRecipes' - A @LayerCustomRecipes@ object that specifies the layer\'s custom
-- recipes.
--
-- 'customJson', 'updateLayer_customJson' - A JSON-formatted string containing custom stack configuration and
-- deployment attributes to be installed on the layer\'s instances. For
-- more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html Using Custom JSON>.
--
-- 'volumeConfigurations', 'updateLayer_volumeConfigurations' - A @VolumeConfigurations@ object that describes the layer\'s Amazon EBS
-- volumes.
--
-- 'enableAutoHealing', 'updateLayer_enableAutoHealing' - Whether to disable auto healing for the layer.
--
-- 'packages', 'updateLayer_packages' - An array of @Package@ objects that describe the layer\'s packages.
--
-- 'attributes', 'updateLayer_attributes' - One or more user-defined key\/value pairs to be added to the stack
-- attributes.
--
-- 'name', 'updateLayer_name' - The layer name, which is used by the console.
--
-- 'autoAssignPublicIps', 'updateLayer_autoAssignPublicIps' - For stacks that are running in a VPC, whether to automatically assign a
-- public IP address to the layer\'s instances. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
--
-- 'useEbsOptimizedInstances', 'updateLayer_useEbsOptimizedInstances' - Whether to use Amazon EBS-optimized instances.
--
-- 'autoAssignElasticIps', 'updateLayer_autoAssignElasticIps' - Whether to automatically assign an
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html Elastic IP address>
-- to the layer\'s instances. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
--
-- 'layerId', 'updateLayer_layerId' - The layer ID.
newUpdateLayer ::
  -- | 'layerId'
  Prelude.Text ->
  UpdateLayer
newUpdateLayer :: Text -> UpdateLayer
newUpdateLayer Text
pLayerId_ =
  UpdateLayer' :: Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe CloudWatchLogsConfiguration
-> Maybe LifecycleEventConfiguration
-> Maybe Text
-> Maybe Recipes
-> Maybe Text
-> Maybe [VolumeConfiguration]
-> Maybe Bool
-> Maybe [Text]
-> Maybe (HashMap LayerAttributesKeys (Maybe Text))
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Text
-> UpdateLayer
UpdateLayer'
    { $sel:customInstanceProfileArn:UpdateLayer' :: Maybe Text
customInstanceProfileArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customSecurityGroupIds:UpdateLayer' :: Maybe [Text]
customSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:installUpdatesOnBoot:UpdateLayer' :: Maybe Bool
installUpdatesOnBoot = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogsConfiguration:UpdateLayer' :: Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration = Maybe CloudWatchLogsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycleEventConfiguration:UpdateLayer' :: Maybe LifecycleEventConfiguration
lifecycleEventConfiguration = Maybe LifecycleEventConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:shortname:UpdateLayer' :: Maybe Text
shortname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customRecipes:UpdateLayer' :: Maybe Recipes
customRecipes = Maybe Recipes
forall a. Maybe a
Prelude.Nothing,
      $sel:customJson:UpdateLayer' :: Maybe Text
customJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeConfigurations:UpdateLayer' :: Maybe [VolumeConfiguration]
volumeConfigurations = Maybe [VolumeConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAutoHealing:UpdateLayer' :: Maybe Bool
enableAutoHealing = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:packages:UpdateLayer' :: Maybe [Text]
packages = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:UpdateLayer' :: Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes = Maybe (HashMap LayerAttributesKeys (Maybe Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateLayer' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoAssignPublicIps:UpdateLayer' :: Maybe Bool
autoAssignPublicIps = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:useEbsOptimizedInstances:UpdateLayer' :: Maybe Bool
useEbsOptimizedInstances = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:autoAssignElasticIps:UpdateLayer' :: Maybe Bool
autoAssignElasticIps = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:layerId:UpdateLayer' :: Text
layerId = Text
pLayerId_
    }

-- | The ARN of an IAM profile to be used for all of the layer\'s EC2
-- instances. For more information about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
updateLayer_customInstanceProfileArn :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Text)
updateLayer_customInstanceProfileArn :: (Maybe Text -> f (Maybe Text)) -> UpdateLayer -> f UpdateLayer
updateLayer_customInstanceProfileArn = (UpdateLayer -> Maybe Text)
-> (UpdateLayer -> Maybe Text -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Text
customInstanceProfileArn :: Maybe Text
$sel:customInstanceProfileArn:UpdateLayer' :: UpdateLayer -> Maybe Text
customInstanceProfileArn} -> Maybe Text
customInstanceProfileArn) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Text
a -> UpdateLayer
s {$sel:customInstanceProfileArn:UpdateLayer' :: Maybe Text
customInstanceProfileArn = Maybe Text
a} :: UpdateLayer)

-- | An array containing the layer\'s custom security group IDs.
updateLayer_customSecurityGroupIds :: Lens.Lens' UpdateLayer (Prelude.Maybe [Prelude.Text])
updateLayer_customSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text])) -> UpdateLayer -> f UpdateLayer
updateLayer_customSecurityGroupIds = (UpdateLayer -> Maybe [Text])
-> (UpdateLayer -> Maybe [Text] -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe [Text]
customSecurityGroupIds :: Maybe [Text]
$sel:customSecurityGroupIds:UpdateLayer' :: UpdateLayer -> Maybe [Text]
customSecurityGroupIds} -> Maybe [Text]
customSecurityGroupIds) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe [Text]
a -> UpdateLayer
s {$sel:customSecurityGroupIds:UpdateLayer' :: Maybe [Text]
customSecurityGroupIds = Maybe [Text]
a} :: UpdateLayer) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateLayer -> f UpdateLayer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLayer
-> f UpdateLayer
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

-- | Whether to install operating system and package updates when the
-- instance boots. The default value is @true@. To control when updates are
-- installed, set this value to @false@. You must then update your
-- instances manually by using CreateDeployment to run the
-- @update_dependencies@ stack command or manually running @yum@ (Amazon
-- Linux) or @apt-get@ (Ubuntu) on the instances.
--
-- We strongly recommend using the default value of @true@, to ensure that
-- your instances have the latest security updates.
updateLayer_installUpdatesOnBoot :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Bool)
updateLayer_installUpdatesOnBoot :: (Maybe Bool -> f (Maybe Bool)) -> UpdateLayer -> f UpdateLayer
updateLayer_installUpdatesOnBoot = (UpdateLayer -> Maybe Bool)
-> (UpdateLayer -> Maybe Bool -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Bool
installUpdatesOnBoot :: Maybe Bool
$sel:installUpdatesOnBoot:UpdateLayer' :: UpdateLayer -> Maybe Bool
installUpdatesOnBoot} -> Maybe Bool
installUpdatesOnBoot) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Bool
a -> UpdateLayer
s {$sel:installUpdatesOnBoot:UpdateLayer' :: Maybe Bool
installUpdatesOnBoot = Maybe Bool
a} :: UpdateLayer)

-- | Specifies CloudWatch Logs configuration options for the layer. For more
-- information, see CloudWatchLogsLogStream.
updateLayer_cloudWatchLogsConfiguration :: Lens.Lens' UpdateLayer (Prelude.Maybe CloudWatchLogsConfiguration)
updateLayer_cloudWatchLogsConfiguration :: (Maybe CloudWatchLogsConfiguration
 -> f (Maybe CloudWatchLogsConfiguration))
-> UpdateLayer -> f UpdateLayer
updateLayer_cloudWatchLogsConfiguration = (UpdateLayer -> Maybe CloudWatchLogsConfiguration)
-> (UpdateLayer
    -> Maybe CloudWatchLogsConfiguration -> UpdateLayer)
-> Lens
     UpdateLayer
     UpdateLayer
     (Maybe CloudWatchLogsConfiguration)
     (Maybe CloudWatchLogsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration :: Maybe CloudWatchLogsConfiguration
$sel:cloudWatchLogsConfiguration:UpdateLayer' :: UpdateLayer -> Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration} -> Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe CloudWatchLogsConfiguration
a -> UpdateLayer
s {$sel:cloudWatchLogsConfiguration:UpdateLayer' :: Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration = Maybe CloudWatchLogsConfiguration
a} :: UpdateLayer)

-- |
updateLayer_lifecycleEventConfiguration :: Lens.Lens' UpdateLayer (Prelude.Maybe LifecycleEventConfiguration)
updateLayer_lifecycleEventConfiguration :: (Maybe LifecycleEventConfiguration
 -> f (Maybe LifecycleEventConfiguration))
-> UpdateLayer -> f UpdateLayer
updateLayer_lifecycleEventConfiguration = (UpdateLayer -> Maybe LifecycleEventConfiguration)
-> (UpdateLayer
    -> Maybe LifecycleEventConfiguration -> UpdateLayer)
-> Lens
     UpdateLayer
     UpdateLayer
     (Maybe LifecycleEventConfiguration)
     (Maybe LifecycleEventConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe LifecycleEventConfiguration
lifecycleEventConfiguration :: Maybe LifecycleEventConfiguration
$sel:lifecycleEventConfiguration:UpdateLayer' :: UpdateLayer -> Maybe LifecycleEventConfiguration
lifecycleEventConfiguration} -> Maybe LifecycleEventConfiguration
lifecycleEventConfiguration) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe LifecycleEventConfiguration
a -> UpdateLayer
s {$sel:lifecycleEventConfiguration:UpdateLayer' :: Maybe LifecycleEventConfiguration
lifecycleEventConfiguration = Maybe LifecycleEventConfiguration
a} :: UpdateLayer)

-- | For custom layers only, use this parameter to specify the layer\'s short
-- name, which is used internally by AWS OpsWorks Stacks and by Chef. The
-- short name is also used as the name for the directory where your app
-- files are installed. It can have a maximum of 200 characters and must be
-- in the following format: \/\\A[a-z0-9\\-\\_\\.]+\\Z\/.
--
-- The built-in layers\' short names are defined by AWS OpsWorks Stacks.
-- For more information, see the
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html Layer Reference>
updateLayer_shortname :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Text)
updateLayer_shortname :: (Maybe Text -> f (Maybe Text)) -> UpdateLayer -> f UpdateLayer
updateLayer_shortname = (UpdateLayer -> Maybe Text)
-> (UpdateLayer -> Maybe Text -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Text
shortname :: Maybe Text
$sel:shortname:UpdateLayer' :: UpdateLayer -> Maybe Text
shortname} -> Maybe Text
shortname) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Text
a -> UpdateLayer
s {$sel:shortname:UpdateLayer' :: Maybe Text
shortname = Maybe Text
a} :: UpdateLayer)

-- | A @LayerCustomRecipes@ object that specifies the layer\'s custom
-- recipes.
updateLayer_customRecipes :: Lens.Lens' UpdateLayer (Prelude.Maybe Recipes)
updateLayer_customRecipes :: (Maybe Recipes -> f (Maybe Recipes))
-> UpdateLayer -> f UpdateLayer
updateLayer_customRecipes = (UpdateLayer -> Maybe Recipes)
-> (UpdateLayer -> Maybe Recipes -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Recipes) (Maybe Recipes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Recipes
customRecipes :: Maybe Recipes
$sel:customRecipes:UpdateLayer' :: UpdateLayer -> Maybe Recipes
customRecipes} -> Maybe Recipes
customRecipes) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Recipes
a -> UpdateLayer
s {$sel:customRecipes:UpdateLayer' :: Maybe Recipes
customRecipes = Maybe Recipes
a} :: UpdateLayer)

-- | A JSON-formatted string containing custom stack configuration and
-- deployment attributes to be installed on the layer\'s instances. For
-- more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html Using Custom JSON>.
updateLayer_customJson :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Text)
updateLayer_customJson :: (Maybe Text -> f (Maybe Text)) -> UpdateLayer -> f UpdateLayer
updateLayer_customJson = (UpdateLayer -> Maybe Text)
-> (UpdateLayer -> Maybe Text -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Text
customJson :: Maybe Text
$sel:customJson:UpdateLayer' :: UpdateLayer -> Maybe Text
customJson} -> Maybe Text
customJson) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Text
a -> UpdateLayer
s {$sel:customJson:UpdateLayer' :: Maybe Text
customJson = Maybe Text
a} :: UpdateLayer)

-- | A @VolumeConfigurations@ object that describes the layer\'s Amazon EBS
-- volumes.
updateLayer_volumeConfigurations :: Lens.Lens' UpdateLayer (Prelude.Maybe [VolumeConfiguration])
updateLayer_volumeConfigurations :: (Maybe [VolumeConfiguration] -> f (Maybe [VolumeConfiguration]))
-> UpdateLayer -> f UpdateLayer
updateLayer_volumeConfigurations = (UpdateLayer -> Maybe [VolumeConfiguration])
-> (UpdateLayer -> Maybe [VolumeConfiguration] -> UpdateLayer)
-> Lens
     UpdateLayer
     UpdateLayer
     (Maybe [VolumeConfiguration])
     (Maybe [VolumeConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe [VolumeConfiguration]
volumeConfigurations :: Maybe [VolumeConfiguration]
$sel:volumeConfigurations:UpdateLayer' :: UpdateLayer -> Maybe [VolumeConfiguration]
volumeConfigurations} -> Maybe [VolumeConfiguration]
volumeConfigurations) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe [VolumeConfiguration]
a -> UpdateLayer
s {$sel:volumeConfigurations:UpdateLayer' :: Maybe [VolumeConfiguration]
volumeConfigurations = Maybe [VolumeConfiguration]
a} :: UpdateLayer) ((Maybe [VolumeConfiguration] -> f (Maybe [VolumeConfiguration]))
 -> UpdateLayer -> f UpdateLayer)
-> ((Maybe [VolumeConfiguration]
     -> f (Maybe [VolumeConfiguration]))
    -> Maybe [VolumeConfiguration] -> f (Maybe [VolumeConfiguration]))
-> (Maybe [VolumeConfiguration] -> f (Maybe [VolumeConfiguration]))
-> UpdateLayer
-> f UpdateLayer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VolumeConfiguration]
  [VolumeConfiguration]
  [VolumeConfiguration]
  [VolumeConfiguration]
-> Iso
     (Maybe [VolumeConfiguration])
     (Maybe [VolumeConfiguration])
     (Maybe [VolumeConfiguration])
     (Maybe [VolumeConfiguration])
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
  [VolumeConfiguration]
  [VolumeConfiguration]
  [VolumeConfiguration]
  [VolumeConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether to disable auto healing for the layer.
updateLayer_enableAutoHealing :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Bool)
updateLayer_enableAutoHealing :: (Maybe Bool -> f (Maybe Bool)) -> UpdateLayer -> f UpdateLayer
updateLayer_enableAutoHealing = (UpdateLayer -> Maybe Bool)
-> (UpdateLayer -> Maybe Bool -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Bool
enableAutoHealing :: Maybe Bool
$sel:enableAutoHealing:UpdateLayer' :: UpdateLayer -> Maybe Bool
enableAutoHealing} -> Maybe Bool
enableAutoHealing) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Bool
a -> UpdateLayer
s {$sel:enableAutoHealing:UpdateLayer' :: Maybe Bool
enableAutoHealing = Maybe Bool
a} :: UpdateLayer)

-- | An array of @Package@ objects that describe the layer\'s packages.
updateLayer_packages :: Lens.Lens' UpdateLayer (Prelude.Maybe [Prelude.Text])
updateLayer_packages :: (Maybe [Text] -> f (Maybe [Text])) -> UpdateLayer -> f UpdateLayer
updateLayer_packages = (UpdateLayer -> Maybe [Text])
-> (UpdateLayer -> Maybe [Text] -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe [Text]
packages :: Maybe [Text]
$sel:packages:UpdateLayer' :: UpdateLayer -> Maybe [Text]
packages} -> Maybe [Text]
packages) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe [Text]
a -> UpdateLayer
s {$sel:packages:UpdateLayer' :: Maybe [Text]
packages = Maybe [Text]
a} :: UpdateLayer) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateLayer -> f UpdateLayer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLayer
-> f UpdateLayer
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

-- | One or more user-defined key\/value pairs to be added to the stack
-- attributes.
updateLayer_attributes :: Lens.Lens' UpdateLayer (Prelude.Maybe (Prelude.HashMap LayerAttributesKeys (Prelude.Maybe Prelude.Text)))
updateLayer_attributes :: (Maybe (HashMap LayerAttributesKeys (Maybe Text))
 -> f (Maybe (HashMap LayerAttributesKeys (Maybe Text))))
-> UpdateLayer -> f UpdateLayer
updateLayer_attributes = (UpdateLayer -> Maybe (HashMap LayerAttributesKeys (Maybe Text)))
-> (UpdateLayer
    -> Maybe (HashMap LayerAttributesKeys (Maybe Text)) -> UpdateLayer)
-> Lens
     UpdateLayer
     UpdateLayer
     (Maybe (HashMap LayerAttributesKeys (Maybe Text)))
     (Maybe (HashMap LayerAttributesKeys (Maybe Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes :: Maybe (HashMap LayerAttributesKeys (Maybe Text))
$sel:attributes:UpdateLayer' :: UpdateLayer -> Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes} -> Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe (HashMap LayerAttributesKeys (Maybe Text))
a -> UpdateLayer
s {$sel:attributes:UpdateLayer' :: Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes = Maybe (HashMap LayerAttributesKeys (Maybe Text))
a} :: UpdateLayer) ((Maybe (HashMap LayerAttributesKeys (Maybe Text))
  -> f (Maybe (HashMap LayerAttributesKeys (Maybe Text))))
 -> UpdateLayer -> f UpdateLayer)
-> ((Maybe (HashMap LayerAttributesKeys (Maybe Text))
     -> f (Maybe (HashMap LayerAttributesKeys (Maybe Text))))
    -> Maybe (HashMap LayerAttributesKeys (Maybe Text))
    -> f (Maybe (HashMap LayerAttributesKeys (Maybe Text))))
-> (Maybe (HashMap LayerAttributesKeys (Maybe Text))
    -> f (Maybe (HashMap LayerAttributesKeys (Maybe Text))))
-> UpdateLayer
-> f UpdateLayer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
-> Iso
     (Maybe (HashMap LayerAttributesKeys (Maybe Text)))
     (Maybe (HashMap LayerAttributesKeys (Maybe Text)))
     (Maybe (HashMap LayerAttributesKeys (Maybe Text)))
     (Maybe (HashMap LayerAttributesKeys (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
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
  (HashMap LayerAttributesKeys (Maybe Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The layer name, which is used by the console.
updateLayer_name :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Text)
updateLayer_name :: (Maybe Text -> f (Maybe Text)) -> UpdateLayer -> f UpdateLayer
updateLayer_name = (UpdateLayer -> Maybe Text)
-> (UpdateLayer -> Maybe Text -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Text
name :: Maybe Text
$sel:name:UpdateLayer' :: UpdateLayer -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Text
a -> UpdateLayer
s {$sel:name:UpdateLayer' :: Maybe Text
name = Maybe Text
a} :: UpdateLayer)

-- | For stacks that are running in a VPC, whether to automatically assign a
-- public IP address to the layer\'s instances. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
updateLayer_autoAssignPublicIps :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Bool)
updateLayer_autoAssignPublicIps :: (Maybe Bool -> f (Maybe Bool)) -> UpdateLayer -> f UpdateLayer
updateLayer_autoAssignPublicIps = (UpdateLayer -> Maybe Bool)
-> (UpdateLayer -> Maybe Bool -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Bool
autoAssignPublicIps :: Maybe Bool
$sel:autoAssignPublicIps:UpdateLayer' :: UpdateLayer -> Maybe Bool
autoAssignPublicIps} -> Maybe Bool
autoAssignPublicIps) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Bool
a -> UpdateLayer
s {$sel:autoAssignPublicIps:UpdateLayer' :: Maybe Bool
autoAssignPublicIps = Maybe Bool
a} :: UpdateLayer)

-- | Whether to use Amazon EBS-optimized instances.
updateLayer_useEbsOptimizedInstances :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Bool)
updateLayer_useEbsOptimizedInstances :: (Maybe Bool -> f (Maybe Bool)) -> UpdateLayer -> f UpdateLayer
updateLayer_useEbsOptimizedInstances = (UpdateLayer -> Maybe Bool)
-> (UpdateLayer -> Maybe Bool -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Bool
useEbsOptimizedInstances :: Maybe Bool
$sel:useEbsOptimizedInstances:UpdateLayer' :: UpdateLayer -> Maybe Bool
useEbsOptimizedInstances} -> Maybe Bool
useEbsOptimizedInstances) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Bool
a -> UpdateLayer
s {$sel:useEbsOptimizedInstances:UpdateLayer' :: Maybe Bool
useEbsOptimizedInstances = Maybe Bool
a} :: UpdateLayer)

-- | Whether to automatically assign an
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html Elastic IP address>
-- to the layer\'s instances. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html How to Edit a Layer>.
updateLayer_autoAssignElasticIps :: Lens.Lens' UpdateLayer (Prelude.Maybe Prelude.Bool)
updateLayer_autoAssignElasticIps :: (Maybe Bool -> f (Maybe Bool)) -> UpdateLayer -> f UpdateLayer
updateLayer_autoAssignElasticIps = (UpdateLayer -> Maybe Bool)
-> (UpdateLayer -> Maybe Bool -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Maybe Bool
autoAssignElasticIps :: Maybe Bool
$sel:autoAssignElasticIps:UpdateLayer' :: UpdateLayer -> Maybe Bool
autoAssignElasticIps} -> Maybe Bool
autoAssignElasticIps) (\s :: UpdateLayer
s@UpdateLayer' {} Maybe Bool
a -> UpdateLayer
s {$sel:autoAssignElasticIps:UpdateLayer' :: Maybe Bool
autoAssignElasticIps = Maybe Bool
a} :: UpdateLayer)

-- | The layer ID.
updateLayer_layerId :: Lens.Lens' UpdateLayer Prelude.Text
updateLayer_layerId :: (Text -> f Text) -> UpdateLayer -> f UpdateLayer
updateLayer_layerId = (UpdateLayer -> Text)
-> (UpdateLayer -> Text -> UpdateLayer)
-> Lens UpdateLayer UpdateLayer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLayer' {Text
layerId :: Text
$sel:layerId:UpdateLayer' :: UpdateLayer -> Text
layerId} -> Text
layerId) (\s :: UpdateLayer
s@UpdateLayer' {} Text
a -> UpdateLayer
s {$sel:layerId:UpdateLayer' :: Text
layerId = Text
a} :: UpdateLayer)

instance Core.AWSRequest UpdateLayer where
  type AWSResponse UpdateLayer = UpdateLayerResponse
  request :: UpdateLayer -> Request UpdateLayer
request = Service -> UpdateLayer -> Request UpdateLayer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLayer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateLayer)))
response = AWSResponse UpdateLayer
-> Logger
-> Service
-> Proxy UpdateLayer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateLayer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateLayer
UpdateLayerResponse
UpdateLayerResponse'

instance Prelude.Hashable UpdateLayer

instance Prelude.NFData UpdateLayer

instance Core.ToHeaders UpdateLayer where
  toHeaders :: UpdateLayer -> [Header]
toHeaders =
    [Header] -> UpdateLayer -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"OpsWorks_20130218.UpdateLayer" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateLayer where
  toJSON :: UpdateLayer -> Value
toJSON UpdateLayer' {Maybe Bool
Maybe [Text]
Maybe [VolumeConfiguration]
Maybe Text
Maybe (HashMap LayerAttributesKeys (Maybe Text))
Maybe CloudWatchLogsConfiguration
Maybe Recipes
Maybe LifecycleEventConfiguration
Text
layerId :: Text
autoAssignElasticIps :: Maybe Bool
useEbsOptimizedInstances :: Maybe Bool
autoAssignPublicIps :: Maybe Bool
name :: Maybe Text
attributes :: Maybe (HashMap LayerAttributesKeys (Maybe Text))
packages :: Maybe [Text]
enableAutoHealing :: Maybe Bool
volumeConfigurations :: Maybe [VolumeConfiguration]
customJson :: Maybe Text
customRecipes :: Maybe Recipes
shortname :: Maybe Text
lifecycleEventConfiguration :: Maybe LifecycleEventConfiguration
cloudWatchLogsConfiguration :: Maybe CloudWatchLogsConfiguration
installUpdatesOnBoot :: Maybe Bool
customSecurityGroupIds :: Maybe [Text]
customInstanceProfileArn :: Maybe Text
$sel:layerId:UpdateLayer' :: UpdateLayer -> Text
$sel:autoAssignElasticIps:UpdateLayer' :: UpdateLayer -> Maybe Bool
$sel:useEbsOptimizedInstances:UpdateLayer' :: UpdateLayer -> Maybe Bool
$sel:autoAssignPublicIps:UpdateLayer' :: UpdateLayer -> Maybe Bool
$sel:name:UpdateLayer' :: UpdateLayer -> Maybe Text
$sel:attributes:UpdateLayer' :: UpdateLayer -> Maybe (HashMap LayerAttributesKeys (Maybe Text))
$sel:packages:UpdateLayer' :: UpdateLayer -> Maybe [Text]
$sel:enableAutoHealing:UpdateLayer' :: UpdateLayer -> Maybe Bool
$sel:volumeConfigurations:UpdateLayer' :: UpdateLayer -> Maybe [VolumeConfiguration]
$sel:customJson:UpdateLayer' :: UpdateLayer -> Maybe Text
$sel:customRecipes:UpdateLayer' :: UpdateLayer -> Maybe Recipes
$sel:shortname:UpdateLayer' :: UpdateLayer -> Maybe Text
$sel:lifecycleEventConfiguration:UpdateLayer' :: UpdateLayer -> Maybe LifecycleEventConfiguration
$sel:cloudWatchLogsConfiguration:UpdateLayer' :: UpdateLayer -> Maybe CloudWatchLogsConfiguration
$sel:installUpdatesOnBoot:UpdateLayer' :: UpdateLayer -> Maybe Bool
$sel:customSecurityGroupIds:UpdateLayer' :: UpdateLayer -> Maybe [Text]
$sel:customInstanceProfileArn:UpdateLayer' :: UpdateLayer -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CustomInstanceProfileArn" 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
customInstanceProfileArn,
            (Text
"CustomSecurityGroupIds" 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]
customSecurityGroupIds,
            (Text
"InstallUpdatesOnBoot" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
installUpdatesOnBoot,
            (Text
"CloudWatchLogsConfiguration" Text -> CloudWatchLogsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CloudWatchLogsConfiguration -> Pair)
-> Maybe CloudWatchLogsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLogsConfiguration
cloudWatchLogsConfiguration,
            (Text
"LifecycleEventConfiguration" Text -> LifecycleEventConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LifecycleEventConfiguration -> Pair)
-> Maybe LifecycleEventConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LifecycleEventConfiguration
lifecycleEventConfiguration,
            (Text
"Shortname" 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
shortname,
            (Text
"CustomRecipes" Text -> Recipes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Recipes -> Pair) -> Maybe Recipes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Recipes
customRecipes,
            (Text
"CustomJson" 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
customJson,
            (Text
"VolumeConfigurations" Text -> [VolumeConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([VolumeConfiguration] -> Pair)
-> Maybe [VolumeConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VolumeConfiguration]
volumeConfigurations,
            (Text
"EnableAutoHealing" 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
enableAutoHealing,
            (Text
"Packages" 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]
packages,
            (Text
"Attributes" Text -> HashMap LayerAttributesKeys (Maybe Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap LayerAttributesKeys (Maybe Text) -> Pair)
-> Maybe (HashMap LayerAttributesKeys (Maybe Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap LayerAttributesKeys (Maybe Text))
attributes,
            (Text
"Name" 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
name,
            (Text
"AutoAssignPublicIps" 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
autoAssignPublicIps,
            (Text
"UseEbsOptimizedInstances" 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
useEbsOptimizedInstances,
            (Text
"AutoAssignElasticIps" 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
autoAssignElasticIps,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LayerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
layerId)
          ]
      )

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

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

-- | /See:/ 'newUpdateLayerResponse' smart constructor.
data UpdateLayerResponse = UpdateLayerResponse'
  {
  }
  deriving (UpdateLayerResponse -> UpdateLayerResponse -> Bool
(UpdateLayerResponse -> UpdateLayerResponse -> Bool)
-> (UpdateLayerResponse -> UpdateLayerResponse -> Bool)
-> Eq UpdateLayerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLayerResponse -> UpdateLayerResponse -> Bool
$c/= :: UpdateLayerResponse -> UpdateLayerResponse -> Bool
== :: UpdateLayerResponse -> UpdateLayerResponse -> Bool
$c== :: UpdateLayerResponse -> UpdateLayerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLayerResponse]
ReadPrec UpdateLayerResponse
Int -> ReadS UpdateLayerResponse
ReadS [UpdateLayerResponse]
(Int -> ReadS UpdateLayerResponse)
-> ReadS [UpdateLayerResponse]
-> ReadPrec UpdateLayerResponse
-> ReadPrec [UpdateLayerResponse]
-> Read UpdateLayerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLayerResponse]
$creadListPrec :: ReadPrec [UpdateLayerResponse]
readPrec :: ReadPrec UpdateLayerResponse
$creadPrec :: ReadPrec UpdateLayerResponse
readList :: ReadS [UpdateLayerResponse]
$creadList :: ReadS [UpdateLayerResponse]
readsPrec :: Int -> ReadS UpdateLayerResponse
$creadsPrec :: Int -> ReadS UpdateLayerResponse
Prelude.Read, Int -> UpdateLayerResponse -> ShowS
[UpdateLayerResponse] -> ShowS
UpdateLayerResponse -> String
(Int -> UpdateLayerResponse -> ShowS)
-> (UpdateLayerResponse -> String)
-> ([UpdateLayerResponse] -> ShowS)
-> Show UpdateLayerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLayerResponse] -> ShowS
$cshowList :: [UpdateLayerResponse] -> ShowS
show :: UpdateLayerResponse -> String
$cshow :: UpdateLayerResponse -> String
showsPrec :: Int -> UpdateLayerResponse -> ShowS
$cshowsPrec :: Int -> UpdateLayerResponse -> ShowS
Prelude.Show, (forall x. UpdateLayerResponse -> Rep UpdateLayerResponse x)
-> (forall x. Rep UpdateLayerResponse x -> UpdateLayerResponse)
-> Generic UpdateLayerResponse
forall x. Rep UpdateLayerResponse x -> UpdateLayerResponse
forall x. UpdateLayerResponse -> Rep UpdateLayerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLayerResponse x -> UpdateLayerResponse
$cfrom :: forall x. UpdateLayerResponse -> Rep UpdateLayerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLayerResponse' 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.
newUpdateLayerResponse ::
  UpdateLayerResponse
newUpdateLayerResponse :: UpdateLayerResponse
newUpdateLayerResponse = UpdateLayerResponse
UpdateLayerResponse'

instance Prelude.NFData UpdateLayerResponse