{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a 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_defaultInstanceProfileArn,
    cloneStack_cloneAppIds,
    cloneStack_defaultRootDeviceType,
    cloneStack_vpcId,
    cloneStack_chefConfiguration,
    cloneStack_agentVersion,
    cloneStack_defaultSshKeyName,
    cloneStack_customJson,
    cloneStack_clonePermissions,
    cloneStack_customCookbooksSource,
    cloneStack_defaultAvailabilityZone,
    cloneStack_attributes,
    cloneStack_name,
    cloneStack_defaultOs,
    cloneStack_useOpsworksSecurityGroups,
    cloneStack_useCustomCookbooks,
    cloneStack_defaultSubnetId,
    cloneStack_region,
    cloneStack_configurationManager,
    cloneStack_hostnameTheme,
    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.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:/ 'newCloneStack' smart constructor.
data CloneStack = 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 -> Maybe Text
defaultInstanceProfileArn :: Prelude.Maybe Prelude.Text,
    -- | A list of source stack app IDs to be included in the cloned stack.
    CloneStack -> Maybe [Text]
cloneAppIds :: 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,
    -- | 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,
    -- | 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,
    -- | 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 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,
    -- | 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,
    -- | Whether to clone the source stack\'s permissions.
    CloneStack -> Maybe Bool
clonePermissions :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | 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,
    -- | 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)),
    -- | The cloned stack name.
    CloneStack -> 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@
    --
    -- -   @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,
    -- | 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,
    -- | Whether to use custom cookbooks.
    CloneStack -> 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.
    CloneStack -> Maybe Text
defaultSubnetId :: 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,
    -- | 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,
    -- | 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 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
(CloneStack -> CloneStack -> Bool)
-> (CloneStack -> CloneStack -> Bool) -> Eq CloneStack
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]
(Int -> ReadS CloneStack)
-> ReadS [CloneStack]
-> ReadPrec CloneStack
-> ReadPrec [CloneStack]
-> Read 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
(Int -> CloneStack -> ShowS)
-> (CloneStack -> String)
-> ([CloneStack] -> ShowS)
-> Show CloneStack
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. CloneStack -> Rep CloneStack x)
-> (forall x. Rep CloneStack x -> CloneStack) -> Generic CloneStack
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:
--
-- '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>.
--
-- 'cloneAppIds', 'cloneStack_cloneAppIds' - A list of source stack app IDs to be included in the cloned stack.
--
-- '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>.
--
-- '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>.
--
-- '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>.
--
-- '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.
--
-- '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>.
--
-- '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>
--
-- 'clonePermissions', 'cloneStack_clonePermissions' - Whether to clone the source stack\'s permissions.
--
-- '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>.
--
-- '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.
--
-- 'attributes', 'cloneStack_attributes' - A list of stack attributes and values as key\/value pairs to be added to
-- the cloned stack.
--
-- 'name', 'cloneStack_name' - The cloned stack name.
--
-- '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.
--
-- '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>.
--
-- 'useCustomCookbooks', 'cloneStack_useCustomCookbooks' - Whether to use custom cookbooks.
--
-- '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.
--
-- '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>.
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe [Text]
-> Maybe RootDeviceType
-> Maybe Text
-> Maybe ChefConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Source
-> Maybe Text
-> Maybe (HashMap StackAttributesKeys (Maybe Text))
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe StackConfigurationManager
-> Maybe Text
-> Text
-> Text
-> CloneStack
CloneStack'
    { $sel:defaultInstanceProfileArn:CloneStack' :: Maybe Text
defaultInstanceProfileArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloneAppIds:CloneStack' :: Maybe [Text]
cloneAppIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRootDeviceType:CloneStack' :: Maybe RootDeviceType
defaultRootDeviceType = Maybe RootDeviceType
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:CloneStack' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:chefConfiguration:CloneStack' :: Maybe ChefConfiguration
chefConfiguration = Maybe ChefConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:agentVersion:CloneStack' :: Maybe Text
agentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSshKeyName:CloneStack' :: Maybe Text
defaultSshKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customJson:CloneStack' :: Maybe Text
customJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clonePermissions:CloneStack' :: Maybe Bool
clonePermissions = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:customCookbooksSource:CloneStack' :: Maybe Source
customCookbooksSource = Maybe Source
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultAvailabilityZone:CloneStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:CloneStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = Maybe (HashMap StackAttributesKeys (Maybe Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CloneStack' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultOs:CloneStack' :: Maybe Text
defaultOs = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:useOpsworksSecurityGroups:CloneStack' :: Maybe Bool
useOpsworksSecurityGroups = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:useCustomCookbooks:CloneStack' :: Maybe Bool
useCustomCookbooks = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSubnetId:CloneStack' :: Maybe Text
defaultSubnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:CloneStack' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationManager:CloneStack' :: Maybe StackConfigurationManager
configurationManager = Maybe StackConfigurationManager
forall a. Maybe a
Prelude.Nothing,
      $sel:hostnameTheme:CloneStack' :: Maybe Text
hostnameTheme = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceStackId:CloneStack' :: Text
sourceStackId = Text
pSourceStackId_,
      $sel:serviceRoleArn:CloneStack' :: Text
serviceRoleArn = Text
pServiceRoleArn_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_defaultInstanceProfileArn = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text])) -> CloneStack -> f CloneStack
cloneStack_cloneAppIds = (CloneStack -> Maybe [Text])
-> (CloneStack -> Maybe [Text] -> CloneStack)
-> Lens CloneStack CloneStack (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text])) -> CloneStack -> f CloneStack)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CloneStack
-> f CloneStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: (Maybe RootDeviceType -> f (Maybe RootDeviceType))
-> CloneStack -> f CloneStack
cloneStack_defaultRootDeviceType = (CloneStack -> Maybe RootDeviceType)
-> (CloneStack -> Maybe RootDeviceType -> CloneStack)
-> Lens
     CloneStack CloneStack (Maybe RootDeviceType) (Maybe RootDeviceType)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_vpcId = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe ChefConfiguration -> f (Maybe ChefConfiguration))
-> CloneStack -> f CloneStack
cloneStack_chefConfiguration = (CloneStack -> Maybe ChefConfiguration)
-> (CloneStack -> Maybe ChefConfiguration -> CloneStack)
-> Lens
     CloneStack
     CloneStack
     (Maybe ChefConfiguration)
     (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_agentVersion = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_defaultSshKeyName = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_customJson = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | Whether to clone the source stack\'s permissions.
cloneStack_clonePermissions :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Bool)
cloneStack_clonePermissions :: (Maybe Bool -> f (Maybe Bool)) -> CloneStack -> f CloneStack
cloneStack_clonePermissions = (CloneStack -> Maybe Bool)
-> (CloneStack -> Maybe Bool -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Source -> f (Maybe Source)) -> CloneStack -> f CloneStack
cloneStack_customCookbooksSource = (CloneStack -> Maybe Source)
-> (CloneStack -> Maybe Source -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Source) (Maybe Source)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_defaultAvailabilityZone = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe (HashMap StackAttributesKeys (Maybe Text))
 -> f (Maybe (HashMap StackAttributesKeys (Maybe Text))))
-> CloneStack -> f CloneStack
cloneStack_attributes = (CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text)))
-> (CloneStack
    -> Maybe (HashMap StackAttributesKeys (Maybe Text)) -> CloneStack)
-> Lens
     CloneStack
     CloneStack
     (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 (\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) ((Maybe (HashMap StackAttributesKeys (Maybe Text))
  -> f (Maybe (HashMap StackAttributesKeys (Maybe Text))))
 -> CloneStack -> f CloneStack)
-> ((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))))
-> CloneStack
-> f CloneStack
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 cloned stack name.
cloneStack_name :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Text)
cloneStack_name :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_name = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_defaultOs = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool)) -> CloneStack -> f CloneStack
cloneStack_useOpsworksSecurityGroups = (CloneStack -> Maybe Bool)
-> (CloneStack -> Maybe Bool -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Bool) (Maybe Bool)
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)

-- | Whether to use custom cookbooks.
cloneStack_useCustomCookbooks :: Lens.Lens' CloneStack (Prelude.Maybe Prelude.Bool)
cloneStack_useCustomCookbooks :: (Maybe Bool -> f (Maybe Bool)) -> CloneStack -> f CloneStack
cloneStack_useCustomCookbooks = (CloneStack -> Maybe Bool)
-> (CloneStack -> Maybe Bool -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_defaultSubnetId = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_region = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe StackConfigurationManager
 -> f (Maybe StackConfigurationManager))
-> CloneStack -> f CloneStack
cloneStack_configurationManager = (CloneStack -> Maybe StackConfigurationManager)
-> (CloneStack -> Maybe StackConfigurationManager -> CloneStack)
-> Lens
     CloneStack
     CloneStack
     (Maybe StackConfigurationManager)
     (Maybe StackConfigurationManager)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> CloneStack -> f CloneStack
cloneStack_hostnameTheme = (CloneStack -> Maybe Text)
-> (CloneStack -> Maybe Text -> CloneStack)
-> Lens CloneStack CloneStack (Maybe Text) (Maybe Text)
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 source stack ID.
cloneStack_sourceStackId :: Lens.Lens' CloneStack Prelude.Text
cloneStack_sourceStackId :: (Text -> f Text) -> CloneStack -> f CloneStack
cloneStack_sourceStackId = (CloneStack -> Text)
-> (CloneStack -> Text -> CloneStack)
-> Lens CloneStack CloneStack Text Text
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 :: (Text -> f Text) -> CloneStack -> f CloneStack
cloneStack_serviceRoleArn = (CloneStack -> Text)
-> (CloneStack -> Text -> CloneStack)
-> Lens CloneStack CloneStack Text Text
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 :: CloneStack -> Request CloneStack
request = Service -> CloneStack -> Request CloneStack
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CloneStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CloneStack)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CloneStack))
-> Logger
-> Service
-> Proxy CloneStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CloneStack)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CloneStackResponse
CloneStackResponse'
            (Maybe Text -> Int -> CloneStackResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CloneStackResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StackId")
            Either String (Int -> CloneStackResponse)
-> Either String Int -> Either String CloneStackResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CloneStack

instance Prelude.NFData CloneStack

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

instance Core.ToJSON 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
hostnameTheme :: Maybe Text
configurationManager :: Maybe StackConfigurationManager
region :: Maybe Text
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
clonePermissions :: Maybe Bool
customJson :: Maybe Text
defaultSshKeyName :: Maybe Text
agentVersion :: Maybe Text
chefConfiguration :: Maybe ChefConfiguration
vpcId :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
cloneAppIds :: Maybe [Text]
defaultInstanceProfileArn :: Maybe Text
$sel:serviceRoleArn:CloneStack' :: CloneStack -> Text
$sel:sourceStackId:CloneStack' :: CloneStack -> Text
$sel:hostnameTheme:CloneStack' :: CloneStack -> Maybe Text
$sel:configurationManager:CloneStack' :: CloneStack -> Maybe StackConfigurationManager
$sel:region:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSubnetId:CloneStack' :: CloneStack -> Maybe Text
$sel:useCustomCookbooks:CloneStack' :: CloneStack -> Maybe Bool
$sel:useOpsworksSecurityGroups:CloneStack' :: CloneStack -> Maybe Bool
$sel:defaultOs:CloneStack' :: CloneStack -> Maybe Text
$sel:name:CloneStack' :: CloneStack -> Maybe Text
$sel:attributes:CloneStack' :: CloneStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:defaultAvailabilityZone:CloneStack' :: CloneStack -> Maybe Text
$sel:customCookbooksSource:CloneStack' :: CloneStack -> Maybe Source
$sel:clonePermissions:CloneStack' :: CloneStack -> Maybe Bool
$sel:customJson:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultSshKeyName:CloneStack' :: CloneStack -> Maybe Text
$sel:agentVersion:CloneStack' :: CloneStack -> Maybe Text
$sel:chefConfiguration:CloneStack' :: CloneStack -> Maybe ChefConfiguration
$sel:vpcId:CloneStack' :: CloneStack -> Maybe Text
$sel:defaultRootDeviceType:CloneStack' :: CloneStack -> Maybe RootDeviceType
$sel:cloneAppIds:CloneStack' :: CloneStack -> Maybe [Text]
$sel:defaultInstanceProfileArn:CloneStack' :: CloneStack -> 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
"CloneAppIds" 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]
cloneAppIds,
            (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
"VpcId" 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
vpcId,
            (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
"ClonePermissions" 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
clonePermissions,
            (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
"Region" 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
region,
            (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
"SourceStackId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceStackId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ServiceRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceRoleArn)
          ]
      )

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

instance Core.ToQuery CloneStack where
  toQuery :: CloneStack -> QueryString
toQuery = QueryString -> CloneStack -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CloneStackResponse -> CloneStackResponse -> Bool)
-> (CloneStackResponse -> CloneStackResponse -> Bool)
-> Eq CloneStackResponse
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]
(Int -> ReadS CloneStackResponse)
-> ReadS [CloneStackResponse]
-> ReadPrec CloneStackResponse
-> ReadPrec [CloneStackResponse]
-> Read 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
(Int -> CloneStackResponse -> ShowS)
-> (CloneStackResponse -> String)
-> ([CloneStackResponse] -> ShowS)
-> Show CloneStackResponse
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. CloneStackResponse -> Rep CloneStackResponse x)
-> (forall x. Rep CloneStackResponse x -> CloneStackResponse)
-> Generic CloneStackResponse
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' :: Maybe Text -> Int -> CloneStackResponse
CloneStackResponse'
    { $sel:stackId:CloneStackResponse' :: Maybe Text
stackId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> CloneStackResponse -> f CloneStackResponse
cloneStackResponse_stackId = (CloneStackResponse -> Maybe Text)
-> (CloneStackResponse -> Maybe Text -> CloneStackResponse)
-> Lens
     CloneStackResponse CloneStackResponse (Maybe Text) (Maybe Text)
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 :: (Int -> f Int) -> CloneStackResponse -> f CloneStackResponse
cloneStackResponse_httpStatus = (CloneStackResponse -> Int)
-> (CloneStackResponse -> Int -> CloneStackResponse)
-> Lens CloneStackResponse CloneStackResponse Int Int
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