{-# 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.CreateStack
-- 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 new stack. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-edit.html Create a New 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.CreateStack
  ( -- * Creating a Request
    CreateStack (..),
    newCreateStack,

    -- * Request Lenses
    createStack_defaultRootDeviceType,
    createStack_vpcId,
    createStack_chefConfiguration,
    createStack_agentVersion,
    createStack_defaultSshKeyName,
    createStack_customJson,
    createStack_customCookbooksSource,
    createStack_defaultAvailabilityZone,
    createStack_attributes,
    createStack_defaultOs,
    createStack_useOpsworksSecurityGroups,
    createStack_useCustomCookbooks,
    createStack_defaultSubnetId,
    createStack_configurationManager,
    createStack_hostnameTheme,
    createStack_name,
    createStack_region,
    createStack_serviceRoleArn,
    createStack_defaultInstanceProfileArn,

    -- * Destructuring the Response
    CreateStackResponse (..),
    newCreateStackResponse,

    -- * Response Lenses
    createStackResponse_stackId,
    createStackResponse_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:/ 'newCreateStack' smart constructor.
data CreateStack = CreateStack'
  { -- | The default root device type. This value is the default for all
    -- instances in the stack, but you can override it when you create an
    -- instance. The default option is @instance-store@. For more information,
    -- see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device Storage for the Root Device>.
    CreateStack -> Maybe RootDeviceType
defaultRootDeviceType :: Prelude.Maybe RootDeviceType,
    -- | The ID of the VPC that the stack is to be launched into. The VPC must be
    -- in the stack\'s region. All instances are launched into this VPC. 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>.
    CreateStack -> 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>.
    CreateStack -> 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 the most recent release of the agent. 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.
    CreateStack -> 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>.
    CreateStack -> Maybe Text
defaultSshKeyName :: Prelude.Maybe Prelude.Text,
    -- | A string that contains user-defined, custom JSON. It can be used to
    -- override the corresponding default stack configuration attribute values
    -- or to pass data to recipes. The string should be in the following
    -- format:
    --
    -- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
    --
    -- For more information about custom JSON, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
    CreateStack -> Maybe Text
customJson :: Prelude.Maybe Prelude.Text,
    -- | Contains the information required to retrieve an app or cookbook from a
    -- repository. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html Adding Apps>
    -- or
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html Cookbooks and Recipes>.
    CreateStack -> Maybe Source
customCookbooksSource :: Prelude.Maybe Source,
    -- | The 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.
    CreateStack -> Maybe Text
defaultAvailabilityZone :: Prelude.Maybe Prelude.Text,
    -- | One or more user-defined key-value pairs to be added to the stack
    -- attributes.
    CreateStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes :: Prelude.Maybe (Prelude.HashMap StackAttributesKeys (Prelude.Maybe Prelude.Text)),
    -- | The stack\'s default operating system, which is installed on every
    -- instance unless you specify a different operating system when you create
    -- the instance. You can specify one of the following.
    --
    -- -   A supported Linux operating system: An Amazon Linux version, such as
    --     @Amazon Linux 2018.03@, @Amazon Linux 2017.09@,
    --     @Amazon Linux 2017.03@, @Amazon Linux 2016.09@,
    --     @Amazon Linux 2016.03@, @Amazon Linux 2015.09@, or
    --     @Amazon Linux 2015.03@.
    --
    -- -   A supported Ubuntu operating system, such as @Ubuntu 16.04 LTS@,
    --     @Ubuntu 14.04 LTS@, or @Ubuntu 12.04 LTS@.
    --
    -- -   @CentOS Linux 7@
    --
    -- -   @Red Hat Enterprise Linux 7@
    --
    -- -   A supported Windows operating system, such as
    --     @Microsoft Windows Server 2012 R2 Base@,
    --     @Microsoft Windows Server 2012 R2 with SQL Server Express@,
    --     @Microsoft Windows Server 2012 R2 with SQL Server Standard@, or
    --     @Microsoft Windows Server 2012 R2 with SQL Server Web@.
    --
    -- -   A custom AMI: @Custom@. You specify the custom AMI you want to use
    --     when you create instances. For more information, see
    --     <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html Using Custom AMIs>.
    --
    -- The default option is the current Amazon Linux version. For more
    -- information about supported operating systems, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html AWS OpsWorks Stacks Operating Systems>.
    CreateStack -> 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 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>.
    CreateStack -> Maybe Bool
useOpsworksSecurityGroups :: Prelude.Maybe Prelude.Bool,
    -- | Whether the stack uses custom cookbooks.
    CreateStack -> 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.
    CreateStack -> Maybe Text
defaultSubnetId :: Prelude.Maybe Prelude.Text,
    -- | The configuration manager. When you create 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.
    CreateStack -> Maybe StackConfigurationManager
configurationManager :: Prelude.Maybe StackConfigurationManager,
    -- | The stack\'s host name theme, with spaces replaced by underscores. The
    -- theme is used to generate host names for the stack\'s instances. By
    -- default, @HostnameTheme@ is set to @Layer_Dependent@, which creates host
    -- names by appending integers to the layer\'s short name. The other themes
    -- are:
    --
    -- -   @Baked_Goods@
    --
    -- -   @Clouds@
    --
    -- -   @Europe_Cities@
    --
    -- -   @Fruits@
    --
    -- -   @Greek_Deities_and_Titans@
    --
    -- -   @Legendary_creatures_from_Japan@
    --
    -- -   @Planets_and_Moons@
    --
    -- -   @Roman_Deities@
    --
    -- -   @Scottish_Islands@
    --
    -- -   @US_Cities@
    --
    -- -   @Wild_Cats@
    --
    -- To obtain a generated host name, call @GetHostNameSuggestion@, which
    -- returns a host name based on the current theme.
    CreateStack -> Maybe Text
hostnameTheme :: Prelude.Maybe Prelude.Text,
    -- | The stack name.
    CreateStack -> Text
name :: Prelude.Text,
    -- | The stack\'s AWS region, such as @ap-south-1@. For more information
    -- about Amazon regions, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
    --
    -- In the AWS CLI, this API maps to the @--stack-region@ parameter. If the
    -- @--stack-region@ parameter and the AWS CLI common parameter @--region@
    -- are set to the same value, the stack uses a /regional/ endpoint. If the
    -- @--stack-region@ parameter is not set, but the AWS CLI @--region@
    -- parameter is, this also results in a stack with a /regional/ endpoint.
    -- However, if the @--region@ parameter is set to @us-east-1@, and the
    -- @--stack-region@ parameter is set to one of the following, then the
    -- stack uses a legacy or /classic/ region:
    -- @us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2@.
    -- In this case, the actual API endpoint of the stack is in @us-east-1@.
    -- Only the preceding regions are supported as classic regions in the
    -- @us-east-1@ API endpoint. Because it is a best practice to choose the
    -- regional endpoint that is closest to where you manage AWS, we recommend
    -- that you use regional endpoints for new stacks. The AWS CLI common
    -- @--region@ parameter always specifies a regional API endpoint; it cannot
    -- be used to specify a classic AWS OpsWorks Stacks region.
    CreateStack -> Text
region :: Prelude.Text,
    -- | The stack\'s 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. For more information about IAM ARNs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
    CreateStack -> Text
serviceRoleArn :: 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>.
    CreateStack -> Text
defaultInstanceProfileArn :: Prelude.Text
  }
  deriving (CreateStack -> CreateStack -> Bool
(CreateStack -> CreateStack -> Bool)
-> (CreateStack -> CreateStack -> Bool) -> Eq CreateStack
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStack -> CreateStack -> Bool
$c/= :: CreateStack -> CreateStack -> Bool
== :: CreateStack -> CreateStack -> Bool
$c== :: CreateStack -> CreateStack -> Bool
Prelude.Eq, ReadPrec [CreateStack]
ReadPrec CreateStack
Int -> ReadS CreateStack
ReadS [CreateStack]
(Int -> ReadS CreateStack)
-> ReadS [CreateStack]
-> ReadPrec CreateStack
-> ReadPrec [CreateStack]
-> Read CreateStack
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStack]
$creadListPrec :: ReadPrec [CreateStack]
readPrec :: ReadPrec CreateStack
$creadPrec :: ReadPrec CreateStack
readList :: ReadS [CreateStack]
$creadList :: ReadS [CreateStack]
readsPrec :: Int -> ReadS CreateStack
$creadsPrec :: Int -> ReadS CreateStack
Prelude.Read, Int -> CreateStack -> ShowS
[CreateStack] -> ShowS
CreateStack -> String
(Int -> CreateStack -> ShowS)
-> (CreateStack -> String)
-> ([CreateStack] -> ShowS)
-> Show CreateStack
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStack] -> ShowS
$cshowList :: [CreateStack] -> ShowS
show :: CreateStack -> String
$cshow :: CreateStack -> String
showsPrec :: Int -> CreateStack -> ShowS
$cshowsPrec :: Int -> CreateStack -> ShowS
Prelude.Show, (forall x. CreateStack -> Rep CreateStack x)
-> (forall x. Rep CreateStack x -> CreateStack)
-> Generic CreateStack
forall x. Rep CreateStack x -> CreateStack
forall x. CreateStack -> Rep CreateStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStack x -> CreateStack
$cfrom :: forall x. CreateStack -> Rep CreateStack x
Prelude.Generic)

-- |
-- Create a value of 'CreateStack' 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:
--
-- 'defaultRootDeviceType', 'createStack_defaultRootDeviceType' - The default root device type. This value is the default for all
-- instances in the stack, but you can override it when you create an
-- instance. The default option is @instance-store@. 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', 'createStack_vpcId' - The ID of the VPC that the stack is to be launched into. The VPC must be
-- in the stack\'s region. All instances are launched into this VPC. 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', 'createStack_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', 'createStack_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 the most recent release of the agent. 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', 'createStack_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', 'createStack_customJson' - A string that contains user-defined, custom JSON. It can be used to
-- override the corresponding default stack configuration attribute values
-- or to pass data to recipes. The string should be in the following
-- format:
--
-- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
--
-- For more information about custom JSON, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
--
-- 'customCookbooksSource', 'createStack_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', 'createStack_defaultAvailabilityZone' - The 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', 'createStack_attributes' - One or more user-defined key-value pairs to be added to the stack
-- attributes.
--
-- 'defaultOs', 'createStack_defaultOs' - The stack\'s default operating system, which is installed on every
-- instance unless you specify a different operating system when you create
-- the instance. You can specify one of the following.
--
-- -   A supported Linux operating system: An Amazon Linux version, such as
--     @Amazon Linux 2018.03@, @Amazon Linux 2017.09@,
--     @Amazon Linux 2017.03@, @Amazon Linux 2016.09@,
--     @Amazon Linux 2016.03@, @Amazon Linux 2015.09@, or
--     @Amazon Linux 2015.03@.
--
-- -   A supported Ubuntu operating system, such as @Ubuntu 16.04 LTS@,
--     @Ubuntu 14.04 LTS@, or @Ubuntu 12.04 LTS@.
--
-- -   @CentOS Linux 7@
--
-- -   @Red Hat Enterprise Linux 7@
--
-- -   A supported Windows operating system, such as
--     @Microsoft Windows Server 2012 R2 Base@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Express@,
--     @Microsoft Windows Server 2012 R2 with SQL Server Standard@, or
--     @Microsoft Windows Server 2012 R2 with SQL Server Web@.
--
-- -   A custom AMI: @Custom@. You specify the custom AMI you want to use
--     when you create instances. For more information, see
--     <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html Using Custom AMIs>.
--
-- The default option is the current Amazon Linux version. For more
-- information about supported operating systems, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html AWS OpsWorks Stacks Operating Systems>.
--
-- 'useOpsworksSecurityGroups', 'createStack_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 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', 'createStack_useCustomCookbooks' - Whether the stack uses custom cookbooks.
--
-- 'defaultSubnetId', 'createStack_defaultSubnetId' - The stack\'s default VPC subnet ID. This parameter is required if you
-- specify a value for the @VpcId@ parameter. All instances are launched
-- into this subnet unless you specify otherwise when you create the
-- instance. If you also specify a value for @DefaultAvailabilityZone@, the
-- subnet must be in that zone. For information on default values and when
-- this parameter is required, see the @VpcId@ parameter description.
--
-- 'configurationManager', 'createStack_configurationManager' - The configuration manager. When you create 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', 'createStack_hostnameTheme' - The stack\'s host name theme, with spaces replaced by underscores. The
-- theme is used to generate host names for the stack\'s instances. By
-- default, @HostnameTheme@ is set to @Layer_Dependent@, which creates host
-- names by appending integers to the layer\'s short name. The other themes
-- are:
--
-- -   @Baked_Goods@
--
-- -   @Clouds@
--
-- -   @Europe_Cities@
--
-- -   @Fruits@
--
-- -   @Greek_Deities_and_Titans@
--
-- -   @Legendary_creatures_from_Japan@
--
-- -   @Planets_and_Moons@
--
-- -   @Roman_Deities@
--
-- -   @Scottish_Islands@
--
-- -   @US_Cities@
--
-- -   @Wild_Cats@
--
-- To obtain a generated host name, call @GetHostNameSuggestion@, which
-- returns a host name based on the current theme.
--
-- 'name', 'createStack_name' - The stack name.
--
-- 'region', 'createStack_region' - The stack\'s AWS region, such as @ap-south-1@. For more information
-- about Amazon regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
--
-- In the AWS CLI, this API maps to the @--stack-region@ parameter. If the
-- @--stack-region@ parameter and the AWS CLI common parameter @--region@
-- are set to the same value, the stack uses a /regional/ endpoint. If the
-- @--stack-region@ parameter is not set, but the AWS CLI @--region@
-- parameter is, this also results in a stack with a /regional/ endpoint.
-- However, if the @--region@ parameter is set to @us-east-1@, and the
-- @--stack-region@ parameter is set to one of the following, then the
-- stack uses a legacy or /classic/ region:
-- @us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2@.
-- In this case, the actual API endpoint of the stack is in @us-east-1@.
-- Only the preceding regions are supported as classic regions in the
-- @us-east-1@ API endpoint. Because it is a best practice to choose the
-- regional endpoint that is closest to where you manage AWS, we recommend
-- that you use regional endpoints for new stacks. The AWS CLI common
-- @--region@ parameter always specifies a regional API endpoint; it cannot
-- be used to specify a classic AWS OpsWorks Stacks region.
--
-- 'serviceRoleArn', 'createStack_serviceRoleArn' - The stack\'s 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. For more information about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
--
-- 'defaultInstanceProfileArn', 'createStack_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>.
newCreateStack ::
  -- | 'name'
  Prelude.Text ->
  -- | 'region'
  Prelude.Text ->
  -- | 'serviceRoleArn'
  Prelude.Text ->
  -- | 'defaultInstanceProfileArn'
  Prelude.Text ->
  CreateStack
newCreateStack :: Text -> Text -> Text -> Text -> CreateStack
newCreateStack
  Text
pName_
  Text
pRegion_
  Text
pServiceRoleArn_
  Text
pDefaultInstanceProfileArn_ =
    CreateStack' :: Maybe RootDeviceType
-> Maybe Text
-> Maybe ChefConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Source
-> Maybe Text
-> Maybe (HashMap StackAttributesKeys (Maybe Text))
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe StackConfigurationManager
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> CreateStack
CreateStack'
      { $sel:defaultRootDeviceType:CreateStack' :: Maybe RootDeviceType
defaultRootDeviceType =
          Maybe RootDeviceType
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcId:CreateStack' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:chefConfiguration:CreateStack' :: Maybe ChefConfiguration
chefConfiguration = Maybe ChefConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:agentVersion:CreateStack' :: Maybe Text
agentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSshKeyName:CreateStack' :: Maybe Text
defaultSshKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customJson:CreateStack' :: Maybe Text
customJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customCookbooksSource:CreateStack' :: Maybe Source
customCookbooksSource = Maybe Source
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultAvailabilityZone:CreateStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:attributes:CreateStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = Maybe (HashMap StackAttributesKeys (Maybe Text))
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultOs:CreateStack' :: Maybe Text
defaultOs = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:useOpsworksSecurityGroups:CreateStack' :: Maybe Bool
useOpsworksSecurityGroups = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:useCustomCookbooks:CreateStack' :: Maybe Bool
useCustomCookbooks = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubnetId:CreateStack' :: Maybe Text
defaultSubnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:configurationManager:CreateStack' :: Maybe StackConfigurationManager
configurationManager = Maybe StackConfigurationManager
forall a. Maybe a
Prelude.Nothing,
        $sel:hostnameTheme:CreateStack' :: Maybe Text
hostnameTheme = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateStack' :: Text
name = Text
pName_,
        $sel:region:CreateStack' :: Text
region = Text
pRegion_,
        $sel:serviceRoleArn:CreateStack' :: Text
serviceRoleArn = Text
pServiceRoleArn_,
        $sel:defaultInstanceProfileArn:CreateStack' :: Text
defaultInstanceProfileArn =
          Text
pDefaultInstanceProfileArn_
      }

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

-- | The ID of the VPC that the stack is to be launched into. The VPC must be
-- in the stack\'s region. All instances are launched into this VPC. 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>.
createStack_vpcId :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_vpcId :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_vpcId = (CreateStack -> Maybe Text)
-> (CreateStack -> Maybe Text -> CreateStack)
-> Lens CreateStack CreateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:CreateStack' :: CreateStack -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:vpcId:CreateStack' :: Maybe Text
vpcId = Maybe Text
a} :: CreateStack)

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

-- | 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 the most recent release of the agent. 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.
createStack_agentVersion :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_agentVersion :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_agentVersion = (CreateStack -> Maybe Text)
-> (CreateStack -> Maybe Text -> CreateStack)
-> Lens CreateStack CreateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:CreateStack' :: CreateStack -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:agentVersion:CreateStack' :: Maybe Text
agentVersion = Maybe Text
a} :: CreateStack)

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

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

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

-- | The 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.
createStack_defaultAvailabilityZone :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_defaultAvailabilityZone :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_defaultAvailabilityZone = (CreateStack -> Maybe Text)
-> (CreateStack -> Maybe Text -> CreateStack)
-> Lens CreateStack CreateStack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe Text
defaultAvailabilityZone :: Maybe Text
$sel:defaultAvailabilityZone:CreateStack' :: CreateStack -> Maybe Text
defaultAvailabilityZone} -> Maybe Text
defaultAvailabilityZone) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:defaultAvailabilityZone:CreateStack' :: Maybe Text
defaultAvailabilityZone = Maybe Text
a} :: CreateStack)

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

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

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

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

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

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

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

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

-- | The stack\'s AWS region, such as @ap-south-1@. For more information
-- about Amazon regions, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html Regions and Endpoints>.
--
-- In the AWS CLI, this API maps to the @--stack-region@ parameter. If the
-- @--stack-region@ parameter and the AWS CLI common parameter @--region@
-- are set to the same value, the stack uses a /regional/ endpoint. If the
-- @--stack-region@ parameter is not set, but the AWS CLI @--region@
-- parameter is, this also results in a stack with a /regional/ endpoint.
-- However, if the @--region@ parameter is set to @us-east-1@, and the
-- @--stack-region@ parameter is set to one of the following, then the
-- stack uses a legacy or /classic/ region:
-- @us-west-1, us-west-2, sa-east-1, eu-central-1, eu-west-1, ap-northeast-1, ap-southeast-1, ap-southeast-2@.
-- In this case, the actual API endpoint of the stack is in @us-east-1@.
-- Only the preceding regions are supported as classic regions in the
-- @us-east-1@ API endpoint. Because it is a best practice to choose the
-- regional endpoint that is closest to where you manage AWS, we recommend
-- that you use regional endpoints for new stacks. The AWS CLI common
-- @--region@ parameter always specifies a regional API endpoint; it cannot
-- be used to specify a classic AWS OpsWorks Stacks region.
createStack_region :: Lens.Lens' CreateStack Prelude.Text
createStack_region :: (Text -> f Text) -> CreateStack -> f CreateStack
createStack_region = (CreateStack -> Text)
-> (CreateStack -> Text -> CreateStack)
-> Lens CreateStack CreateStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Text
region :: Text
$sel:region:CreateStack' :: CreateStack -> Text
region} -> Text
region) (\s :: CreateStack
s@CreateStack' {} Text
a -> CreateStack
s {$sel:region:CreateStack' :: Text
region = Text
a} :: CreateStack)

-- | The stack\'s 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. For more information about IAM ARNs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html Using Identifiers>.
createStack_serviceRoleArn :: Lens.Lens' CreateStack Prelude.Text
createStack_serviceRoleArn :: (Text -> f Text) -> CreateStack -> f CreateStack
createStack_serviceRoleArn = (CreateStack -> Text)
-> (CreateStack -> Text -> CreateStack)
-> Lens CreateStack CreateStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Text
serviceRoleArn :: Text
$sel:serviceRoleArn:CreateStack' :: CreateStack -> Text
serviceRoleArn} -> Text
serviceRoleArn) (\s :: CreateStack
s@CreateStack' {} Text
a -> CreateStack
s {$sel:serviceRoleArn:CreateStack' :: Text
serviceRoleArn = Text
a} :: CreateStack)

-- | 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>.
createStack_defaultInstanceProfileArn :: Lens.Lens' CreateStack Prelude.Text
createStack_defaultInstanceProfileArn :: (Text -> f Text) -> CreateStack -> f CreateStack
createStack_defaultInstanceProfileArn = (CreateStack -> Text)
-> (CreateStack -> Text -> CreateStack)
-> Lens CreateStack CreateStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Text
defaultInstanceProfileArn :: Text
$sel:defaultInstanceProfileArn:CreateStack' :: CreateStack -> Text
defaultInstanceProfileArn} -> Text
defaultInstanceProfileArn) (\s :: CreateStack
s@CreateStack' {} Text
a -> CreateStack
s {$sel:defaultInstanceProfileArn:CreateStack' :: Text
defaultInstanceProfileArn = Text
a} :: CreateStack)

instance Core.AWSRequest CreateStack where
  type AWSResponse CreateStack = CreateStackResponse
  request :: CreateStack -> Request CreateStack
request = Service -> CreateStack -> Request CreateStack
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStack)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateStack))
-> Logger
-> Service
-> Proxy CreateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStack)))
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 -> CreateStackResponse
CreateStackResponse'
            (Maybe Text -> Int -> CreateStackResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateStackResponse)
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 -> CreateStackResponse)
-> Either String Int -> Either String CreateStackResponse
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 CreateStack

instance Prelude.NFData CreateStack

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

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

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

-- | Contains the response to a @CreateStack@ request.
--
-- /See:/ 'newCreateStackResponse' smart constructor.
data CreateStackResponse = CreateStackResponse'
  { -- | The stack ID, which is an opaque string that you use to identify the
    -- stack when performing actions such as @DescribeStacks@.
    CreateStackResponse -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateStackResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateStackResponse -> CreateStackResponse -> Bool
(CreateStackResponse -> CreateStackResponse -> Bool)
-> (CreateStackResponse -> CreateStackResponse -> Bool)
-> Eq CreateStackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStackResponse -> CreateStackResponse -> Bool
$c/= :: CreateStackResponse -> CreateStackResponse -> Bool
== :: CreateStackResponse -> CreateStackResponse -> Bool
$c== :: CreateStackResponse -> CreateStackResponse -> Bool
Prelude.Eq, ReadPrec [CreateStackResponse]
ReadPrec CreateStackResponse
Int -> ReadS CreateStackResponse
ReadS [CreateStackResponse]
(Int -> ReadS CreateStackResponse)
-> ReadS [CreateStackResponse]
-> ReadPrec CreateStackResponse
-> ReadPrec [CreateStackResponse]
-> Read CreateStackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStackResponse]
$creadListPrec :: ReadPrec [CreateStackResponse]
readPrec :: ReadPrec CreateStackResponse
$creadPrec :: ReadPrec CreateStackResponse
readList :: ReadS [CreateStackResponse]
$creadList :: ReadS [CreateStackResponse]
readsPrec :: Int -> ReadS CreateStackResponse
$creadsPrec :: Int -> ReadS CreateStackResponse
Prelude.Read, Int -> CreateStackResponse -> ShowS
[CreateStackResponse] -> ShowS
CreateStackResponse -> String
(Int -> CreateStackResponse -> ShowS)
-> (CreateStackResponse -> String)
-> ([CreateStackResponse] -> ShowS)
-> Show CreateStackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStackResponse] -> ShowS
$cshowList :: [CreateStackResponse] -> ShowS
show :: CreateStackResponse -> String
$cshow :: CreateStackResponse -> String
showsPrec :: Int -> CreateStackResponse -> ShowS
$cshowsPrec :: Int -> CreateStackResponse -> ShowS
Prelude.Show, (forall x. CreateStackResponse -> Rep CreateStackResponse x)
-> (forall x. Rep CreateStackResponse x -> CreateStackResponse)
-> Generic CreateStackResponse
forall x. Rep CreateStackResponse x -> CreateStackResponse
forall x. CreateStackResponse -> Rep CreateStackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStackResponse x -> CreateStackResponse
$cfrom :: forall x. CreateStackResponse -> Rep CreateStackResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateStackResponse' 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', 'createStackResponse_stackId' - The stack ID, which is an opaque string that you use to identify the
-- stack when performing actions such as @DescribeStacks@.
--
-- 'httpStatus', 'createStackResponse_httpStatus' - The response's http status code.
newCreateStackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStackResponse
newCreateStackResponse :: Int -> CreateStackResponse
newCreateStackResponse Int
pHttpStatus_ =
  CreateStackResponse' :: Maybe Text -> Int -> CreateStackResponse
CreateStackResponse'
    { $sel:stackId:CreateStackResponse' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStackResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The stack ID, which is an opaque string that you use to identify the
-- stack when performing actions such as @DescribeStacks@.
createStackResponse_stackId :: Lens.Lens' CreateStackResponse (Prelude.Maybe Prelude.Text)
createStackResponse_stackId :: (Maybe Text -> f (Maybe Text))
-> CreateStackResponse -> f CreateStackResponse
createStackResponse_stackId = (CreateStackResponse -> Maybe Text)
-> (CreateStackResponse -> Maybe Text -> CreateStackResponse)
-> Lens
     CreateStackResponse CreateStackResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackResponse' {Maybe Text
stackId :: Maybe Text
$sel:stackId:CreateStackResponse' :: CreateStackResponse -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: CreateStackResponse
s@CreateStackResponse' {} Maybe Text
a -> CreateStackResponse
s {$sel:stackId:CreateStackResponse' :: Maybe Text
stackId = Maybe Text
a} :: CreateStackResponse)

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

instance Prelude.NFData CreateStackResponse