{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_agentVersion,
    createStack_attributes,
    createStack_chefConfiguration,
    createStack_configurationManager,
    createStack_customCookbooksSource,
    createStack_customJson,
    createStack_defaultAvailabilityZone,
    createStack_defaultOs,
    createStack_defaultRootDeviceType,
    createStack_defaultSshKeyName,
    createStack_defaultSubnetId,
    createStack_hostnameTheme,
    createStack_useCustomCookbooks,
    createStack_useOpsworksSecurityGroups,
    createStack_vpcId,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateStack' smart constructor.
data CreateStack = 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 -> Maybe Text
agentVersion :: 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)),
    -- | 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 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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 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,
    -- | Whether the stack uses custom cookbooks.
    CreateStack -> Maybe Bool
useCustomCookbooks :: Prelude.Maybe Prelude.Bool,
    -- | Whether to associate the AWS OpsWorks Stacks built-in security groups
    -- with the stack\'s layers.
    --
    -- AWS OpsWorks Stacks provides a standard set of built-in security groups,
    -- one for each layer, which are associated with layers by default. With
    -- @UseOpsworksSecurityGroups@ you can instead provide your own custom
    -- security groups. @UseOpsworksSecurityGroups@ has the following settings:
    --
    -- -   True - AWS OpsWorks Stacks automatically associates the appropriate
    --     built-in security group with each layer (default setting). You can
    --     associate additional security groups with a layer after you create
    --     it, but you cannot delete the built-in security group.
    --
    -- -   False - AWS OpsWorks Stacks does not associate built-in security
    --     groups with layers. You must create appropriate 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,
    -- | 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,
    -- | 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
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]
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
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. 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:
--
-- '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.
--
-- 'attributes', 'createStack_attributes' - One or more user-defined key-value pairs to be added to the stack
-- attributes.
--
-- '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>.
--
-- '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.
--
-- '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>.
--
-- '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>.
--
-- '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.
--
-- '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>.
--
-- '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>.
--
-- '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>.
--
-- '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.
--
-- '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.
--
-- 'useCustomCookbooks', 'createStack_useCustomCookbooks' - Whether the stack uses custom cookbooks.
--
-- '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>.
--
-- '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>.
--
-- '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'
      { $sel:agentVersion:CreateStack' :: Maybe Text
agentVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:attributes:CreateStack' :: Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes = forall a. Maybe a
Prelude.Nothing,
        $sel:chefConfiguration:CreateStack' :: Maybe ChefConfiguration
chefConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:configurationManager:CreateStack' :: Maybe StackConfigurationManager
configurationManager = forall a. Maybe a
Prelude.Nothing,
        $sel:customCookbooksSource:CreateStack' :: Maybe Source
customCookbooksSource = forall a. Maybe a
Prelude.Nothing,
        $sel:customJson:CreateStack' :: Maybe Text
customJson = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultAvailabilityZone:CreateStack' :: Maybe Text
defaultAvailabilityZone = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultOs:CreateStack' :: Maybe Text
defaultOs = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultRootDeviceType:CreateStack' :: Maybe RootDeviceType
defaultRootDeviceType = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSshKeyName:CreateStack' :: Maybe Text
defaultSshKeyName = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubnetId:CreateStack' :: Maybe Text
defaultSubnetId = forall a. Maybe a
Prelude.Nothing,
        $sel:hostnameTheme:CreateStack' :: Maybe Text
hostnameTheme = forall a. Maybe a
Prelude.Nothing,
        $sel:useCustomCookbooks:CreateStack' :: Maybe Bool
useCustomCookbooks = forall a. Maybe a
Prelude.Nothing,
        $sel:useOpsworksSecurityGroups:CreateStack' :: Maybe Bool
useOpsworksSecurityGroups = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcId:CreateStack' :: Maybe Text
vpcId = 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 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 :: Lens' CreateStack (Maybe Text)
createStack_agentVersion = 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)

-- | 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 :: Lens'
  CreateStack (Maybe (HashMap StackAttributesKeys (Maybe Text)))
createStack_attributes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A @ChefConfiguration@ object that specifies whether to enable Berkshelf
-- and the Berkshelf version on Chef 11.10 stacks. For more information,
-- see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html Create a New Stack>.
createStack_chefConfiguration :: Lens.Lens' CreateStack (Prelude.Maybe ChefConfiguration)
createStack_chefConfiguration :: Lens' CreateStack (Maybe ChefConfiguration)
createStack_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 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 :: Lens' CreateStack (Maybe StackConfigurationManager)
createStack_configurationManager = 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)

-- | 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 :: Lens' CreateStack (Maybe Source)
createStack_customCookbooksSource = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_customJson = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_defaultAvailabilityZone = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_defaultOs = 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)

-- | 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 :: Lens' CreateStack (Maybe RootDeviceType)
createStack_defaultRootDeviceType = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_defaultSshKeyName = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_defaultSubnetId = 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 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 :: Lens' CreateStack (Maybe Text)
createStack_hostnameTheme = 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)

-- | Whether the stack uses custom cookbooks.
createStack_useCustomCookbooks :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Bool)
createStack_useCustomCookbooks :: Lens' CreateStack (Maybe Bool)
createStack_useCustomCookbooks = 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)

-- | 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 :: Lens' CreateStack (Maybe Bool)
createStack_useOpsworksSecurityGroups = 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)

-- | 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 :: Lens' CreateStack (Maybe Text)
createStack_vpcId = 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)

-- | The stack name.
createStack_name :: Lens.Lens' CreateStack Prelude.Text
createStack_name :: Lens' CreateStack Text
createStack_name = 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 :: Lens' CreateStack Text
createStack_region = 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 :: Lens' CreateStack Text
createStack_serviceRoleArn = 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 :: Lens' CreateStack Text
createStack_defaultInstanceProfileArn = 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 :: (Service -> Service) -> CreateStack -> Request CreateStack
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStack)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateStackResponse
CreateStackResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StackId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateStack where
  hashWithSalt :: Int -> CreateStack -> Int
hashWithSalt Int
_salt 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
vpcId :: Maybe Text
useOpsworksSecurityGroups :: Maybe Bool
useCustomCookbooks :: Maybe Bool
hostnameTheme :: Maybe Text
defaultSubnetId :: Maybe Text
defaultSshKeyName :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
defaultOs :: Maybe Text
defaultAvailabilityZone :: Maybe Text
customJson :: Maybe Text
customCookbooksSource :: Maybe Source
configurationManager :: Maybe StackConfigurationManager
chefConfiguration :: Maybe ChefConfiguration
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
agentVersion :: Maybe Text
$sel:defaultInstanceProfileArn:CreateStack' :: CreateStack -> Text
$sel:serviceRoleArn:CreateStack' :: CreateStack -> Text
$sel:region:CreateStack' :: CreateStack -> Text
$sel:name:CreateStack' :: CreateStack -> Text
$sel:vpcId:CreateStack' :: CreateStack -> Maybe Text
$sel:useOpsworksSecurityGroups:CreateStack' :: CreateStack -> Maybe Bool
$sel:useCustomCookbooks:CreateStack' :: CreateStack -> Maybe Bool
$sel:hostnameTheme:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultSubnetId:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultSshKeyName:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultRootDeviceType:CreateStack' :: CreateStack -> Maybe RootDeviceType
$sel:defaultOs:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultAvailabilityZone:CreateStack' :: CreateStack -> Maybe Text
$sel:customJson:CreateStack' :: CreateStack -> Maybe Text
$sel:customCookbooksSource:CreateStack' :: CreateStack -> Maybe Source
$sel:configurationManager:CreateStack' :: CreateStack -> Maybe StackConfigurationManager
$sel:chefConfiguration:CreateStack' :: CreateStack -> Maybe ChefConfiguration
$sel:attributes:CreateStack' :: CreateStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:agentVersion:CreateStack' :: CreateStack -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
agentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChefConfiguration
chefConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackConfigurationManager
configurationManager
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Source
customCookbooksSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customJson
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultAvailabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultOs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RootDeviceType
defaultRootDeviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSshKeyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostnameTheme
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useCustomCookbooks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useOpsworksSecurityGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
defaultInstanceProfileArn

instance Prelude.NFData CreateStack where
  rnf :: CreateStack -> ()
rnf 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
vpcId :: Maybe Text
useOpsworksSecurityGroups :: Maybe Bool
useCustomCookbooks :: Maybe Bool
hostnameTheme :: Maybe Text
defaultSubnetId :: Maybe Text
defaultSshKeyName :: Maybe Text
defaultRootDeviceType :: Maybe RootDeviceType
defaultOs :: Maybe Text
defaultAvailabilityZone :: Maybe Text
customJson :: Maybe Text
customCookbooksSource :: Maybe Source
configurationManager :: Maybe StackConfigurationManager
chefConfiguration :: Maybe ChefConfiguration
attributes :: Maybe (HashMap StackAttributesKeys (Maybe Text))
agentVersion :: Maybe Text
$sel:defaultInstanceProfileArn:CreateStack' :: CreateStack -> Text
$sel:serviceRoleArn:CreateStack' :: CreateStack -> Text
$sel:region:CreateStack' :: CreateStack -> Text
$sel:name:CreateStack' :: CreateStack -> Text
$sel:vpcId:CreateStack' :: CreateStack -> Maybe Text
$sel:useOpsworksSecurityGroups:CreateStack' :: CreateStack -> Maybe Bool
$sel:useCustomCookbooks:CreateStack' :: CreateStack -> Maybe Bool
$sel:hostnameTheme:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultSubnetId:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultSshKeyName:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultRootDeviceType:CreateStack' :: CreateStack -> Maybe RootDeviceType
$sel:defaultOs:CreateStack' :: CreateStack -> Maybe Text
$sel:defaultAvailabilityZone:CreateStack' :: CreateStack -> Maybe Text
$sel:customJson:CreateStack' :: CreateStack -> Maybe Text
$sel:customCookbooksSource:CreateStack' :: CreateStack -> Maybe Source
$sel:configurationManager:CreateStack' :: CreateStack -> Maybe StackConfigurationManager
$sel:chefConfiguration:CreateStack' :: CreateStack -> Maybe ChefConfiguration
$sel:attributes:CreateStack' :: CreateStack -> Maybe (HashMap StackAttributesKeys (Maybe Text))
$sel:agentVersion:CreateStack' :: CreateStack -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
agentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap StackAttributesKeys (Maybe Text))
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChefConfiguration
chefConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackConfigurationManager
configurationManager
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Source
customCookbooksSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customJson
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultAvailabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultOs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RootDeviceType
defaultRootDeviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSshKeyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostnameTheme
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useCustomCookbooks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useOpsworksSecurityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Text
defaultInstanceProfileArn

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

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

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

instance Data.ToQuery CreateStack where
  toQuery :: CreateStack -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
    { $sel:stackId:CreateStackResponse' :: Maybe Text
stackId = 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 :: Lens' CreateStackResponse (Maybe Text)
createStackResponse_stackId = 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 :: Lens' CreateStackResponse Int
createStackResponse_httpStatus = 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 where
  rnf :: CreateStackResponse -> ()
rnf CreateStackResponse' {Int
Maybe Text
httpStatus :: Int
stackId :: Maybe Text
$sel:httpStatus:CreateStackResponse' :: CreateStackResponse -> Int
$sel:stackId:CreateStackResponse' :: CreateStackResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus