{-# 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.CloneStack
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a clone of a specified stack. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html Clone a Stack>.
-- By default, all parameters are set to the values used by the parent
-- stack.
--
-- __Required Permissions__: To use this action, an IAM user must have an
-- attached policy that explicitly grants permissions. For more information
-- about user permissions, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html Managing User Permissions>.
module Amazonka.OpsWorks.CloneStack
  ( -- * Creating a Request
    CloneStack (..),
    newCloneStack,

    -- * Request Lenses
    cloneStack_agentVersion,
    cloneStack_attributes,
    cloneStack_chefConfiguration,
    cloneStack_cloneAppIds,
    cloneStack_clonePermissions,
    cloneStack_configurationManager,
    cloneStack_customCookbooksSource,
    cloneStack_customJson,
    cloneStack_defaultAvailabilityZone,
    cloneStack_defaultInstanceProfileArn,
    cloneStack_defaultOs,
    cloneStack_defaultRootDeviceType,
    cloneStack_defaultSshKeyName,
    cloneStack_defaultSubnetId,
    cloneStack_hostnameTheme,
    cloneStack_name,
    cloneStack_region,
    cloneStack_useCustomCookbooks,
    cloneStack_useOpsworksSecurityGroups,
    cloneStack_vpcId,
    cloneStack_sourceStackId,
    cloneStack_serviceRoleArn,

    -- * Destructuring the Response
    CloneStackResponse (..),
    newCloneStackResponse,

    -- * Response Lenses
    cloneStackResponse_stackId,
    cloneStackResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCloneStack' smart constructor.
data CloneStack = CloneStack'
  { -- | 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.
    CloneStack -> Maybe Text
agentVersion :: Prelude.Maybe Prelude.Text,
    -- | A list of stack attributes and values as key\/value pairs to be added to
    -- the cloned stack.
    CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes :: Prelude.Maybe (Prelude.HashMap StackAttributesKeys (Prelude.Maybe Prelude.Text)),
    -- | 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>.
    CloneStack -> Maybe ChefConfiguration
chefConfiguration :: Prelude.Maybe ChefConfiguration,
    -- | A list of source stack app IDs to be included in the cloned stack.
    CloneStack -> Maybe [Text]
cloneAppIds :: Prelude.Maybe [Prelude.Text],
    -- | Whether to clone the source stack\'s permissions.
    CloneStack -> Maybe Bool
clonePermissions :: Prelude.Maybe Prelude.Bool,
    -- | The configuration manager. When you clone 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.
    CloneStack -> Maybe StackConfigurationManager
configurationManager :: Prelude.Maybe StackConfigurationManager,
    -- | 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>.
    CloneStack -> Maybe Source
customCookbooksSource :: Prelude.Maybe Source,
    -- | A string that contains user-defined, custom JSON. It is used to override
    -- the corresponding default stack configuration JSON values. 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>
    CloneStack -> Maybe Text
customJson :: Prelude.Maybe Prelude.Text,
    -- | The cloned stack\'s default Availability Zone, which must be in the
    -- specified 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 the @VpcId@ parameter
    -- description.
    CloneStack -> Maybe Text
defaultAvailabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (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>.
    CloneStack -> Maybe Text
defaultInstanceProfileArn :: 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@
    --
    -- -   @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 parent stack\'s 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>.
    --
    -- You can specify a different Linux operating system for the cloned stack,
    -- but you cannot change from Linux to Windows or Windows to Linux.
    CloneStack -> Maybe Text
defaultOs :: Prelude.Maybe Prelude.Text,
    -- | The default root device type. This value is used by default for all
    -- instances in the cloned 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>.
    CloneStack -> Maybe RootDeviceType
defaultRootDeviceType :: Prelude.Maybe RootDeviceType,
    -- | A default Amazon EC2 key pair name. The default value is none. If you
    -- specify a key pair name, AWS OpsWorks 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>.
    CloneStack -> Maybe Text
defaultSshKeyName :: Prelude.Maybe Prelude.Text,
    -- | 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.
    CloneStack -> Maybe Text
defaultSubnetId :: Prelude.Maybe Prelude.Text,
    -- | The stack\'s host name theme, with spaces are 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.
    CloneStack -> Maybe Text
hostnameTheme :: Prelude.Maybe Prelude.Text,
    -- | The cloned stack name.
    CloneStack -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The cloned stack AWS region, such as \"ap-northeast-2\". For more
    -- information about AWS regions, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
    CloneStack -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Whether to use custom cookbooks.
    CloneStack -> Maybe Bool
useCustomCookbooks :: Prelude.Maybe Prelude.Bool,
    -- | 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. With
    -- @UseOpsworksSecurityGroups@ you can instead provide your own custom
    -- security 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 Amazon Elastic
    --     Compute Cloud (Amazon 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
    --     creation; 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>.
    CloneStack -> Maybe Bool
useOpsworksSecurityGroups :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the VPC that the cloned stack is to be launched into. It must
    -- be in the specified region. All instances are launched into this VPC,
    -- and you cannot change the ID later.
    --
    -- -   If your account supports EC2 Classic, the default value is no VPC.
    --
    -- -   If your account does not support EC2 Classic, the default value is
    --     the default VPC for the specified region.
    --
    -- If the VPC ID corresponds to a default VPC and you have specified either
    -- the @DefaultAvailabilityZone@ or the @DefaultSubnetId@ parameter only,
    -- AWS OpsWorks Stacks infers the value of the other parameter. If you
    -- specify neither parameter, AWS OpsWorks Stacks sets these parameters to
    -- the first valid Availability Zone for the specified region and the
    -- corresponding default VPC subnet ID, respectively.
    --
    -- If you specify a nondefault VPC ID, note the following:
    --
    -- -   It must belong to a VPC in your account that is in the specified
    --     region.
    --
    -- -   You must specify a value for @DefaultSubnetId@.
    --
    -- For more information about how to use AWS OpsWorks Stacks with a VPC,
    -- see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html Running a Stack in a VPC>.
    -- For more information about default VPC and EC2 Classic, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
    CloneStack -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The source stack ID.
    CloneStack -> Text
sourceStackId :: Prelude.Text,
    -- | The stack AWS Identity and Access Management (IAM) role, which allows
    -- AWS OpsWorks Stacks to work with AWS resources on your behalf. You must
    -- set this parameter to the Amazon Resource Name (ARN) for an existing IAM
    -- role. If you create a stack by using the AWS OpsWorks Stacks console, it
    -- creates the role for you. You can obtain an existing stack\'s IAM ARN
    -- programmatically by calling DescribePermissions. For more information
    -- about IAM ARNs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
    --
    -- You must set this parameter to a valid service role ARN or the action
    -- will fail; there is no default value. You can specify the source
    -- stack\'s service role ARN, if you prefer, but you must do so explicitly.
    CloneStack -> Text
serviceRoleArn :: Prelude.Text
  }
  deriving (CloneStack -> CloneStack -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloneStack -> CloneStack -> Bool
$c/= :: CloneStack -> CloneStack -> Bool
== :: CloneStack -> CloneStack -> Bool
$c== :: CloneStack -> CloneStack -> Bool
Prelude.Eq, ReadPrec [CloneStack]
ReadPrec CloneStack
Int -> ReadS CloneStack
ReadS [CloneStack]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloneStack]
$creadListPrec :: ReadPrec [CloneStack]
readPrec :: ReadPrec CloneStack
$creadPrec :: ReadPrec CloneStack
readList :: ReadS [CloneStack]
$creadList :: ReadS [CloneStack]
readsPrec :: Int -> ReadS CloneStack
$creadsPrec :: Int -> ReadS CloneStack
Prelude.Read, Int -> CloneStack -> ShowS
[CloneStack] -> ShowS
CloneStack -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloneStack] -> ShowS
$cshowList :: [CloneStack] -> ShowS
show :: CloneStack -> String
$cshow :: CloneStack -> String
showsPrec :: Int -> CloneStack -> ShowS
$cshowsPrec :: Int -> CloneStack -> ShowS
Prelude.Show, forall x. Rep CloneStack x -> CloneStack
forall x. CloneStack -> Rep CloneStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloneStack x -> CloneStack
$cfrom :: forall x. CloneStack -> Rep CloneStack x
Prelude.Generic)

-- |
-- Create a value of 'CloneStack' 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:
--
-- 'agentVersion', 'cloneStack_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.
--
-- 'attributes', 'cloneStack_attributes' - A list of stack attributes and values as key\/value pairs to be added to
-- the cloned stack.
--
-- 'chefConfiguration', 'cloneStack_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>.
--
-- 'cloneAppIds', 'cloneStack_cloneAppIds' - A list of source stack app IDs to be included in the cloned stack.
--
-- 'clonePermissions', 'cloneStack_clonePermissions' - Whether to clone the source stack\'s permissions.
--
-- 'configurationManager', 'cloneStack_configurationManager' - The configuration manager. When you clone 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.
--
-- 'customCookbooksSource', 'cloneStack_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>.
--
-- 'customJson', 'cloneStack_customJson' - A string that contains user-defined, custom JSON. It is used to override
-- the corresponding default stack configuration JSON values. 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>
--
-- 'defaultAvailabilityZone', 'cloneStack_defaultAvailabilityZone' - The cloned stack\'s default Availability Zone, which must be in the
-- specified 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 the @VpcId@ parameter
-- description.
--
-- 'defaultInstanceProfileArn', 'cloneStack_defaultInstanceProfileArn' - The Amazon Resource Name (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>.
--
-- 'defaultOs', 'cloneStack_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@
--
-- -   @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 parent stack\'s 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>.
--
-- You can specify a different Linux operating system for the cloned stack,
-- but you cannot change from Linux to Windows or Windows to Linux.
--
-- 'defaultRootDeviceType', 'cloneStack_defaultRootDeviceType' - The default root device type. This value is used by default for all
-- instances in the cloned 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>.
--
-- 'defaultSshKeyName', 'cloneStack_defaultSshKeyName' - A default Amazon EC2 key pair name. The default value is none. If you
-- specify a key pair name, AWS OpsWorks 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>.
--
-- 'defaultSubnetId', 'cloneStack_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.
--
-- 'hostnameTheme', 'cloneStack_hostnameTheme' - The stack\'s host name theme, with spaces are 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.
--
-- 'name', 'cloneStack_name' - The cloned stack name.
--
-- 'region', 'cloneStack_region' - The cloned stack AWS region, such as \"ap-northeast-2\". For more
-- information about AWS regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
--
-- 'useCustomCookbooks', 'cloneStack_useCustomCookbooks' - Whether to use custom cookbooks.
--
-- 'useOpsworksSecurityGroups', 'cloneStack_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. With
-- @UseOpsworksSecurityGroups@ you can instead provide your own custom
-- security 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 Amazon Elastic
--     Compute Cloud (Amazon 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
--     creation; 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>.
--
-- 'vpcId', 'cloneStack_vpcId' - The ID of the VPC that the cloned stack is to be launched into. It must
-- be in the specified region. All instances are launched into this VPC,
-- and you cannot change the ID later.
--
-- -   If your account supports EC2 Classic, the default value is no VPC.
--
-- -   If your account does not support EC2 Classic, the default value is
--     the default VPC for the specified region.
--
-- If the VPC ID corresponds to a default VPC and you have specified either
-- the @DefaultAvailabilityZone@ or the @DefaultSubnetId@ parameter only,
-- AWS OpsWorks Stacks infers the value of the other parameter. If you
-- specify neither parameter, AWS OpsWorks Stacks sets these parameters to
-- the first valid Availability Zone for the specified region and the
-- corresponding default VPC subnet ID, respectively.
--
-- If you specify a nondefault VPC ID, note the following:
--
-- -   It must belong to a VPC in your account that is in the specified
--     region.
--
-- -   You must specify a value for @DefaultSubnetId@.
--
-- For more information about how to use AWS OpsWorks Stacks with a VPC,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html Running a Stack in a VPC>.
-- For more information about default VPC and EC2 Classic, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
--
-- 'sourceStackId', 'cloneStack_sourceStackId' - The source stack ID.
--
-- 'serviceRoleArn', 'cloneStack_serviceRoleArn' - The stack AWS Identity and Access Management (IAM) role, which allows
-- AWS OpsWorks Stacks to work with AWS resources on your behalf. You must
-- set this parameter to the Amazon Resource Name (ARN) for an existing IAM
-- role. If you create a stack by using the AWS OpsWorks Stacks console, it
-- creates the role for you. You can obtain an existing stack\'s IAM ARN
-- programmatically by calling DescribePermissions. For more information
-- about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
--
-- You must set this parameter to a valid service role ARN or the action
-- will fail; there is no default value. You can specify the source
-- stack\'s service role ARN, if you prefer, but you must do so explicitly.
newCloneStack ::
  -- | 'sourceStackId'
  Prelude.Text ->
  -- | 'serviceRoleArn'
  Prelude.Text ->
  CloneStack
newCloneStack :: Text -> Text -> CloneStack
newCloneStack Text
pSourceStackId_ Text
pServiceRoleArn_ =
  CloneStack'
    { $sel:agentVersion:CloneStack' :: Maybe Text
agentVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:CloneStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = forall a. Maybe a
Prelude.Nothing,
      $sel:chefConfiguration:CloneStack' :: Maybe ChefConfiguration
chefConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:cloneAppIds:CloneStack' :: Maybe [Text]
cloneAppIds = forall a. Maybe a
Prelude.Nothing,
      $sel:clonePermissions:CloneStack' :: Maybe Bool
clonePermissions = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationManager:CloneStack' :: Maybe StackConfigurationManager
configurationManager = forall a. Maybe a
Prelude.Nothing,
      $sel:customCookbooksSource:CloneStack' :: Maybe Source
customCookbooksSource = forall a. Maybe a
Prelude.Nothing,
      $sel:customJson:CloneStack' :: Maybe Text
customJson = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultAvailabilityZone:CloneStack' :: Maybe Text
defaultAvailabilityZone = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultInstanceProfileArn:CloneStack' :: Maybe Text
defaultInstanceProfileArn = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultOs:CloneStack' :: Maybe Text
defaultOs = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRootDeviceType:CloneStack' :: Maybe RootDeviceType
defaultRootDeviceType = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSshKeyName:CloneStack' :: Maybe Text
defaultSshKeyName = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSubnetId:CloneStack' :: Maybe Text
defaultSubnetId = forall a. Maybe a
Prelude.Nothing,
      $sel:hostnameTheme:CloneStack' :: Maybe Text
hostnameTheme = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CloneStack' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:region:CloneStack' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:useCustomCookbooks:CloneStack' :: Maybe Bool
useCustomCookbooks = forall a. Maybe a
Prelude.Nothing,
      $sel:useOpsworksSecurityGroups:CloneStack' :: Maybe Bool
useOpsworksSecurityGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:CloneStack' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceStackId:CloneStack' :: Text
sourceStackId = Text
pSourceStackId_,
      $sel:serviceRoleArn:CloneStack' :: Text
serviceRoleArn = Text
pServiceRoleArn_
    }

-- | 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.
cloneStack_agentVersion :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_agentVersion :: Lens' CloneStack (Maybe Text)
cloneStack_agentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:CloneStack' :: CloneStack -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:agentVersion:CloneStack' :: Maybe Text
agentVersion = Maybe Text
a} :: CloneStack)

-- | A list of stack attributes and values as key\/value pairs to be added to
-- the cloned stack.
cloneStack_attributes :: Lens.Lens' CloneStack (Prelude.Maybe (Prelude.HashMap StackAttributesKeys (Prelude.Maybe Prelude.Text)))
cloneStack_attributes :: Lens' CloneStack (Maybe (HashMap StackAttributesKeys (Maybe Text)))
cloneStack_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:attributes:CloneStack' :: CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes} -> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes) (\s :: CloneStack
s@CloneStack' {} Maybe (HashMap StackAttributesKeys (Maybe Text))
a -> CloneStack
s {$sel:attributes:CloneStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = Maybe (HashMap StackAttributesKeys (Maybe Text))
a} :: CloneStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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>.
cloneStack_chefConfiguration :: Lens.Lens' CloneStack (Prelude.Maybe ChefConfiguration)
cloneStack_chefConfiguration :: Lens' CloneStack (Maybe ChefConfiguration)
cloneStack_chefConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe ChefConfiguration
chefConfiguration :: Maybe ChefConfiguration
$sel:chefConfiguration:CloneStack' :: CloneStack -> Maybe ChefConfiguration
chefConfiguration} -> Maybe ChefConfiguration
chefConfiguration) (\s :: CloneStack
s@CloneStack' {} Maybe ChefConfiguration
a -> CloneStack
s {$sel:chefConfiguration:CloneStack' :: Maybe ChefConfiguration
chefConfiguration = Maybe ChefConfiguration
a} :: CloneStack)

-- | A list of source stack app IDs to be included in the cloned stack.
cloneStack_cloneAppIds :: Lens.Lens' CloneStack (Prelude.Maybe [Prelude.Text])
cloneStack_cloneAppIds :: Lens' CloneStack (Maybe [Text])
cloneStack_cloneAppIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe [Text]
cloneAppIds :: Maybe [Text]
$sel:cloneAppIds:CloneStack' :: CloneStack -> Maybe [Text]
cloneAppIds} -> Maybe [Text]
cloneAppIds) (\s :: CloneStack
s@CloneStack' {} Maybe [Text]
a -> CloneStack
s {$sel:cloneAppIds:CloneStack' :: Maybe [Text]
cloneAppIds = Maybe [Text]
a} :: CloneStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether to clone the source stack\'s permissions.
cloneStack_clonePermissions :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Bool)
cloneStack_clonePermissions :: Lens' CloneStack (Maybe Bool)
cloneStack_clonePermissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Bool
clonePermissions :: Maybe Bool
$sel:clonePermissions:CloneStack' :: CloneStack -> Maybe Bool
clonePermissions} -> Maybe Bool
clonePermissions) (\s :: CloneStack
s@CloneStack' {} Maybe Bool
a -> CloneStack
s {$sel:clonePermissions:CloneStack' :: Maybe Bool
clonePermissions = Maybe Bool
a} :: CloneStack)

-- | The configuration manager. When you clone 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.
cloneStack_configurationManager :: Lens.Lens' CloneStack (Prelude.Maybe StackConfigurationManager)
cloneStack_configurationManager :: Lens' CloneStack (Maybe StackConfigurationManager)
cloneStack_configurationManager = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe StackConfigurationManager
configurationManager :: Maybe StackConfigurationManager
$sel:configurationManager:CloneStack' :: CloneStack -> Maybe StackConfigurationManager
configurationManager} -> Maybe StackConfigurationManager
configurationManager) (\s :: CloneStack
s@CloneStack' {} Maybe StackConfigurationManager
a -> CloneStack
s {$sel:configurationManager:CloneStack' :: Maybe StackConfigurationManager
configurationManager = Maybe StackConfigurationManager
a} :: CloneStack)

-- | 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>.
cloneStack_customCookbooksSource :: Lens.Lens' CloneStack (Prelude.Maybe Source)
cloneStack_customCookbooksSource :: Lens' CloneStack (Maybe Source)
cloneStack_customCookbooksSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Source
customCookbooksSource :: Maybe Source
$sel:customCookbooksSource:CloneStack' :: CloneStack -> Maybe Source
customCookbooksSource} -> Maybe Source
customCookbooksSource) (\s :: CloneStack
s@CloneStack' {} Maybe Source
a -> CloneStack
s {$sel:customCookbooksSource:CloneStack' :: Maybe Source
customCookbooksSource = Maybe Source
a} :: CloneStack)

-- | A string that contains user-defined, custom JSON. It is used to override
-- the corresponding default stack configuration JSON values. 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>
cloneStack_customJson :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_customJson :: Lens' CloneStack (Maybe Text)
cloneStack_customJson = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
customJson :: Maybe Text
$sel:customJson:CloneStack' :: CloneStack -> Maybe Text
customJson} -> Maybe Text
customJson) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:customJson:CloneStack' :: Maybe Text
customJson = Maybe Text
a} :: CloneStack)

-- | The cloned stack\'s default Availability Zone, which must be in the
-- specified 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 the @VpcId@ parameter
-- description.
cloneStack_defaultAvailabilityZone :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_defaultAvailabilityZone :: Lens' CloneStack (Maybe Text)
cloneStack_defaultAvailabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
defaultAvailabilityZone :: Maybe Text
$sel:defaultAvailabilityZone:CloneStack' :: CloneStack -> Maybe Text
defaultAvailabilityZone} -> Maybe Text
defaultAvailabilityZone) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:defaultAvailabilityZone:CloneStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
a} :: CloneStack)

-- | The Amazon Resource Name (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>.
cloneStack_defaultInstanceProfileArn :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_defaultInstanceProfileArn :: Lens' CloneStack (Maybe Text)
cloneStack_defaultInstanceProfileArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
defaultInstanceProfileArn :: Maybe Text
$sel:defaultInstanceProfileArn:CloneStack' :: CloneStack -> Maybe Text
defaultInstanceProfileArn} -> Maybe Text
defaultInstanceProfileArn) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:defaultInstanceProfileArn:CloneStack' :: Maybe Text
defaultInstanceProfileArn = Maybe Text
a} :: CloneStack)

-- | 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@
--
-- -   @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 parent stack\'s 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>.
--
-- You can specify a different Linux operating system for the cloned stack,
-- but you cannot change from Linux to Windows or Windows to Linux.
cloneStack_defaultOs :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_defaultOs :: Lens' CloneStack (Maybe Text)
cloneStack_defaultOs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
defaultOs :: Maybe Text
$sel:defaultOs:CloneStack' :: CloneStack -> Maybe Text
defaultOs} -> Maybe Text
defaultOs) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:defaultOs:CloneStack' :: Maybe Text
defaultOs = Maybe Text
a} :: CloneStack)

-- | The default root device type. This value is used by default for all
-- instances in the cloned 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>.
cloneStack_defaultRootDeviceType :: Lens.Lens' CloneStack (Prelude.Maybe RootDeviceType)
cloneStack_defaultRootDeviceType :: Lens' CloneStack (Maybe RootDeviceType)
cloneStack_defaultRootDeviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe RootDeviceType
defaultRootDeviceType :: Maybe RootDeviceType
$sel:defaultRootDeviceType:CloneStack' :: CloneStack -> Maybe RootDeviceType
defaultRootDeviceType} -> Maybe RootDeviceType
defaultRootDeviceType) (\s :: CloneStack
s@CloneStack' {} Maybe RootDeviceType
a -> CloneStack
s {$sel:defaultRootDeviceType:CloneStack' :: Maybe RootDeviceType
defaultRootDeviceType = Maybe RootDeviceType
a} :: CloneStack)

-- | A default Amazon EC2 key pair name. The default value is none. If you
-- specify a key pair name, AWS OpsWorks 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>.
cloneStack_defaultSshKeyName :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_defaultSshKeyName :: Lens' CloneStack (Maybe Text)
cloneStack_defaultSshKeyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
defaultSshKeyName :: Maybe Text
$sel:defaultSshKeyName:CloneStack' :: CloneStack -> Maybe Text
defaultSshKeyName} -> Maybe Text
defaultSshKeyName) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:defaultSshKeyName:CloneStack' :: Maybe Text
defaultSshKeyName = Maybe Text
a} :: CloneStack)

-- | 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.
cloneStack_defaultSubnetId :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_defaultSubnetId :: Lens' CloneStack (Maybe Text)
cloneStack_defaultSubnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
defaultSubnetId :: Maybe Text
$sel:defaultSubnetId:CloneStack' :: CloneStack -> Maybe Text
defaultSubnetId} -> Maybe Text
defaultSubnetId) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:defaultSubnetId:CloneStack' :: Maybe Text
defaultSubnetId = Maybe Text
a} :: CloneStack)

-- | The stack\'s host name theme, with spaces are 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.
cloneStack_hostnameTheme :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_hostnameTheme :: Lens' CloneStack (Maybe Text)
cloneStack_hostnameTheme = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
hostnameTheme :: Maybe Text
$sel:hostnameTheme:CloneStack' :: CloneStack -> Maybe Text
hostnameTheme} -> Maybe Text
hostnameTheme) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:hostnameTheme:CloneStack' :: Maybe Text
hostnameTheme = Maybe Text
a} :: CloneStack)

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

-- | The cloned stack AWS region, such as \"ap-northeast-2\". For more
-- information about AWS regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
cloneStack_region :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_region :: Lens' CloneStack (Maybe Text)
cloneStack_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
region :: Maybe Text
$sel:region:CloneStack' :: CloneStack -> Maybe Text
region} -> Maybe Text
region) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:region:CloneStack' :: Maybe Text
region = Maybe Text
a} :: CloneStack)

-- | Whether to use custom cookbooks.
cloneStack_useCustomCookbooks :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Bool)
cloneStack_useCustomCookbooks :: Lens' CloneStack (Maybe Bool)
cloneStack_useCustomCookbooks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Bool
useCustomCookbooks :: Maybe Bool
$sel:useCustomCookbooks:CloneStack' :: CloneStack -> Maybe Bool
useCustomCookbooks} -> Maybe Bool
useCustomCookbooks) (\s :: CloneStack
s@CloneStack' {} Maybe Bool
a -> CloneStack
s {$sel:useCustomCookbooks:CloneStack' :: Maybe Bool
useCustomCookbooks = Maybe Bool
a} :: CloneStack)

-- | 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. With
-- @UseOpsworksSecurityGroups@ you can instead provide your own custom
-- security 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 Amazon Elastic
--     Compute Cloud (Amazon 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
--     creation; 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>.
cloneStack_useOpsworksSecurityGroups :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Bool)
cloneStack_useOpsworksSecurityGroups :: Lens' CloneStack (Maybe Bool)
cloneStack_useOpsworksSecurityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Bool
useOpsworksSecurityGroups :: Maybe Bool
$sel:useOpsworksSecurityGroups:CloneStack' :: CloneStack -> Maybe Bool
useOpsworksSecurityGroups} -> Maybe Bool
useOpsworksSecurityGroups) (\s :: CloneStack
s@CloneStack' {} Maybe Bool
a -> CloneStack
s {$sel:useOpsworksSecurityGroups:CloneStack' :: Maybe Bool
useOpsworksSecurityGroups = Maybe Bool
a} :: CloneStack)

-- | The ID of the VPC that the cloned stack is to be launched into. It must
-- be in the specified region. All instances are launched into this VPC,
-- and you cannot change the ID later.
--
-- -   If your account supports EC2 Classic, the default value is no VPC.
--
-- -   If your account does not support EC2 Classic, the default value is
--     the default VPC for the specified region.
--
-- If the VPC ID corresponds to a default VPC and you have specified either
-- the @DefaultAvailabilityZone@ or the @DefaultSubnetId@ parameter only,
-- AWS OpsWorks Stacks infers the value of the other parameter. If you
-- specify neither parameter, AWS OpsWorks Stacks sets these parameters to
-- the first valid Availability Zone for the specified region and the
-- corresponding default VPC subnet ID, respectively.
--
-- If you specify a nondefault VPC ID, note the following:
--
-- -   It must belong to a VPC in your account that is in the specified
--     region.
--
-- -   You must specify a value for @DefaultSubnetId@.
--
-- For more information about how to use AWS OpsWorks Stacks with a VPC,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html Running a Stack in a VPC>.
-- For more information about default VPC and EC2 Classic, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
cloneStack_vpcId :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_vpcId :: Lens' CloneStack (Maybe Text)
cloneStack_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:CloneStack' :: CloneStack -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: CloneStack
s@CloneStack' {} Maybe Text
a -> CloneStack
s {$sel:vpcId:CloneStack' :: Maybe Text
vpcId = Maybe Text
a} :: CloneStack)

-- | The source stack ID.
cloneStack_sourceStackId :: Lens.Lens' CloneStack Prelude.Text
cloneStack_sourceStackId :: Lens' CloneStack Text
cloneStack_sourceStackId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Text
sourceStackId :: Text
$sel:sourceStackId:CloneStack' :: CloneStack -> Text
sourceStackId} -> Text
sourceStackId) (\s :: CloneStack
s@CloneStack' {} Text
a -> CloneStack
s {$sel:sourceStackId:CloneStack' :: Text
sourceStackId = Text
a} :: CloneStack)

-- | The stack AWS Identity and Access Management (IAM) role, which allows
-- AWS OpsWorks Stacks to work with AWS resources on your behalf. You must
-- set this parameter to the Amazon Resource Name (ARN) for an existing IAM
-- role. If you create a stack by using the AWS OpsWorks Stacks console, it
-- creates the role for you. You can obtain an existing stack\'s IAM ARN
-- programmatically by calling DescribePermissions. For more information
-- about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
--
-- You must set this parameter to a valid service role ARN or the action
-- will fail; there is no default value. You can specify the source
-- stack\'s service role ARN, if you prefer, but you must do so explicitly.
cloneStack_serviceRoleArn :: Lens.Lens' CloneStack Prelude.Text
cloneStack_serviceRoleArn :: Lens' CloneStack Text
cloneStack_serviceRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloneStack' {Text
serviceRoleArn :: Text
$sel:serviceRoleArn:CloneStack' :: CloneStack -> Text
serviceRoleArn} -> Text
serviceRoleArn) (\s :: CloneStack
s@CloneStack' {} Text
a -> CloneStack
s {$sel:serviceRoleArn:CloneStack' :: Text
serviceRoleArn = Text
a} :: CloneStack)

instance Core.AWSRequest CloneStack where
  type AWSResponse CloneStack = CloneStackResponse
  request :: (Service -> Service) -> CloneStack -> Request CloneStack
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CloneStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CloneStack)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CloneStackResponse
CloneStackResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StackId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CloneStack where
  hashWithSalt :: Int -> CloneStack -> Int
hashWithSalt Int
_salt CloneStack' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap StackAttributesKeys (Maybe Text))
Maybe ChefConfiguration
Maybe RootDeviceType
Maybe Source
Maybe StackConfigurationManager
Text
serviceRoleArn :: Text
sourceStackId :: Text
vpcId :: Maybe Text
useOpsworksSecurityGroups :: Maybe Bool
useCustomCookbooks :: Maybe Bool
region :: Maybe Text
name :: Maybe Text
hostnameTheme :: Maybe Text
defaultSubnetId :: Maybe Text
defaultSshKeyName :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
defaultOs :: Maybe Text
defaultInstanceProfileArn :: Maybe Text
defaultAvailabilityZone :: Maybe Text
customJson :: Maybe Text
customCookbooksSource :: Maybe Source
configurationManager :: Maybe StackConfigurationManager
clonePermissions :: Maybe Bool
cloneAppIds :: Maybe [Text]
chefConfiguration :: Maybe ChefConfiguration
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
agentVersion :: Maybe Text
$sel:serviceRoleArn:CloneStack' :: CloneStack -> Text
$sel:sourceStackId:CloneStack' :: CloneStack -> Text
$sel:vpcId:CloneStack' :: CloneStack -> Maybe Text
$sel:useOpsworksSecurityGroups:CloneStack' :: CloneStack -> Maybe Bool
$sel:useCustomCookbooks:CloneStack' :: CloneStack -> Maybe Bool
$sel:region:CloneStack' :: CloneStack -> Maybe Text
$sel:name:CloneStack' :: CloneStack -> Maybe Text
$sel:hostnameTheme:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSubnetId:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSshKeyName:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultRootDeviceType:CloneStack' :: CloneStack -> Maybe RootDeviceType
$sel:defaultOs:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultInstanceProfileArn:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultAvailabilityZone:CloneStack' :: CloneStack -> Maybe Text
$sel:customJson:CloneStack' :: CloneStack -> Maybe Text
$sel:customCookbooksSource:CloneStack' :: CloneStack -> Maybe Source
$sel:configurationManager:CloneStack' :: CloneStack -> Maybe StackConfigurationManager
$sel:clonePermissions:CloneStack' :: CloneStack -> Maybe Bool
$sel:cloneAppIds:CloneStack' :: CloneStack -> Maybe [Text]
$sel:chefConfiguration:CloneStack' :: CloneStack -> Maybe ChefConfiguration
$sel:attributes:CloneStack' :: CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:agentVersion:CloneStack' :: CloneStack -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
agentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChefConfiguration
chefConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
cloneAppIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
clonePermissions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackConfigurationManager
configurationManager
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Source
customCookbooksSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customJson
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultAvailabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultInstanceProfileArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultOs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RootDeviceType
defaultRootDeviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSshKeyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostnameTheme
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useCustomCookbooks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useOpsworksSecurityGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceStackId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceRoleArn

instance Prelude.NFData CloneStack where
  rnf :: CloneStack -> ()
rnf CloneStack' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap StackAttributesKeys (Maybe Text))
Maybe ChefConfiguration
Maybe RootDeviceType
Maybe Source
Maybe StackConfigurationManager
Text
serviceRoleArn :: Text
sourceStackId :: Text
vpcId :: Maybe Text
useOpsworksSecurityGroups :: Maybe Bool
useCustomCookbooks :: Maybe Bool
region :: Maybe Text
name :: Maybe Text
hostnameTheme :: Maybe Text
defaultSubnetId :: Maybe Text
defaultSshKeyName :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
defaultOs :: Maybe Text
defaultInstanceProfileArn :: Maybe Text
defaultAvailabilityZone :: Maybe Text
customJson :: Maybe Text
customCookbooksSource :: Maybe Source
configurationManager :: Maybe StackConfigurationManager
clonePermissions :: Maybe Bool
cloneAppIds :: Maybe [Text]
chefConfiguration :: Maybe ChefConfiguration
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
agentVersion :: Maybe Text
$sel:serviceRoleArn:CloneStack' :: CloneStack -> Text
$sel:sourceStackId:CloneStack' :: CloneStack -> Text
$sel:vpcId:CloneStack' :: CloneStack -> Maybe Text
$sel:useOpsworksSecurityGroups:CloneStack' :: CloneStack -> Maybe Bool
$sel:useCustomCookbooks:CloneStack' :: CloneStack -> Maybe Bool
$sel:region:CloneStack' :: CloneStack -> Maybe Text
$sel:name:CloneStack' :: CloneStack -> Maybe Text
$sel:hostnameTheme:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSubnetId:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSshKeyName:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultRootDeviceType:CloneStack' :: CloneStack -> Maybe RootDeviceType
$sel:defaultOs:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultInstanceProfileArn:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultAvailabilityZone:CloneStack' :: CloneStack -> Maybe Text
$sel:customJson:CloneStack' :: CloneStack -> Maybe Text
$sel:customCookbooksSource:CloneStack' :: CloneStack -> Maybe Source
$sel:configurationManager:CloneStack' :: CloneStack -> Maybe StackConfigurationManager
$sel:clonePermissions:CloneStack' :: CloneStack -> Maybe Bool
$sel:cloneAppIds:CloneStack' :: CloneStack -> Maybe [Text]
$sel:chefConfiguration:CloneStack' :: CloneStack -> Maybe ChefConfiguration
$sel:attributes:CloneStack' :: CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:agentVersion:CloneStack' :: CloneStack -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
agentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChefConfiguration
chefConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
cloneAppIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
clonePermissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackConfigurationManager
configurationManager
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Source
customCookbooksSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customJson
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultAvailabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultInstanceProfileArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultOs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RootDeviceType
defaultRootDeviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSshKeyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostnameTheme
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useCustomCookbooks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Bool
useOpsworksSecurityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceStackId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceRoleArn

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

instance Data.ToJSON CloneStack where
  toJSON :: CloneStack -> Value
toJSON CloneStack' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap StackAttributesKeys (Maybe Text))
Maybe ChefConfiguration
Maybe RootDeviceType
Maybe Source
Maybe StackConfigurationManager
Text
serviceRoleArn :: Text
sourceStackId :: Text
vpcId :: Maybe Text
useOpsworksSecurityGroups :: Maybe Bool
useCustomCookbooks :: Maybe Bool
region :: Maybe Text
name :: Maybe Text
hostnameTheme :: Maybe Text
defaultSubnetId :: Maybe Text
defaultSshKeyName :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
defaultOs :: Maybe Text
defaultInstanceProfileArn :: Maybe Text
defaultAvailabilityZone :: Maybe Text
customJson :: Maybe Text
customCookbooksSource :: Maybe Source
configurationManager :: Maybe StackConfigurationManager
clonePermissions :: Maybe Bool
cloneAppIds :: Maybe [Text]
chefConfiguration :: Maybe ChefConfiguration
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
agentVersion :: Maybe Text
$sel:serviceRoleArn:CloneStack' :: CloneStack -> Text
$sel:sourceStackId:CloneStack' :: CloneStack -> Text
$sel:vpcId:CloneStack' :: CloneStack -> Maybe Text
$sel:useOpsworksSecurityGroups:CloneStack' :: CloneStack -> Maybe Bool
$sel:useCustomCookbooks:CloneStack' :: CloneStack -> Maybe Bool
$sel:region:CloneStack' :: CloneStack -> Maybe Text
$sel:name:CloneStack' :: CloneStack -> Maybe Text
$sel:hostnameTheme:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSubnetId:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSshKeyName:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultRootDeviceType:CloneStack' :: CloneStack -> Maybe RootDeviceType
$sel:defaultOs:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultInstanceProfileArn:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultAvailabilityZone:CloneStack' :: CloneStack -> Maybe Text
$sel:customJson:CloneStack' :: CloneStack -> Maybe Text
$sel:customCookbooksSource:CloneStack' :: CloneStack -> Maybe Source
$sel:configurationManager:CloneStack' :: CloneStack -> Maybe StackConfigurationManager
$sel:clonePermissions:CloneStack' :: CloneStack -> Maybe Bool
$sel:cloneAppIds:CloneStack' :: CloneStack -> Maybe [Text]
$sel:chefConfiguration:CloneStack' :: CloneStack -> Maybe ChefConfiguration
$sel:attributes:CloneStack' :: CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:agentVersion:CloneStack' :: CloneStack -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AgentVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
agentVersion,
            (Key
"Attributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes,
            (Key
"ChefConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChefConfiguration
chefConfiguration,
            (Key
"CloneAppIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cloneAppIds,
            (Key
"ClonePermissions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
clonePermissions,
            (Key
"ConfigurationManager" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StackConfigurationManager
configurationManager,
            (Key
"CustomCookbooksSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Source
customCookbooksSource,
            (Key
"CustomJson" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customJson,
            (Key
"DefaultAvailabilityZone" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultAvailabilityZone,
            (Key
"DefaultInstanceProfileArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultInstanceProfileArn,
            (Key
"DefaultOs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultOs,
            (Key
"DefaultRootDeviceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RootDeviceType
defaultRootDeviceType,
            (Key
"DefaultSshKeyName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultSshKeyName,
            (Key
"DefaultSubnetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultSubnetId,
            (Key
"HostnameTheme" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
hostnameTheme,
            (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"Region" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
region,
            (Key
"UseCustomCookbooks" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useCustomCookbooks,
            (Key
"UseOpsworksSecurityGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useOpsworksSecurityGroups,
            (Key
"VpcId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcId,
            forall a. a -> Maybe a
Prelude.Just (Key
"SourceStackId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceStackId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ServiceRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceRoleArn)
          ]
      )

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

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

-- | Contains the response to a @CloneStack@ request.
--
-- /See:/ 'newCloneStackResponse' smart constructor.
data CloneStackResponse = CloneStackResponse'
  { -- | The cloned stack ID.
    CloneStackResponse -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CloneStackResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CloneStackResponse -> CloneStackResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloneStackResponse -> CloneStackResponse -> Bool
$c/= :: CloneStackResponse -> CloneStackResponse -> Bool
== :: CloneStackResponse -> CloneStackResponse -> Bool
$c== :: CloneStackResponse -> CloneStackResponse -> Bool
Prelude.Eq, ReadPrec [CloneStackResponse]
ReadPrec CloneStackResponse
Int -> ReadS CloneStackResponse
ReadS [CloneStackResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloneStackResponse]
$creadListPrec :: ReadPrec [CloneStackResponse]
readPrec :: ReadPrec CloneStackResponse
$creadPrec :: ReadPrec CloneStackResponse
readList :: ReadS [CloneStackResponse]
$creadList :: ReadS [CloneStackResponse]
readsPrec :: Int -> ReadS CloneStackResponse
$creadsPrec :: Int -> ReadS CloneStackResponse
Prelude.Read, Int -> CloneStackResponse -> ShowS
[CloneStackResponse] -> ShowS
CloneStackResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloneStackResponse] -> ShowS
$cshowList :: [CloneStackResponse] -> ShowS
show :: CloneStackResponse -> String
$cshow :: CloneStackResponse -> String
showsPrec :: Int -> CloneStackResponse -> ShowS
$cshowsPrec :: Int -> CloneStackResponse -> ShowS
Prelude.Show, forall x. Rep CloneStackResponse x -> CloneStackResponse
forall x. CloneStackResponse -> Rep CloneStackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloneStackResponse x -> CloneStackResponse
$cfrom :: forall x. CloneStackResponse -> Rep CloneStackResponse x
Prelude.Generic)

-- |
-- Create a value of 'CloneStackResponse' 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:
--
-- 'stackId', 'cloneStackResponse_stackId' - The cloned stack ID.
--
-- 'httpStatus', 'cloneStackResponse_httpStatus' - The response's http status code.
newCloneStackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CloneStackResponse
newCloneStackResponse :: Int -> CloneStackResponse
newCloneStackResponse Int
pHttpStatus_ =
  CloneStackResponse'
    { $sel:stackId:CloneStackResponse' :: Maybe Text
stackId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CloneStackResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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