{-# 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.UpdateStack
-- 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 stack.
--
-- __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.UpdateStack
  ( -- * Creating a Request
    UpdateStack (..),
    newUpdateStack,

    -- * Request Lenses
    updateStack_defaultInstanceProfileArn,
    updateStack_serviceRoleArn,
    updateStack_defaultRootDeviceType,
    updateStack_chefConfiguration,
    updateStack_agentVersion,
    updateStack_defaultSshKeyName,
    updateStack_customJson,
    updateStack_customCookbooksSource,
    updateStack_defaultAvailabilityZone,
    updateStack_attributes,
    updateStack_name,
    updateStack_defaultOs,
    updateStack_useOpsworksSecurityGroups,
    updateStack_useCustomCookbooks,
    updateStack_defaultSubnetId,
    updateStack_configurationManager,
    updateStack_hostnameTheme,
    updateStack_stackId,

    -- * Destructuring the Response
    UpdateStackResponse (..),
    newUpdateStackResponse,
  )
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:/ 'newUpdateStack' smart constructor.
data UpdateStack = UpdateStack'
  { -- | The ARN of an IAM profile that is the default profile for all of the
    -- stack\'s EC2 instances. For more information about IAM ARNs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
    UpdateStack -> Maybe Text
defaultInstanceProfileArn :: Prelude.Maybe Prelude.Text,
    -- | Do not use this parameter. You cannot update a stack\'s service role.
    UpdateStack -> Maybe Text
serviceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The default root device type. This value is used by default for all
    -- instances in the stack, but you can override it when you create an
    -- instance. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device Storage for the Root Device>.
    UpdateStack -> Maybe RootDeviceType
defaultRootDeviceType :: Prelude.Maybe RootDeviceType,
    -- | A @ChefConfiguration@ object that specifies whether to enable Berkshelf
    -- and the Berkshelf version on Chef 11.10 stacks. For more information,
    -- see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
    UpdateStack -> Maybe ChefConfiguration
chefConfiguration :: Prelude.Maybe ChefConfiguration,
    -- | The default AWS OpsWorks Stacks agent version. You have the following
    -- options:
    --
    -- -   Auto-update - Set this parameter to @LATEST@. AWS OpsWorks Stacks
    --     automatically installs new agent versions on the stack\'s instances
    --     as soon as they are available.
    --
    -- -   Fixed version - Set this parameter to your preferred agent version.
    --     To update the agent version, you must edit the stack configuration
    --     and specify a new version. AWS OpsWorks Stacks then automatically
    --     installs that version on the stack\'s instances.
    --
    -- The default setting is @LATEST@. To specify an agent version, you must
    -- use the complete version number, not the abbreviated number shown on the
    -- console. For a list of available agent version numbers, call
    -- DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
    --
    -- You can also specify an agent version when you create or update an
    -- instance, which overrides the stack\'s default setting.
    UpdateStack -> Maybe Text
agentVersion :: Prelude.Maybe Prelude.Text,
    -- | A default Amazon EC2 key-pair name. The default value is @none@. If you
    -- specify a key-pair name, AWS OpsWorks Stacks installs the public key on
    -- the instance and you can use the private key with an SSH client to log
    -- in to the instance. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html Using SSH to Communicate with an Instance>
    -- and
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html Managing SSH Access>.
    -- You can override this setting by specifying a different key pair, or no
    -- key pair, when you
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html create an instance>.
    UpdateStack -> Maybe Text
defaultSshKeyName :: Prelude.Maybe Prelude.Text,
    -- | A string that contains user-defined, custom JSON. It can be used to
    -- override the corresponding default stack configuration JSON values or to
    -- pass data to recipes. The string should be in the following format:
    --
    -- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
    --
    -- For more information about custom JSON, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
    UpdateStack -> Maybe Text
customJson :: Prelude.Maybe Prelude.Text,
    -- | Contains the information required to retrieve an app or cookbook from a
    -- repository. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html Adding Apps>
    -- or
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html Cookbooks and Recipes>.
    UpdateStack -> Maybe Source
customCookbooksSource :: Prelude.Maybe Source,
    -- | The stack\'s default Availability Zone, which must be in the stack\'s
    -- region. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
    -- If you also specify a value for @DefaultSubnetId@, the subnet must be in
    -- the same zone. For more information, see CreateStack.
    UpdateStack -> Maybe Text
defaultAvailabilityZone :: Prelude.Maybe Prelude.Text,
    -- | One or more user-defined key-value pairs to be added to the stack
    -- attributes.
    UpdateStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes :: Prelude.Maybe (Prelude.HashMap StackAttributesKeys (Prelude.Maybe Prelude.Text)),
    -- | The stack\'s new name.
    UpdateStack -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The stack\'s operating system, which must be set to one of the
    -- following:
    --
    -- -   A supported Linux operating system: An Amazon Linux version, such as
    --     @Amazon Linux 2018.03@, @Amazon Linux 2017.09@,
    --     @Amazon Linux 2017.03@, @Amazon Linux 2016.09@,
    --     @Amazon Linux 2016.03@, @Amazon Linux 2015.09@, or
    --     @Amazon Linux 2015.03@.
    --
    -- -   A supported Ubuntu operating system, such as @Ubuntu 16.04 LTS@,
    --     @Ubuntu 14.04 LTS@, or @Ubuntu 12.04 LTS@.
    --
    -- -   @CentOS Linux 7@
    --
    -- -   @Red Hat Enterprise Linux 7@
    --
    -- -   A supported Windows operating system, such as
    --     @Microsoft Windows Server 2012 R2 Base@,
    --     @Microsoft Windows Server 2012 R2 with SQL Server Express@,
    --     @Microsoft Windows Server 2012 R2 with SQL Server Standard@, or
    --     @Microsoft Windows Server 2012 R2 with SQL Server Web@.
    --
    -- -   A custom AMI: @Custom@. You specify the custom AMI you want to use
    --     when you create instances. For more information about how to use
    --     custom AMIs with OpsWorks, see
    --     <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html Using Custom AMIs>.
    --
    -- The default option is the stack\'s current operating system. For more
    -- information about supported operating systems, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html AWS OpsWorks Stacks Operating Systems>.
    UpdateStack -> Maybe Text
defaultOs :: Prelude.Maybe Prelude.Text,
    -- | Whether to associate the AWS OpsWorks Stacks built-in security groups
    -- with the stack\'s layers.
    --
    -- AWS OpsWorks Stacks provides a standard set of built-in security groups,
    -- one for each layer, which are associated with layers by default.
    -- @UseOpsworksSecurityGroups@ allows you to provide your own custom
    -- security groups instead of using the built-in groups.
    -- @UseOpsworksSecurityGroups@ has the following settings:
    --
    -- -   True - AWS OpsWorks Stacks automatically associates the appropriate
    --     built-in security group with each layer (default setting). You can
    --     associate additional security groups with a layer after you create
    --     it, but you cannot delete the built-in security group.
    --
    -- -   False - AWS OpsWorks Stacks does not associate built-in security
    --     groups with layers. You must create appropriate EC2 security groups
    --     and associate a security group with each layer that you create.
    --     However, you can still manually associate a built-in security group
    --     with a layer on. Custom security groups are required only for those
    --     layers that need custom settings.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
    UpdateStack -> Maybe Bool
useOpsworksSecurityGroups :: Prelude.Maybe Prelude.Bool,
    -- | Whether the stack uses custom cookbooks.
    UpdateStack -> Maybe Bool
useCustomCookbooks :: Prelude.Maybe Prelude.Bool,
    -- | The stack\'s default VPC subnet ID. This parameter is required if you
    -- specify a value for the @VpcId@ parameter. All instances are launched
    -- into this subnet unless you specify otherwise when you create the
    -- instance. If you also specify a value for @DefaultAvailabilityZone@, the
    -- subnet must be in that zone. For information on default values and when
    -- this parameter is required, see the @VpcId@ parameter description.
    UpdateStack -> Maybe Text
defaultSubnetId :: Prelude.Maybe Prelude.Text,
    -- | The configuration manager. When you update a stack, we recommend that
    -- you use the configuration manager to specify the Chef version: 12,
    -- 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default
    -- value for Linux stacks is currently 12.
    UpdateStack -> Maybe StackConfigurationManager
configurationManager :: Prelude.Maybe StackConfigurationManager,
    -- | The stack\'s new host name theme, with spaces replaced by underscores.
    -- The theme is used to generate host names for the stack\'s instances. By
    -- default, @HostnameTheme@ is set to @Layer_Dependent@, which creates host
    -- names by appending integers to the layer\'s short name. The other themes
    -- are:
    --
    -- -   @Baked_Goods@
    --
    -- -   @Clouds@
    --
    -- -   @Europe_Cities@
    --
    -- -   @Fruits@
    --
    -- -   @Greek_Deities_and_Titans@
    --
    -- -   @Legendary_creatures_from_Japan@
    --
    -- -   @Planets_and_Moons@
    --
    -- -   @Roman_Deities@
    --
    -- -   @Scottish_Islands@
    --
    -- -   @US_Cities@
    --
    -- -   @Wild_Cats@
    --
    -- To obtain a generated host name, call @GetHostNameSuggestion@, which
    -- returns a host name based on the current theme.
    UpdateStack -> Maybe Text
hostnameTheme :: Prelude.Maybe Prelude.Text,
    -- | The stack ID.
    UpdateStack -> Text
stackId :: Prelude.Text
  }
  deriving (UpdateStack -> UpdateStack -> Bool
(UpdateStack -> UpdateStack -> Bool)
-> (UpdateStack -> UpdateStack -> Bool) -> Eq UpdateStack
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStack -> UpdateStack -> Bool
$c/= :: UpdateStack -> UpdateStack -> Bool
== :: UpdateStack -> UpdateStack -> Bool
$c== :: UpdateStack -> UpdateStack -> Bool
Prelude.Eq, ReadPrec [UpdateStack]
ReadPrec UpdateStack
Int -> ReadS UpdateStack
ReadS [UpdateStack]
(Int -> ReadS UpdateStack)
-> ReadS [UpdateStack]
-> ReadPrec UpdateStack
-> ReadPrec [UpdateStack]
-> Read UpdateStack
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStack]
$creadListPrec :: ReadPrec [UpdateStack]
readPrec :: ReadPrec UpdateStack
$creadPrec :: ReadPrec UpdateStack
readList :: ReadS [UpdateStack]
$creadList :: ReadS [UpdateStack]
readsPrec :: Int -> ReadS UpdateStack
$creadsPrec :: Int -> ReadS UpdateStack
Prelude.Read, Int -> UpdateStack -> ShowS
[UpdateStack] -> ShowS
UpdateStack -> String
(Int -> UpdateStack -> ShowS)
-> (UpdateStack -> String)
-> ([UpdateStack] -> ShowS)
-> Show UpdateStack
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStack] -> ShowS
$cshowList :: [UpdateStack] -> ShowS
show :: UpdateStack -> String
$cshow :: UpdateStack -> String
showsPrec :: Int -> UpdateStack -> ShowS
$cshowsPrec :: Int -> UpdateStack -> ShowS
Prelude.Show, (forall x. UpdateStack -> Rep UpdateStack x)
-> (forall x. Rep UpdateStack x -> UpdateStack)
-> Generic UpdateStack
forall x. Rep UpdateStack x -> UpdateStack
forall x. UpdateStack -> Rep UpdateStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStack x -> UpdateStack
$cfrom :: forall x. UpdateStack -> Rep UpdateStack x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStack' 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:
--
-- 'defaultInstanceProfileArn', 'updateStack_defaultInstanceProfileArn' - The ARN of an IAM profile that is the default profile for all of the
-- stack\'s EC2 instances. For more information about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
--
-- 'serviceRoleArn', 'updateStack_serviceRoleArn' - Do not use this parameter. You cannot update a stack\'s service role.
--
-- 'defaultRootDeviceType', 'updateStack_defaultRootDeviceType' - The default root device type. This value is used by default for all
-- instances in the stack, but you can override it when you create an
-- instance. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device Storage for the Root Device>.
--
-- 'chefConfiguration', 'updateStack_chefConfiguration' - A @ChefConfiguration@ object that specifies whether to enable Berkshelf
-- and the Berkshelf version on Chef 11.10 stacks. For more information,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
--
-- 'agentVersion', 'updateStack_agentVersion' - The default AWS OpsWorks Stacks agent version. You have the following
-- options:
--
-- -   Auto-update - Set this parameter to @LATEST@. AWS OpsWorks Stacks
--     automatically installs new agent versions on the stack\'s instances
--     as soon as they are available.
--
-- -   Fixed version - Set this parameter to your preferred agent version.
--     To update the agent version, you must edit the stack configuration
--     and specify a new version. AWS OpsWorks Stacks then automatically
--     installs that version on the stack\'s instances.
--
-- The default setting is @LATEST@. To specify an agent version, you must
-- use the complete version number, not the abbreviated number shown on the
-- console. For a list of available agent version numbers, call
-- DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
--
-- You can also specify an agent version when you create or update an
-- instance, which overrides the stack\'s default setting.
--
-- 'defaultSshKeyName', 'updateStack_defaultSshKeyName' - A default Amazon EC2 key-pair name. The default value is @none@. If you
-- specify a key-pair name, AWS OpsWorks Stacks installs the public key on
-- the instance and you can use the private key with an SSH client to log
-- in to the instance. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html Using SSH to Communicate with an Instance>
-- and
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html Managing SSH Access>.
-- You can override this setting by specifying a different key pair, or no
-- key pair, when you
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html create an instance>.
--
-- 'customJson', 'updateStack_customJson' - A string that contains user-defined, custom JSON. It can be used to
-- override the corresponding default stack configuration JSON values or to
-- pass data to recipes. The string should be in the following format:
--
-- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
--
-- For more information about custom JSON, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
--
-- 'customCookbooksSource', 'updateStack_customCookbooksSource' - Contains the information required to retrieve an app or cookbook from a
-- repository. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html Adding Apps>
-- or
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html Cookbooks and Recipes>.
--
-- 'defaultAvailabilityZone', 'updateStack_defaultAvailabilityZone' - The stack\'s default Availability Zone, which must be in the stack\'s
-- region. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
-- If you also specify a value for @DefaultSubnetId@, the subnet must be in
-- the same zone. For more information, see CreateStack.
--
-- 'attributes', 'updateStack_attributes' - One or more user-defined key-value pairs to be added to the stack
-- attributes.
--
-- 'name', 'updateStack_name' - The stack\'s new name.
--
-- 'defaultOs', 'updateStack_defaultOs' - The stack\'s operating system, which must be set to one of the
-- following:
--
-- -   A supported Linux operating system: An Amazon Linux version, such as
--     @Amazon Linux 2018.03@, @Amazon Linux 2017.09@,
--     @Amazon Linux 2017.03@, @Amazon Linux 2016.09@,
--     @Amazon Linux 2016.03@, @Amazon Linux 2015.09@, or
--     @Amazon Linux 2015.03@.
--
-- -   A supported Ubuntu operating system, such as @Ubuntu 16.04 LTS@,
--     @Ubuntu 14.04 LTS@, or @Ubuntu 12.04 LTS@.
--
-- -   @CentOS Linux 7@
--
-- -   @Red Hat Enterprise Linux 7@
--
-- -   A supported Windows operating system, such as
--     @Microsoft Windows Server 2012 R2 Base@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Express@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Standard@, or
--     @Microsoft Windows Server 2012 R2 with SQL Server Web@.
--
-- -   A custom AMI: @Custom@. You specify the custom AMI you want to use
--     when you create instances. For more information about how to use
--     custom AMIs with OpsWorks, see
--     <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html Using Custom AMIs>.
--
-- The default option is the stack\'s current operating system. For more
-- information about supported operating systems, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html AWS OpsWorks Stacks Operating Systems>.
--
-- 'useOpsworksSecurityGroups', 'updateStack_useOpsworksSecurityGroups' - Whether to associate the AWS OpsWorks Stacks built-in security groups
-- with the stack\'s layers.
--
-- AWS OpsWorks Stacks provides a standard set of built-in security groups,
-- one for each layer, which are associated with layers by default.
-- @UseOpsworksSecurityGroups@ allows you to provide your own custom
-- security groups instead of using the built-in groups.
-- @UseOpsworksSecurityGroups@ has the following settings:
--
-- -   True - AWS OpsWorks Stacks automatically associates the appropriate
--     built-in security group with each layer (default setting). You can
--     associate additional security groups with a layer after you create
--     it, but you cannot delete the built-in security group.
--
-- -   False - AWS OpsWorks Stacks does not associate built-in security
--     groups with layers. You must create appropriate EC2 security groups
--     and associate a security group with each layer that you create.
--     However, you can still manually associate a built-in security group
--     with a layer on. Custom security groups are required only for those
--     layers that need custom settings.
--
-- For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
--
-- 'useCustomCookbooks', 'updateStack_useCustomCookbooks' - Whether the stack uses custom cookbooks.
--
-- 'defaultSubnetId', 'updateStack_defaultSubnetId' - The stack\'s default VPC subnet ID. This parameter is required if you
-- specify a value for the @VpcId@ parameter. All instances are launched
-- into this subnet unless you specify otherwise when you create the
-- instance. If you also specify a value for @DefaultAvailabilityZone@, the
-- subnet must be in that zone. For information on default values and when
-- this parameter is required, see the @VpcId@ parameter description.
--
-- 'configurationManager', 'updateStack_configurationManager' - The configuration manager. When you update a stack, we recommend that
-- you use the configuration manager to specify the Chef version: 12,
-- 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default
-- value for Linux stacks is currently 12.
--
-- 'hostnameTheme', 'updateStack_hostnameTheme' - The stack\'s new host name theme, with spaces replaced by underscores.
-- The theme is used to generate host names for the stack\'s instances. By
-- default, @HostnameTheme@ is set to @Layer_Dependent@, which creates host
-- names by appending integers to the layer\'s short name. The other themes
-- are:
--
-- -   @Baked_Goods@
--
-- -   @Clouds@
--
-- -   @Europe_Cities@
--
-- -   @Fruits@
--
-- -   @Greek_Deities_and_Titans@
--
-- -   @Legendary_creatures_from_Japan@
--
-- -   @Planets_and_Moons@
--
-- -   @Roman_Deities@
--
-- -   @Scottish_Islands@
--
-- -   @US_Cities@
--
-- -   @Wild_Cats@
--
-- To obtain a generated host name, call @GetHostNameSuggestion@, which
-- returns a host name based on the current theme.
--
-- 'stackId', 'updateStack_stackId' - The stack ID.
newUpdateStack ::
  -- | 'stackId'
  Prelude.Text ->
  UpdateStack
newUpdateStack :: Text -> UpdateStack
newUpdateStack Text
pStackId_ =
  UpdateStack' :: Maybe Text
-> Maybe Text
-> Maybe RootDeviceType
-> Maybe ChefConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Source
-> Maybe Text
-> Maybe (HashMap StackAttributesKeys (Maybe Text))
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe StackConfigurationManager
-> Maybe Text
-> Text
-> UpdateStack
UpdateStack'
    { $sel:defaultInstanceProfileArn:UpdateStack' :: Maybe Text
defaultInstanceProfileArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRoleArn:UpdateStack' :: Maybe Text
serviceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRootDeviceType:UpdateStack' :: Maybe RootDeviceType
defaultRootDeviceType = Maybe RootDeviceType
forall a. Maybe a
Prelude.Nothing,
      $sel:chefConfiguration:UpdateStack' :: Maybe ChefConfiguration
chefConfiguration = Maybe ChefConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:agentVersion:UpdateStack' :: Maybe Text
agentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSshKeyName:UpdateStack' :: Maybe Text
defaultSshKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customJson:UpdateStack' :: Maybe Text
customJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customCookbooksSource:UpdateStack' :: Maybe Source
customCookbooksSource = Maybe Source
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultAvailabilityZone:UpdateStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:UpdateStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = Maybe (HashMap StackAttributesKeys (Maybe Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateStack' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultOs:UpdateStack' :: Maybe Text
defaultOs = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:useOpsworksSecurityGroups:UpdateStack' :: Maybe Bool
useOpsworksSecurityGroups = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:useCustomCookbooks:UpdateStack' :: Maybe Bool
useCustomCookbooks = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSubnetId:UpdateStack' :: Maybe Text
defaultSubnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationManager:UpdateStack' :: Maybe StackConfigurationManager
configurationManager = Maybe StackConfigurationManager
forall a. Maybe a
Prelude.Nothing,
      $sel:hostnameTheme:UpdateStack' :: Maybe Text
hostnameTheme = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:UpdateStack' :: Text
stackId = Text
pStackId_
    }

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

-- | Do not use this parameter. You cannot update a stack\'s service role.
updateStack_serviceRoleArn :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_serviceRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_serviceRoleArn = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
serviceRoleArn :: Maybe Text
$sel:serviceRoleArn:UpdateStack' :: UpdateStack -> Maybe Text
serviceRoleArn} -> Maybe Text
serviceRoleArn) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:serviceRoleArn:UpdateStack' :: Maybe Text
serviceRoleArn = Maybe Text
a} :: UpdateStack)

-- | The default root device type. This value is used by default for all
-- instances in the stack, but you can override it when you create an
-- instance. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device Storage for the Root Device>.
updateStack_defaultRootDeviceType :: Lens.Lens' UpdateStack (Prelude.Maybe RootDeviceType)
updateStack_defaultRootDeviceType :: (Maybe RootDeviceType -> f (Maybe RootDeviceType))
-> UpdateStack -> f UpdateStack
updateStack_defaultRootDeviceType = (UpdateStack -> Maybe RootDeviceType)
-> (UpdateStack -> Maybe RootDeviceType -> UpdateStack)
-> Lens
     UpdateStack
     UpdateStack
     (Maybe RootDeviceType)
     (Maybe RootDeviceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe RootDeviceType
defaultRootDeviceType :: Maybe RootDeviceType
$sel:defaultRootDeviceType:UpdateStack' :: UpdateStack -> Maybe RootDeviceType
defaultRootDeviceType} -> Maybe RootDeviceType
defaultRootDeviceType) (\s :: UpdateStack
s@UpdateStack' {} Maybe RootDeviceType
a -> UpdateStack
s {$sel:defaultRootDeviceType:UpdateStack' :: Maybe RootDeviceType
defaultRootDeviceType = Maybe RootDeviceType
a} :: UpdateStack)

-- | A @ChefConfiguration@ object that specifies whether to enable Berkshelf
-- and the Berkshelf version on Chef 11.10 stacks. For more information,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
updateStack_chefConfiguration :: Lens.Lens' UpdateStack (Prelude.Maybe ChefConfiguration)
updateStack_chefConfiguration :: (Maybe ChefConfiguration -> f (Maybe ChefConfiguration))
-> UpdateStack -> f UpdateStack
updateStack_chefConfiguration = (UpdateStack -> Maybe ChefConfiguration)
-> (UpdateStack -> Maybe ChefConfiguration -> UpdateStack)
-> Lens
     UpdateStack
     UpdateStack
     (Maybe ChefConfiguration)
     (Maybe ChefConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe ChefConfiguration
chefConfiguration :: Maybe ChefConfiguration
$sel:chefConfiguration:UpdateStack' :: UpdateStack -> Maybe ChefConfiguration
chefConfiguration} -> Maybe ChefConfiguration
chefConfiguration) (\s :: UpdateStack
s@UpdateStack' {} Maybe ChefConfiguration
a -> UpdateStack
s {$sel:chefConfiguration:UpdateStack' :: Maybe ChefConfiguration
chefConfiguration = Maybe ChefConfiguration
a} :: UpdateStack)

-- | The default AWS OpsWorks Stacks agent version. You have the following
-- options:
--
-- -   Auto-update - Set this parameter to @LATEST@. AWS OpsWorks Stacks
--     automatically installs new agent versions on the stack\'s instances
--     as soon as they are available.
--
-- -   Fixed version - Set this parameter to your preferred agent version.
--     To update the agent version, you must edit the stack configuration
--     and specify a new version. AWS OpsWorks Stacks then automatically
--     installs that version on the stack\'s instances.
--
-- The default setting is @LATEST@. To specify an agent version, you must
-- use the complete version number, not the abbreviated number shown on the
-- console. For a list of available agent version numbers, call
-- DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
--
-- You can also specify an agent version when you create or update an
-- instance, which overrides the stack\'s default setting.
updateStack_agentVersion :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_agentVersion :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_agentVersion = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:UpdateStack' :: UpdateStack -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:agentVersion:UpdateStack' :: Maybe Text
agentVersion = Maybe Text
a} :: UpdateStack)

-- | A default Amazon EC2 key-pair name. The default value is @none@. If you
-- specify a key-pair name, AWS OpsWorks Stacks installs the public key on
-- the instance and you can use the private key with an SSH client to log
-- in to the instance. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html Using SSH to Communicate with an Instance>
-- and
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html Managing SSH Access>.
-- You can override this setting by specifying a different key pair, or no
-- key pair, when you
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html create an instance>.
updateStack_defaultSshKeyName :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_defaultSshKeyName :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_defaultSshKeyName = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
defaultSshKeyName :: Maybe Text
$sel:defaultSshKeyName:UpdateStack' :: UpdateStack -> Maybe Text
defaultSshKeyName} -> Maybe Text
defaultSshKeyName) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:defaultSshKeyName:UpdateStack' :: Maybe Text
defaultSshKeyName = Maybe Text
a} :: UpdateStack)

-- | A string that contains user-defined, custom JSON. It can be used to
-- override the corresponding default stack configuration JSON values or to
-- pass data to recipes. The string should be in the following format:
--
-- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
--
-- For more information about custom JSON, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
updateStack_customJson :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_customJson :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_customJson = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
customJson :: Maybe Text
$sel:customJson:UpdateStack' :: UpdateStack -> Maybe Text
customJson} -> Maybe Text
customJson) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:customJson:UpdateStack' :: Maybe Text
customJson = Maybe Text
a} :: UpdateStack)

-- | Contains the information required to retrieve an app or cookbook from a
-- repository. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html Adding Apps>
-- or
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html Cookbooks and Recipes>.
updateStack_customCookbooksSource :: Lens.Lens' UpdateStack (Prelude.Maybe Source)
updateStack_customCookbooksSource :: (Maybe Source -> f (Maybe Source)) -> UpdateStack -> f UpdateStack
updateStack_customCookbooksSource = (UpdateStack -> Maybe Source)
-> (UpdateStack -> Maybe Source -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Source) (Maybe Source)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Source
customCookbooksSource :: Maybe Source
$sel:customCookbooksSource:UpdateStack' :: UpdateStack -> Maybe Source
customCookbooksSource} -> Maybe Source
customCookbooksSource) (\s :: UpdateStack
s@UpdateStack' {} Maybe Source
a -> UpdateStack
s {$sel:customCookbooksSource:UpdateStack' :: Maybe Source
customCookbooksSource = Maybe Source
a} :: UpdateStack)

-- | The stack\'s default Availability Zone, which must be in the stack\'s
-- region. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
-- If you also specify a value for @DefaultSubnetId@, the subnet must be in
-- the same zone. For more information, see CreateStack.
updateStack_defaultAvailabilityZone :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_defaultAvailabilityZone :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_defaultAvailabilityZone = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
defaultAvailabilityZone :: Maybe Text
$sel:defaultAvailabilityZone:UpdateStack' :: UpdateStack -> Maybe Text
defaultAvailabilityZone} -> Maybe Text
defaultAvailabilityZone) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:defaultAvailabilityZone:UpdateStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
a} :: UpdateStack)

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

-- | The stack\'s new name.
updateStack_name :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_name :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_name = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
name :: Maybe Text
$sel:name:UpdateStack' :: UpdateStack -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:name:UpdateStack' :: Maybe Text
name = Maybe Text
a} :: UpdateStack)

-- | The stack\'s operating system, which must be set to one of the
-- following:
--
-- -   A supported Linux operating system: An Amazon Linux version, such as
--     @Amazon Linux 2018.03@, @Amazon Linux 2017.09@,
--     @Amazon Linux 2017.03@, @Amazon Linux 2016.09@,
--     @Amazon Linux 2016.03@, @Amazon Linux 2015.09@, or
--     @Amazon Linux 2015.03@.
--
-- -   A supported Ubuntu operating system, such as @Ubuntu 16.04 LTS@,
--     @Ubuntu 14.04 LTS@, or @Ubuntu 12.04 LTS@.
--
-- -   @CentOS Linux 7@
--
-- -   @Red Hat Enterprise Linux 7@
--
-- -   A supported Windows operating system, such as
--     @Microsoft Windows Server 2012 R2 Base@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Express@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Standard@, or
--     @Microsoft Windows Server 2012 R2 with SQL Server Web@.
--
-- -   A custom AMI: @Custom@. You specify the custom AMI you want to use
--     when you create instances. For more information about how to use
--     custom AMIs with OpsWorks, see
--     <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html Using Custom AMIs>.
--
-- The default option is the stack\'s current operating system. For more
-- information about supported operating systems, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html AWS OpsWorks Stacks Operating Systems>.
updateStack_defaultOs :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_defaultOs :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_defaultOs = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
defaultOs :: Maybe Text
$sel:defaultOs:UpdateStack' :: UpdateStack -> Maybe Text
defaultOs} -> Maybe Text
defaultOs) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:defaultOs:UpdateStack' :: Maybe Text
defaultOs = Maybe Text
a} :: UpdateStack)

-- | Whether to associate the AWS OpsWorks Stacks built-in security groups
-- with the stack\'s layers.
--
-- AWS OpsWorks Stacks provides a standard set of built-in security groups,
-- one for each layer, which are associated with layers by default.
-- @UseOpsworksSecurityGroups@ allows you to provide your own custom
-- security groups instead of using the built-in groups.
-- @UseOpsworksSecurityGroups@ has the following settings:
--
-- -   True - AWS OpsWorks Stacks automatically associates the appropriate
--     built-in security group with each layer (default setting). You can
--     associate additional security groups with a layer after you create
--     it, but you cannot delete the built-in security group.
--
-- -   False - AWS OpsWorks Stacks does not associate built-in security
--     groups with layers. You must create appropriate EC2 security groups
--     and associate a security group with each layer that you create.
--     However, you can still manually associate a built-in security group
--     with a layer on. Custom security groups are required only for those
--     layers that need custom settings.
--
-- For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
updateStack_useOpsworksSecurityGroups :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Bool)
updateStack_useOpsworksSecurityGroups :: (Maybe Bool -> f (Maybe Bool)) -> UpdateStack -> f UpdateStack
updateStack_useOpsworksSecurityGroups = (UpdateStack -> Maybe Bool)
-> (UpdateStack -> Maybe Bool -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Bool
useOpsworksSecurityGroups :: Maybe Bool
$sel:useOpsworksSecurityGroups:UpdateStack' :: UpdateStack -> Maybe Bool
useOpsworksSecurityGroups} -> Maybe Bool
useOpsworksSecurityGroups) (\s :: UpdateStack
s@UpdateStack' {} Maybe Bool
a -> UpdateStack
s {$sel:useOpsworksSecurityGroups:UpdateStack' :: Maybe Bool
useOpsworksSecurityGroups = Maybe Bool
a} :: UpdateStack)

-- | Whether the stack uses custom cookbooks.
updateStack_useCustomCookbooks :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Bool)
updateStack_useCustomCookbooks :: (Maybe Bool -> f (Maybe Bool)) -> UpdateStack -> f UpdateStack
updateStack_useCustomCookbooks = (UpdateStack -> Maybe Bool)
-> (UpdateStack -> Maybe Bool -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Bool
useCustomCookbooks :: Maybe Bool
$sel:useCustomCookbooks:UpdateStack' :: UpdateStack -> Maybe Bool
useCustomCookbooks} -> Maybe Bool
useCustomCookbooks) (\s :: UpdateStack
s@UpdateStack' {} Maybe Bool
a -> UpdateStack
s {$sel:useCustomCookbooks:UpdateStack' :: Maybe Bool
useCustomCookbooks = Maybe Bool
a} :: UpdateStack)

-- | The stack\'s default VPC subnet ID. This parameter is required if you
-- specify a value for the @VpcId@ parameter. All instances are launched
-- into this subnet unless you specify otherwise when you create the
-- instance. If you also specify a value for @DefaultAvailabilityZone@, the
-- subnet must be in that zone. For information on default values and when
-- this parameter is required, see the @VpcId@ parameter description.
updateStack_defaultSubnetId :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_defaultSubnetId :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_defaultSubnetId = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
defaultSubnetId :: Maybe Text
$sel:defaultSubnetId:UpdateStack' :: UpdateStack -> Maybe Text
defaultSubnetId} -> Maybe Text
defaultSubnetId) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:defaultSubnetId:UpdateStack' :: Maybe Text
defaultSubnetId = Maybe Text
a} :: UpdateStack)

-- | The configuration manager. When you update a stack, we recommend that
-- you use the configuration manager to specify the Chef version: 12,
-- 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default
-- value for Linux stacks is currently 12.
updateStack_configurationManager :: Lens.Lens' UpdateStack (Prelude.Maybe StackConfigurationManager)
updateStack_configurationManager :: (Maybe StackConfigurationManager
 -> f (Maybe StackConfigurationManager))
-> UpdateStack -> f UpdateStack
updateStack_configurationManager = (UpdateStack -> Maybe StackConfigurationManager)
-> (UpdateStack -> Maybe StackConfigurationManager -> UpdateStack)
-> Lens
     UpdateStack
     UpdateStack
     (Maybe StackConfigurationManager)
     (Maybe StackConfigurationManager)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe StackConfigurationManager
configurationManager :: Maybe StackConfigurationManager
$sel:configurationManager:UpdateStack' :: UpdateStack -> Maybe StackConfigurationManager
configurationManager} -> Maybe StackConfigurationManager
configurationManager) (\s :: UpdateStack
s@UpdateStack' {} Maybe StackConfigurationManager
a -> UpdateStack
s {$sel:configurationManager:UpdateStack' :: Maybe StackConfigurationManager
configurationManager = Maybe StackConfigurationManager
a} :: UpdateStack)

-- | The stack\'s new host name theme, with spaces replaced by underscores.
-- The theme is used to generate host names for the stack\'s instances. By
-- default, @HostnameTheme@ is set to @Layer_Dependent@, which creates host
-- names by appending integers to the layer\'s short name. The other themes
-- are:
--
-- -   @Baked_Goods@
--
-- -   @Clouds@
--
-- -   @Europe_Cities@
--
-- -   @Fruits@
--
-- -   @Greek_Deities_and_Titans@
--
-- -   @Legendary_creatures_from_Japan@
--
-- -   @Planets_and_Moons@
--
-- -   @Roman_Deities@
--
-- -   @Scottish_Islands@
--
-- -   @US_Cities@
--
-- -   @Wild_Cats@
--
-- To obtain a generated host name, call @GetHostNameSuggestion@, which
-- returns a host name based on the current theme.
updateStack_hostnameTheme :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_hostnameTheme :: (Maybe Text -> f (Maybe Text)) -> UpdateStack -> f UpdateStack
updateStack_hostnameTheme = (UpdateStack -> Maybe Text)
-> (UpdateStack -> Maybe Text -> UpdateStack)
-> Lens UpdateStack UpdateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
hostnameTheme :: Maybe Text
$sel:hostnameTheme:UpdateStack' :: UpdateStack -> Maybe Text
hostnameTheme} -> Maybe Text
hostnameTheme) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:hostnameTheme:UpdateStack' :: Maybe Text
hostnameTheme = Maybe Text
a} :: UpdateStack)

-- | The stack ID.
updateStack_stackId :: Lens.Lens' UpdateStack Prelude.Text
updateStack_stackId :: (Text -> f Text) -> UpdateStack -> f UpdateStack
updateStack_stackId = (UpdateStack -> Text)
-> (UpdateStack -> Text -> UpdateStack)
-> Lens UpdateStack UpdateStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Text
stackId :: Text
$sel:stackId:UpdateStack' :: UpdateStack -> Text
stackId} -> Text
stackId) (\s :: UpdateStack
s@UpdateStack' {} Text
a -> UpdateStack
s {$sel:stackId:UpdateStack' :: Text
stackId = Text
a} :: UpdateStack)

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

instance Prelude.Hashable UpdateStack

instance Prelude.NFData UpdateStack

instance Core.ToHeaders UpdateStack where
  toHeaders :: UpdateStack -> [Header]
toHeaders =
    [Header] -> UpdateStack -> [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.UpdateStack" ::
                          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 UpdateStack where
  toJSON :: UpdateStack -> Value
toJSON UpdateStack' {Maybe Bool
Maybe Text
Maybe (HashMap StackAttributesKeys (Maybe Text))
Maybe ChefConfiguration
Maybe RootDeviceType
Maybe Source
Maybe StackConfigurationManager
Text
stackId :: Text
hostnameTheme :: Maybe Text
configurationManager :: Maybe StackConfigurationManager
defaultSubnetId :: Maybe Text
useCustomCookbooks :: Maybe Bool
useOpsworksSecurityGroups :: Maybe Bool
defaultOs :: Maybe Text
name :: Maybe Text
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
defaultAvailabilityZone :: Maybe Text
customCookbooksSource :: Maybe Source
customJson :: Maybe Text
defaultSshKeyName :: Maybe Text
agentVersion :: Maybe Text
chefConfiguration :: Maybe ChefConfiguration
defaultRootDeviceType :: Maybe RootDeviceType
serviceRoleArn :: Maybe Text
defaultInstanceProfileArn :: Maybe Text
$sel:stackId:UpdateStack' :: UpdateStack -> Text
$sel:hostnameTheme:UpdateStack' :: UpdateStack -> Maybe Text
$sel:configurationManager:UpdateStack' :: UpdateStack -> Maybe StackConfigurationManager
$sel:defaultSubnetId:UpdateStack' :: UpdateStack -> Maybe Text
$sel:useCustomCookbooks:UpdateStack' :: UpdateStack -> Maybe Bool
$sel:useOpsworksSecurityGroups:UpdateStack' :: UpdateStack -> Maybe Bool
$sel:defaultOs:UpdateStack' :: UpdateStack -> Maybe Text
$sel:name:UpdateStack' :: UpdateStack -> Maybe Text
$sel:attributes:UpdateStack' :: UpdateStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:defaultAvailabilityZone:UpdateStack' :: UpdateStack -> Maybe Text
$sel:customCookbooksSource:UpdateStack' :: UpdateStack -> Maybe Source
$sel:customJson:UpdateStack' :: UpdateStack -> Maybe Text
$sel:defaultSshKeyName:UpdateStack' :: UpdateStack -> Maybe Text
$sel:agentVersion:UpdateStack' :: UpdateStack -> Maybe Text
$sel:chefConfiguration:UpdateStack' :: UpdateStack -> Maybe ChefConfiguration
$sel:defaultRootDeviceType:UpdateStack' :: UpdateStack -> Maybe RootDeviceType
$sel:serviceRoleArn:UpdateStack' :: UpdateStack -> Maybe Text
$sel:defaultInstanceProfileArn:UpdateStack' :: UpdateStack -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DefaultInstanceProfileArn" 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
defaultInstanceProfileArn,
            (Text
"ServiceRoleArn" 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
serviceRoleArn,
            (Text
"DefaultRootDeviceType" Text -> RootDeviceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RootDeviceType -> Pair) -> Maybe RootDeviceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RootDeviceType
defaultRootDeviceType,
            (Text
"ChefConfiguration" Text -> ChefConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ChefConfiguration -> Pair)
-> Maybe ChefConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChefConfiguration
chefConfiguration,
            (Text
"AgentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
agentVersion,
            (Text
"DefaultSshKeyName" 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
defaultSshKeyName,
            (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
"CustomCookbooksSource" Text -> Source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Source -> Pair) -> Maybe Source -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Source
customCookbooksSource,
            (Text
"DefaultAvailabilityZone" 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
defaultAvailabilityZone,
            (Text
"Attributes" Text -> HashMap StackAttributesKeys (Maybe Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap StackAttributesKeys (Maybe Text) -> Pair)
-> Maybe (HashMap StackAttributesKeys (Maybe Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap StackAttributesKeys (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
"DefaultOs" 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
defaultOs,
            (Text
"UseOpsworksSecurityGroups" 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
useOpsworksSecurityGroups,
            (Text
"UseCustomCookbooks" 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
useCustomCookbooks,
            (Text
"DefaultSubnetId" 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
defaultSubnetId,
            (Text
"ConfigurationManager" Text -> StackConfigurationManager -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (StackConfigurationManager -> Pair)
-> Maybe StackConfigurationManager -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StackConfigurationManager
configurationManager,
            (Text
"HostnameTheme" 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
hostnameTheme,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StackId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stackId)
          ]
      )

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

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

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

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

instance Prelude.NFData UpdateStackResponse