{-# 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.CloudFormation.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 stack as specified in the template. After the call completes
-- successfully, the stack creation starts. You can check the status of the
-- stack via the DescribeStacks API.
module Amazonka.CloudFormation.CreateStack
  ( -- * Creating a Request
    CreateStack (..),
    newCreateStack,

    -- * Request Lenses
    createStack_disableRollback,
    createStack_notificationARNs,
    createStack_enableTerminationProtection,
    createStack_stackPolicyBody,
    createStack_parameters,
    createStack_stackPolicyURL,
    createStack_templateBody,
    createStack_templateURL,
    createStack_clientRequestToken,
    createStack_capabilities,
    createStack_rollbackConfiguration,
    createStack_onFailure,
    createStack_resourceTypes,
    createStack_tags,
    createStack_timeoutInMinutes,
    createStack_roleARN,
    createStack_stackName,

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

    -- * Response Lenses
    createStackResponse_stackId,
    createStackResponse_httpStatus,
  )
where

import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The input for CreateStack action.
--
-- /See:/ 'newCreateStack' smart constructor.
data CreateStack = CreateStack'
  { -- | Set to @true@ to disable rollback of the stack if stack creation failed.
    -- You can specify either @DisableRollback@ or @OnFailure@, but not both.
    --
    -- Default: @false@
    CreateStack -> Maybe Bool
disableRollback :: Prelude.Maybe Prelude.Bool,
    -- | The Simple Notification Service (SNS) topic ARNs to publish stack
    -- related events. You can find your SNS topic ARNs using the SNS console
    -- or your Command Line Interface (CLI).
    CreateStack -> Maybe [Text]
notificationARNs :: Prelude.Maybe [Prelude.Text],
    -- | Whether to enable termination protection on the specified stack. If a
    -- user attempts to delete a stack with termination protection enabled, the
    -- operation fails and the stack remains unchanged. For more information,
    -- see
    -- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html Protecting a Stack From Being Deleted>
    -- in the /CloudFormation User Guide/. Termination protection is disabled
    -- on stacks by default.
    --
    -- For
    -- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html nested stacks>,
    -- termination protection is set on the root stack and cannot be changed
    -- directly on the nested stack.
    CreateStack -> Maybe Bool
enableTerminationProtection :: Prelude.Maybe Prelude.Bool,
    -- | Structure containing the stack policy body. For more information, go to
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html Prevent Updates to Stack Resources>
    -- in the /CloudFormation User Guide/. You can specify either the
    -- @StackPolicyBody@ or the @StackPolicyURL@ parameter, but not both.
    CreateStack -> Maybe Text
stackPolicyBody :: Prelude.Maybe Prelude.Text,
    -- | A list of @Parameter@ structures that specify input parameters for the
    -- stack. For more information, see the
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html Parameter>
    -- data type.
    CreateStack -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
    -- | Location of a file containing the stack policy. The URL must point to a
    -- policy (maximum size: 16 KB) located in an S3 bucket in the same Region
    -- as the stack. You can specify either the @StackPolicyBody@ or the
    -- @StackPolicyURL@ parameter, but not both.
    CreateStack -> Maybe Text
stackPolicyURL :: Prelude.Maybe Prelude.Text,
    -- | Structure containing the template body with a minimum length of 1 byte
    -- and a maximum length of 51,200 bytes. For more information, go to
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
    -- in the CloudFormation User Guide.
    --
    -- Conditional: You must specify either the @TemplateBody@ or the
    -- @TemplateURL@ parameter, but not both.
    CreateStack -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | Location of file containing the template body. The URL must point to a
    -- template (max size: 460,800 bytes) that is located in an Amazon S3
    -- bucket or a Systems Manager document. For more information, go to the
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
    -- in the CloudFormation User Guide.
    --
    -- Conditional: You must specify either the @TemplateBody@ or the
    -- @TemplateURL@ parameter, but not both.
    CreateStack -> Maybe Text
templateURL :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for this @CreateStack@ request. Specify this token
    -- if you plan to retry requests so that CloudFormation knows that you\'re
    -- not attempting to create a stack with the same name. You might retry
    -- @CreateStack@ requests to ensure that CloudFormation successfully
    -- received them.
    --
    -- All events triggered by a given stack operation are assigned the same
    -- client request token, which you can use to track operations. For
    -- example, if you execute a @CreateStack@ operation with the token
    -- @token1@, then all the @StackEvents@ generated by that operation will
    -- have @ClientRequestToken@ set as @token1@.
    --
    -- In the console, stack operations display the client request token on the
    -- Events tab. Stack operations that are initiated from the console use the
    -- token format /Console-StackOperation-ID/, which helps you easily
    -- identify the stack operation . For example, if you create a stack using
    -- the console, each stack event would be assigned the same token in the
    -- following format:
    -- @Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002@.
    CreateStack -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | In some cases, you must explicitly acknowledge that your stack template
    -- contains certain capabilities in order for CloudFormation to create the
    -- stack.
    --
    -- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
    --
    --     Some stack templates might include resources that can affect
    --     permissions in your Amazon Web Services account; for example, by
    --     creating new Identity and Access Management (IAM) users. For those
    --     stacks, you must explicitly acknowledge this by specifying one of
    --     these capabilities.
    --
    --     The following IAM resources require you to specify either the
    --     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
    --
    --     -   If you have IAM resources, you can specify either capability.
    --
    --     -   If you have IAM resources with custom names, you /must/ specify
    --         @CAPABILITY_NAMED_IAM@.
    --
    --     -   If you don\'t specify either of these capabilities,
    --         CloudFormation returns an @InsufficientCapabilities@ error.
    --
    --     If your stack template contains these resources, we recommend that
    --     you review all permissions associated with them and edit their
    --     permissions if necessary.
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
    --
    --     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
    --
    --     For more information, see
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
    --
    -- -   @CAPABILITY_AUTO_EXPAND@
    --
    --     Some template contain macros. Macros perform custom processing on
    --     templates; this can include simple actions like find-and-replace
    --     operations, all the way to extensive transformations of entire
    --     templates. Because of this, users typically create a change set from
    --     the processed template, so that they can review the changes
    --     resulting from the macros before actually creating the stack. If
    --     your stack template contains one or more macros, and you choose to
    --     create a stack directly from the processed template, without first
    --     reviewing the resulting changes in a change set, you must
    --     acknowledge this capability. This includes the
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
    --     and
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
    --     transforms, which are macros hosted by CloudFormation.
    --
    --     If you want to create a stack from a stack template that contains
    --     macros /and/ nested stacks, you must create the stack directly from
    --     the template using this capability.
    --
    --     You should only create stacks directly from a stack template that
    --     contains macros if you know what processing the macro performs.
    --
    --     Each macro relies on an underlying Lambda service function for
    --     processing stack templates. Be aware that the Lambda function owner
    --     can update the function operation without CloudFormation being
    --     notified.
    --
    --     For more information, see
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
    CreateStack -> Maybe [Capability]
capabilities :: Prelude.Maybe [Capability],
    -- | The rollback triggers for CloudFormation to monitor during stack
    -- creation and updating operations, and for the specified monitoring
    -- period afterwards.
    CreateStack -> Maybe RollbackConfiguration
rollbackConfiguration :: Prelude.Maybe RollbackConfiguration,
    -- | Determines what action will be taken if stack creation fails. This must
    -- be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either
    -- @OnFailure@ or @DisableRollback@, but not both.
    --
    -- Default: @ROLLBACK@
    CreateStack -> Maybe OnFailure
onFailure :: Prelude.Maybe OnFailure,
    -- | The template resource types that you have permissions to work with for
    -- this create stack action, such as @AWS::EC2::Instance@, @AWS::EC2::*@,
    -- or @Custom::MyCustomInstance@. Use the following syntax to describe
    -- template resource types: @AWS::*@ (for all Amazon Web Services
    -- resources), @Custom::*@ (for all custom resources),
    -- @Custom::logical_ID @ (for a specific custom resource),
    -- @AWS::service_name::*@ (for all resources of a particular Amazon Web
    -- Services service), and @AWS::service_name::resource_logical_ID @ (for a
    -- specific Amazon Web Services resource).
    --
    -- If the list of resource types doesn\'t include a resource that you\'re
    -- creating, the stack creation fails. By default, CloudFormation grants
    -- permissions to all resource types. Identity and Access Management (IAM)
    -- uses this parameter for CloudFormation-specific condition keys in IAM
    -- policies. For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html Controlling Access with Identity and Access Management>.
    CreateStack -> Maybe [Text]
resourceTypes :: Prelude.Maybe [Prelude.Text],
    -- | Key-value pairs to associate with this stack. CloudFormation also
    -- propagates these tags to the resources created in the stack. A maximum
    -- number of 50 tags can be specified.
    CreateStack -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The amount of time that can pass before the stack status becomes
    -- CREATE_FAILED; if @DisableRollback@ is not set or is set to @false@, the
    -- stack will be rolled back.
    CreateStack -> Maybe Natural
timeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of an Identity and Access Management
    -- (IAM) role that CloudFormation assumes to create the stack.
    -- CloudFormation uses the role\'s credentials to make calls on your
    -- behalf. CloudFormation always uses this role for all future operations
    -- on the stack. As long as users have permission to operate on the stack,
    -- CloudFormation uses this role even if the users don\'t have permission
    -- to pass it. Ensure that the role grants least privilege.
    --
    -- If you don\'t specify a value, CloudFormation uses the role that was
    -- previously associated with the stack. If no role is available,
    -- CloudFormation uses a temporary session that is generated from your user
    -- credentials.
    CreateStack -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The name that is associated with the stack. The name must be unique in
    -- the Region in which you are creating the stack.
    --
    -- A stack name can contain only alphanumeric characters (case sensitive)
    -- and hyphens. It must start with an alphabetical character and cannot be
    -- longer than 128 characters.
    CreateStack -> Text
stackName :: 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:
--
-- 'disableRollback', 'createStack_disableRollback' - Set to @true@ to disable rollback of the stack if stack creation failed.
-- You can specify either @DisableRollback@ or @OnFailure@, but not both.
--
-- Default: @false@
--
-- 'notificationARNs', 'createStack_notificationARNs' - The Simple Notification Service (SNS) topic ARNs to publish stack
-- related events. You can find your SNS topic ARNs using the SNS console
-- or your Command Line Interface (CLI).
--
-- 'enableTerminationProtection', 'createStack_enableTerminationProtection' - Whether to enable termination protection on the specified stack. If a
-- user attempts to delete a stack with termination protection enabled, the
-- operation fails and the stack remains unchanged. For more information,
-- see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html Protecting a Stack From Being Deleted>
-- in the /CloudFormation User Guide/. Termination protection is disabled
-- on stacks by default.
--
-- For
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html nested stacks>,
-- termination protection is set on the root stack and cannot be changed
-- directly on the nested stack.
--
-- 'stackPolicyBody', 'createStack_stackPolicyBody' - Structure containing the stack policy body. For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html Prevent Updates to Stack Resources>
-- in the /CloudFormation User Guide/. You can specify either the
-- @StackPolicyBody@ or the @StackPolicyURL@ parameter, but not both.
--
-- 'parameters', 'createStack_parameters' - A list of @Parameter@ structures that specify input parameters for the
-- stack. For more information, see the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html Parameter>
-- data type.
--
-- 'stackPolicyURL', 'createStack_stackPolicyURL' - Location of a file containing the stack policy. The URL must point to a
-- policy (maximum size: 16 KB) located in an S3 bucket in the same Region
-- as the stack. You can specify either the @StackPolicyBody@ or the
-- @StackPolicyURL@ parameter, but not both.
--
-- 'templateBody', 'createStack_templateBody' - Structure containing the template body with a minimum length of 1 byte
-- and a maximum length of 51,200 bytes. For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify either the @TemplateBody@ or the
-- @TemplateURL@ parameter, but not both.
--
-- 'templateURL', 'createStack_templateURL' - Location of file containing the template body. The URL must point to a
-- template (max size: 460,800 bytes) that is located in an Amazon S3
-- bucket or a Systems Manager document. For more information, go to the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify either the @TemplateBody@ or the
-- @TemplateURL@ parameter, but not both.
--
-- 'clientRequestToken', 'createStack_clientRequestToken' - A unique identifier for this @CreateStack@ request. Specify this token
-- if you plan to retry requests so that CloudFormation knows that you\'re
-- not attempting to create a stack with the same name. You might retry
-- @CreateStack@ requests to ensure that CloudFormation successfully
-- received them.
--
-- All events triggered by a given stack operation are assigned the same
-- client request token, which you can use to track operations. For
-- example, if you execute a @CreateStack@ operation with the token
-- @token1@, then all the @StackEvents@ generated by that operation will
-- have @ClientRequestToken@ set as @token1@.
--
-- In the console, stack operations display the client request token on the
-- Events tab. Stack operations that are initiated from the console use the
-- token format /Console-StackOperation-ID/, which helps you easily
-- identify the stack operation . For example, if you create a stack using
-- the console, each stack event would be assigned the same token in the
-- following format:
-- @Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002@.
--
-- 'capabilities', 'createStack_capabilities' - In some cases, you must explicitly acknowledge that your stack template
-- contains certain capabilities in order for CloudFormation to create the
-- stack.
--
-- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
--
--     Some stack templates might include resources that can affect
--     permissions in your Amazon Web Services account; for example, by
--     creating new Identity and Access Management (IAM) users. For those
--     stacks, you must explicitly acknowledge this by specifying one of
--     these capabilities.
--
--     The following IAM resources require you to specify either the
--     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
--
--     -   If you have IAM resources, you can specify either capability.
--
--     -   If you have IAM resources with custom names, you /must/ specify
--         @CAPABILITY_NAMED_IAM@.
--
--     -   If you don\'t specify either of these capabilities,
--         CloudFormation returns an @InsufficientCapabilities@ error.
--
--     If your stack template contains these resources, we recommend that
--     you review all permissions associated with them and edit their
--     permissions if necessary.
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
--
-- -   @CAPABILITY_AUTO_EXPAND@
--
--     Some template contain macros. Macros perform custom processing on
--     templates; this can include simple actions like find-and-replace
--     operations, all the way to extensive transformations of entire
--     templates. Because of this, users typically create a change set from
--     the processed template, so that they can review the changes
--     resulting from the macros before actually creating the stack. If
--     your stack template contains one or more macros, and you choose to
--     create a stack directly from the processed template, without first
--     reviewing the resulting changes in a change set, you must
--     acknowledge this capability. This includes the
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
--     and
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
--     transforms, which are macros hosted by CloudFormation.
--
--     If you want to create a stack from a stack template that contains
--     macros /and/ nested stacks, you must create the stack directly from
--     the template using this capability.
--
--     You should only create stacks directly from a stack template that
--     contains macros if you know what processing the macro performs.
--
--     Each macro relies on an underlying Lambda service function for
--     processing stack templates. Be aware that the Lambda function owner
--     can update the function operation without CloudFormation being
--     notified.
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
--
-- 'rollbackConfiguration', 'createStack_rollbackConfiguration' - The rollback triggers for CloudFormation to monitor during stack
-- creation and updating operations, and for the specified monitoring
-- period afterwards.
--
-- 'onFailure', 'createStack_onFailure' - Determines what action will be taken if stack creation fails. This must
-- be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either
-- @OnFailure@ or @DisableRollback@, but not both.
--
-- Default: @ROLLBACK@
--
-- 'resourceTypes', 'createStack_resourceTypes' - The template resource types that you have permissions to work with for
-- this create stack action, such as @AWS::EC2::Instance@, @AWS::EC2::*@,
-- or @Custom::MyCustomInstance@. Use the following syntax to describe
-- template resource types: @AWS::*@ (for all Amazon Web Services
-- resources), @Custom::*@ (for all custom resources),
-- @Custom::logical_ID @ (for a specific custom resource),
-- @AWS::service_name::*@ (for all resources of a particular Amazon Web
-- Services service), and @AWS::service_name::resource_logical_ID @ (for a
-- specific Amazon Web Services resource).
--
-- If the list of resource types doesn\'t include a resource that you\'re
-- creating, the stack creation fails. By default, CloudFormation grants
-- permissions to all resource types. Identity and Access Management (IAM)
-- uses this parameter for CloudFormation-specific condition keys in IAM
-- policies. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html Controlling Access with Identity and Access Management>.
--
-- 'tags', 'createStack_tags' - Key-value pairs to associate with this stack. CloudFormation also
-- propagates these tags to the resources created in the stack. A maximum
-- number of 50 tags can be specified.
--
-- 'timeoutInMinutes', 'createStack_timeoutInMinutes' - The amount of time that can pass before the stack status becomes
-- CREATE_FAILED; if @DisableRollback@ is not set or is set to @false@, the
-- stack will be rolled back.
--
-- 'roleARN', 'createStack_roleARN' - The Amazon Resource Name (ARN) of an Identity and Access Management
-- (IAM) role that CloudFormation assumes to create the stack.
-- CloudFormation uses the role\'s credentials to make calls on your
-- behalf. CloudFormation always uses this role for all future operations
-- on the stack. As long as users have permission to operate on the stack,
-- CloudFormation uses this role even if the users don\'t have permission
-- to pass it. Ensure that the role grants least privilege.
--
-- If you don\'t specify a value, CloudFormation uses the role that was
-- previously associated with the stack. If no role is available,
-- CloudFormation uses a temporary session that is generated from your user
-- credentials.
--
-- 'stackName', 'createStack_stackName' - The name that is associated with the stack. The name must be unique in
-- the Region in which you are creating the stack.
--
-- A stack name can contain only alphanumeric characters (case sensitive)
-- and hyphens. It must start with an alphabetical character and cannot be
-- longer than 128 characters.
newCreateStack ::
  -- | 'stackName'
  Prelude.Text ->
  CreateStack
newCreateStack :: Text -> CreateStack
newCreateStack Text
pStackName_ =
  CreateStack' :: Maybe Bool
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe [Parameter]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Capability]
-> Maybe RollbackConfiguration
-> Maybe OnFailure
-> Maybe [Text]
-> Maybe [Tag]
-> Maybe Natural
-> Maybe Text
-> Text
-> CreateStack
CreateStack'
    { $sel:disableRollback:CreateStack' :: Maybe Bool
disableRollback = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationARNs:CreateStack' :: Maybe [Text]
notificationARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableTerminationProtection:CreateStack' :: Maybe Bool
enableTerminationProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:stackPolicyBody:CreateStack' :: Maybe Text
stackPolicyBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:CreateStack' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:stackPolicyURL:CreateStack' :: Maybe Text
stackPolicyURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:CreateStack' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateURL:CreateStack' :: Maybe Text
templateURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateStack' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:capabilities:CreateStack' :: Maybe [Capability]
capabilities = Maybe [Capability]
forall a. Maybe a
Prelude.Nothing,
      $sel:rollbackConfiguration:CreateStack' :: Maybe RollbackConfiguration
rollbackConfiguration = Maybe RollbackConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:onFailure:CreateStack' :: Maybe OnFailure
onFailure = Maybe OnFailure
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceTypes:CreateStack' :: Maybe [Text]
resourceTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateStack' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInMinutes:CreateStack' :: Maybe Natural
timeoutInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:CreateStack' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:CreateStack' :: Text
stackName = Text
pStackName_
    }

-- | Set to @true@ to disable rollback of the stack if stack creation failed.
-- You can specify either @DisableRollback@ or @OnFailure@, but not both.
--
-- Default: @false@
createStack_disableRollback :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Bool)
createStack_disableRollback :: (Maybe Bool -> f (Maybe Bool)) -> CreateStack -> f CreateStack
createStack_disableRollback = (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
disableRollback :: Maybe Bool
$sel:disableRollback:CreateStack' :: CreateStack -> Maybe Bool
disableRollback} -> Maybe Bool
disableRollback) (\s :: CreateStack
s@CreateStack' {} Maybe Bool
a -> CreateStack
s {$sel:disableRollback:CreateStack' :: Maybe Bool
disableRollback = Maybe Bool
a} :: CreateStack)

-- | The Simple Notification Service (SNS) topic ARNs to publish stack
-- related events. You can find your SNS topic ARNs using the SNS console
-- or your Command Line Interface (CLI).
createStack_notificationARNs :: Lens.Lens' CreateStack (Prelude.Maybe [Prelude.Text])
createStack_notificationARNs :: (Maybe [Text] -> f (Maybe [Text])) -> CreateStack -> f CreateStack
createStack_notificationARNs = (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]
notificationARNs :: Maybe [Text]
$sel:notificationARNs:CreateStack' :: CreateStack -> Maybe [Text]
notificationARNs} -> Maybe [Text]
notificationARNs) (\s :: CreateStack
s@CreateStack' {} Maybe [Text]
a -> CreateStack
s {$sel:notificationARNs:CreateStack' :: Maybe [Text]
notificationARNs = Maybe [Text]
a} :: CreateStack) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateStack -> f CreateStack)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateStack
-> f CreateStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether to enable termination protection on the specified stack. If a
-- user attempts to delete a stack with termination protection enabled, the
-- operation fails and the stack remains unchanged. For more information,
-- see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html Protecting a Stack From Being Deleted>
-- in the /CloudFormation User Guide/. Termination protection is disabled
-- on stacks by default.
--
-- For
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html nested stacks>,
-- termination protection is set on the root stack and cannot be changed
-- directly on the nested stack.
createStack_enableTerminationProtection :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Bool)
createStack_enableTerminationProtection :: (Maybe Bool -> f (Maybe Bool)) -> CreateStack -> f CreateStack
createStack_enableTerminationProtection = (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
enableTerminationProtection :: Maybe Bool
$sel:enableTerminationProtection:CreateStack' :: CreateStack -> Maybe Bool
enableTerminationProtection} -> Maybe Bool
enableTerminationProtection) (\s :: CreateStack
s@CreateStack' {} Maybe Bool
a -> CreateStack
s {$sel:enableTerminationProtection:CreateStack' :: Maybe Bool
enableTerminationProtection = Maybe Bool
a} :: CreateStack)

-- | Structure containing the stack policy body. For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html Prevent Updates to Stack Resources>
-- in the /CloudFormation User Guide/. You can specify either the
-- @StackPolicyBody@ or the @StackPolicyURL@ parameter, but not both.
createStack_stackPolicyBody :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_stackPolicyBody :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_stackPolicyBody = (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
stackPolicyBody :: Maybe Text
$sel:stackPolicyBody:CreateStack' :: CreateStack -> Maybe Text
stackPolicyBody} -> Maybe Text
stackPolicyBody) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:stackPolicyBody:CreateStack' :: Maybe Text
stackPolicyBody = Maybe Text
a} :: CreateStack)

-- | A list of @Parameter@ structures that specify input parameters for the
-- stack. For more information, see the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html Parameter>
-- data type.
createStack_parameters :: Lens.Lens' CreateStack (Prelude.Maybe [Parameter])
createStack_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> CreateStack -> f CreateStack
createStack_parameters = (CreateStack -> Maybe [Parameter])
-> (CreateStack -> Maybe [Parameter] -> CreateStack)
-> Lens
     CreateStack CreateStack (Maybe [Parameter]) (Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:CreateStack' :: CreateStack -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: CreateStack
s@CreateStack' {} Maybe [Parameter]
a -> CreateStack
s {$sel:parameters:CreateStack' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: CreateStack) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> CreateStack -> f CreateStack)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> CreateStack
-> f CreateStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Parameter] [Parameter] [Parameter] [Parameter]
-> Iso
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
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 [Parameter] [Parameter] [Parameter] [Parameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Location of a file containing the stack policy. The URL must point to a
-- policy (maximum size: 16 KB) located in an S3 bucket in the same Region
-- as the stack. You can specify either the @StackPolicyBody@ or the
-- @StackPolicyURL@ parameter, but not both.
createStack_stackPolicyURL :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_stackPolicyURL :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_stackPolicyURL = (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
stackPolicyURL :: Maybe Text
$sel:stackPolicyURL:CreateStack' :: CreateStack -> Maybe Text
stackPolicyURL} -> Maybe Text
stackPolicyURL) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:stackPolicyURL:CreateStack' :: Maybe Text
stackPolicyURL = Maybe Text
a} :: CreateStack)

-- | Structure containing the template body with a minimum length of 1 byte
-- and a maximum length of 51,200 bytes. For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify either the @TemplateBody@ or the
-- @TemplateURL@ parameter, but not both.
createStack_templateBody :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_templateBody :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_templateBody = (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
templateBody :: Maybe Text
$sel:templateBody:CreateStack' :: CreateStack -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:templateBody:CreateStack' :: Maybe Text
templateBody = Maybe Text
a} :: CreateStack)

-- | Location of file containing the template body. The URL must point to a
-- template (max size: 460,800 bytes) that is located in an Amazon S3
-- bucket or a Systems Manager document. For more information, go to the
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.
--
-- Conditional: You must specify either the @TemplateBody@ or the
-- @TemplateURL@ parameter, but not both.
createStack_templateURL :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_templateURL :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_templateURL = (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
templateURL :: Maybe Text
$sel:templateURL:CreateStack' :: CreateStack -> Maybe Text
templateURL} -> Maybe Text
templateURL) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:templateURL:CreateStack' :: Maybe Text
templateURL = Maybe Text
a} :: CreateStack)

-- | A unique identifier for this @CreateStack@ request. Specify this token
-- if you plan to retry requests so that CloudFormation knows that you\'re
-- not attempting to create a stack with the same name. You might retry
-- @CreateStack@ requests to ensure that CloudFormation successfully
-- received them.
--
-- All events triggered by a given stack operation are assigned the same
-- client request token, which you can use to track operations. For
-- example, if you execute a @CreateStack@ operation with the token
-- @token1@, then all the @StackEvents@ generated by that operation will
-- have @ClientRequestToken@ set as @token1@.
--
-- In the console, stack operations display the client request token on the
-- Events tab. Stack operations that are initiated from the console use the
-- token format /Console-StackOperation-ID/, which helps you easily
-- identify the stack operation . For example, if you create a stack using
-- the console, each stack event would be assigned the same token in the
-- following format:
-- @Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002@.
createStack_clientRequestToken :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_clientRequestToken = (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
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateStack' :: CreateStack -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:clientRequestToken:CreateStack' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateStack)

-- | In some cases, you must explicitly acknowledge that your stack template
-- contains certain capabilities in order for CloudFormation to create the
-- stack.
--
-- -   @CAPABILITY_IAM@ and @CAPABILITY_NAMED_IAM@
--
--     Some stack templates might include resources that can affect
--     permissions in your Amazon Web Services account; for example, by
--     creating new Identity and Access Management (IAM) users. For those
--     stacks, you must explicitly acknowledge this by specifying one of
--     these capabilities.
--
--     The following IAM resources require you to specify either the
--     @CAPABILITY_IAM@ or @CAPABILITY_NAMED_IAM@ capability.
--
--     -   If you have IAM resources, you can specify either capability.
--
--     -   If you have IAM resources with custom names, you /must/ specify
--         @CAPABILITY_NAMED_IAM@.
--
--     -   If you don\'t specify either of these capabilities,
--         CloudFormation returns an @InsufficientCapabilities@ error.
--
--     If your stack template contains these resources, we recommend that
--     you review all permissions associated with them and edit their
--     permissions if necessary.
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html AWS::IAM::AccessKey>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html AWS::IAM::Policy>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html AWS::IAM::User>
--
--     -   <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html AWS::IAM::UserToGroupAddition>
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities Acknowledging IAM Resources in CloudFormation Templates>.
--
-- -   @CAPABILITY_AUTO_EXPAND@
--
--     Some template contain macros. Macros perform custom processing on
--     templates; this can include simple actions like find-and-replace
--     operations, all the way to extensive transformations of entire
--     templates. Because of this, users typically create a change set from
--     the processed template, so that they can review the changes
--     resulting from the macros before actually creating the stack. If
--     your stack template contains one or more macros, and you choose to
--     create a stack directly from the processed template, without first
--     reviewing the resulting changes in a change set, you must
--     acknowledge this capability. This includes the
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html AWS::Include>
--     and
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html AWS::Serverless>
--     transforms, which are macros hosted by CloudFormation.
--
--     If you want to create a stack from a stack template that contains
--     macros /and/ nested stacks, you must create the stack directly from
--     the template using this capability.
--
--     You should only create stacks directly from a stack template that
--     contains macros if you know what processing the macro performs.
--
--     Each macro relies on an underlying Lambda service function for
--     processing stack templates. Be aware that the Lambda function owner
--     can update the function operation without CloudFormation being
--     notified.
--
--     For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
createStack_capabilities :: Lens.Lens' CreateStack (Prelude.Maybe [Capability])
createStack_capabilities :: (Maybe [Capability] -> f (Maybe [Capability]))
-> CreateStack -> f CreateStack
createStack_capabilities = (CreateStack -> Maybe [Capability])
-> (CreateStack -> Maybe [Capability] -> CreateStack)
-> Lens
     CreateStack CreateStack (Maybe [Capability]) (Maybe [Capability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe [Capability]
capabilities :: Maybe [Capability]
$sel:capabilities:CreateStack' :: CreateStack -> Maybe [Capability]
capabilities} -> Maybe [Capability]
capabilities) (\s :: CreateStack
s@CreateStack' {} Maybe [Capability]
a -> CreateStack
s {$sel:capabilities:CreateStack' :: Maybe [Capability]
capabilities = Maybe [Capability]
a} :: CreateStack) ((Maybe [Capability] -> f (Maybe [Capability]))
 -> CreateStack -> f CreateStack)
-> ((Maybe [Capability] -> f (Maybe [Capability]))
    -> Maybe [Capability] -> f (Maybe [Capability]))
-> (Maybe [Capability] -> f (Maybe [Capability]))
-> CreateStack
-> f CreateStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Capability] [Capability] [Capability] [Capability]
-> Iso
     (Maybe [Capability])
     (Maybe [Capability])
     (Maybe [Capability])
     (Maybe [Capability])
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 [Capability] [Capability] [Capability] [Capability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The rollback triggers for CloudFormation to monitor during stack
-- creation and updating operations, and for the specified monitoring
-- period afterwards.
createStack_rollbackConfiguration :: Lens.Lens' CreateStack (Prelude.Maybe RollbackConfiguration)
createStack_rollbackConfiguration :: (Maybe RollbackConfiguration -> f (Maybe RollbackConfiguration))
-> CreateStack -> f CreateStack
createStack_rollbackConfiguration = (CreateStack -> Maybe RollbackConfiguration)
-> (CreateStack -> Maybe RollbackConfiguration -> CreateStack)
-> Lens
     CreateStack
     CreateStack
     (Maybe RollbackConfiguration)
     (Maybe RollbackConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe RollbackConfiguration
rollbackConfiguration :: Maybe RollbackConfiguration
$sel:rollbackConfiguration:CreateStack' :: CreateStack -> Maybe RollbackConfiguration
rollbackConfiguration} -> Maybe RollbackConfiguration
rollbackConfiguration) (\s :: CreateStack
s@CreateStack' {} Maybe RollbackConfiguration
a -> CreateStack
s {$sel:rollbackConfiguration:CreateStack' :: Maybe RollbackConfiguration
rollbackConfiguration = Maybe RollbackConfiguration
a} :: CreateStack)

-- | Determines what action will be taken if stack creation fails. This must
-- be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either
-- @OnFailure@ or @DisableRollback@, but not both.
--
-- Default: @ROLLBACK@
createStack_onFailure :: Lens.Lens' CreateStack (Prelude.Maybe OnFailure)
createStack_onFailure :: (Maybe OnFailure -> f (Maybe OnFailure))
-> CreateStack -> f CreateStack
createStack_onFailure = (CreateStack -> Maybe OnFailure)
-> (CreateStack -> Maybe OnFailure -> CreateStack)
-> Lens CreateStack CreateStack (Maybe OnFailure) (Maybe OnFailure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe OnFailure
onFailure :: Maybe OnFailure
$sel:onFailure:CreateStack' :: CreateStack -> Maybe OnFailure
onFailure} -> Maybe OnFailure
onFailure) (\s :: CreateStack
s@CreateStack' {} Maybe OnFailure
a -> CreateStack
s {$sel:onFailure:CreateStack' :: Maybe OnFailure
onFailure = Maybe OnFailure
a} :: CreateStack)

-- | The template resource types that you have permissions to work with for
-- this create stack action, such as @AWS::EC2::Instance@, @AWS::EC2::*@,
-- or @Custom::MyCustomInstance@. Use the following syntax to describe
-- template resource types: @AWS::*@ (for all Amazon Web Services
-- resources), @Custom::*@ (for all custom resources),
-- @Custom::logical_ID @ (for a specific custom resource),
-- @AWS::service_name::*@ (for all resources of a particular Amazon Web
-- Services service), and @AWS::service_name::resource_logical_ID @ (for a
-- specific Amazon Web Services resource).
--
-- If the list of resource types doesn\'t include a resource that you\'re
-- creating, the stack creation fails. By default, CloudFormation grants
-- permissions to all resource types. Identity and Access Management (IAM)
-- uses this parameter for CloudFormation-specific condition keys in IAM
-- policies. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html Controlling Access with Identity and Access Management>.
createStack_resourceTypes :: Lens.Lens' CreateStack (Prelude.Maybe [Prelude.Text])
createStack_resourceTypes :: (Maybe [Text] -> f (Maybe [Text])) -> CreateStack -> f CreateStack
createStack_resourceTypes = (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]
resourceTypes :: Maybe [Text]
$sel:resourceTypes:CreateStack' :: CreateStack -> Maybe [Text]
resourceTypes} -> Maybe [Text]
resourceTypes) (\s :: CreateStack
s@CreateStack' {} Maybe [Text]
a -> CreateStack
s {$sel:resourceTypes:CreateStack' :: Maybe [Text]
resourceTypes = Maybe [Text]
a} :: CreateStack) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateStack -> f CreateStack)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateStack
-> f CreateStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Key-value pairs to associate with this stack. CloudFormation also
-- propagates these tags to the resources created in the stack. A maximum
-- number of 50 tags can be specified.
createStack_tags :: Lens.Lens' CreateStack (Prelude.Maybe [Tag])
createStack_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateStack -> f CreateStack
createStack_tags = (CreateStack -> Maybe [Tag])
-> (CreateStack -> Maybe [Tag] -> CreateStack)
-> Lens CreateStack CreateStack (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateStack' :: CreateStack -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateStack
s@CreateStack' {} Maybe [Tag]
a -> CreateStack
s {$sel:tags:CreateStack' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateStack) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateStack -> f CreateStack)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStack
-> f CreateStack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The amount of time that can pass before the stack status becomes
-- CREATE_FAILED; if @DisableRollback@ is not set or is set to @false@, the
-- stack will be rolled back.
createStack_timeoutInMinutes :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Natural)
createStack_timeoutInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> CreateStack -> f CreateStack
createStack_timeoutInMinutes = (CreateStack -> Maybe Natural)
-> (CreateStack -> Maybe Natural -> CreateStack)
-> Lens CreateStack CreateStack (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStack' {Maybe Natural
timeoutInMinutes :: Maybe Natural
$sel:timeoutInMinutes:CreateStack' :: CreateStack -> Maybe Natural
timeoutInMinutes} -> Maybe Natural
timeoutInMinutes) (\s :: CreateStack
s@CreateStack' {} Maybe Natural
a -> CreateStack
s {$sel:timeoutInMinutes:CreateStack' :: Maybe Natural
timeoutInMinutes = Maybe Natural
a} :: CreateStack)

-- | The Amazon Resource Name (ARN) of an Identity and Access Management
-- (IAM) role that CloudFormation assumes to create the stack.
-- CloudFormation uses the role\'s credentials to make calls on your
-- behalf. CloudFormation always uses this role for all future operations
-- on the stack. As long as users have permission to operate on the stack,
-- CloudFormation uses this role even if the users don\'t have permission
-- to pass it. Ensure that the role grants least privilege.
--
-- If you don\'t specify a value, CloudFormation uses the role that was
-- previously associated with the stack. If no role is available,
-- CloudFormation uses a temporary session that is generated from your user
-- credentials.
createStack_roleARN :: Lens.Lens' CreateStack (Prelude.Maybe Prelude.Text)
createStack_roleARN :: (Maybe Text -> f (Maybe Text)) -> CreateStack -> f CreateStack
createStack_roleARN = (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
roleARN :: Maybe Text
$sel:roleARN:CreateStack' :: CreateStack -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: CreateStack
s@CreateStack' {} Maybe Text
a -> CreateStack
s {$sel:roleARN:CreateStack' :: Maybe Text
roleARN = Maybe Text
a} :: CreateStack)

-- | The name that is associated with the stack. The name must be unique in
-- the Region in which you are creating the stack.
--
-- A stack name can contain only alphanumeric characters (case sensitive)
-- and hyphens. It must start with an alphabetical character and cannot be
-- longer than 128 characters.
createStack_stackName :: Lens.Lens' CreateStack Prelude.Text
createStack_stackName :: (Text -> f Text) -> CreateStack -> f CreateStack
createStack_stackName = (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
stackName :: Text
$sel:stackName:CreateStack' :: CreateStack -> Text
stackName} -> Text
stackName) (\s :: CreateStack
s@CreateStack' {} Text
a -> CreateStack
s {$sel:stackName:CreateStack' :: Text
stackName = 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 => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStack)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateStack))
-> Logger
-> Service
-> Proxy CreateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStack)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateStackResult"
      ( \Int
s ResponseHeaders
h [Node]
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.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> 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
forall a. Monoid a => a
Prelude.mempty

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 CreateStack' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Capability]
Maybe [Parameter]
Maybe [Tag]
Maybe Text
Maybe OnFailure
Maybe RollbackConfiguration
Text
stackName :: Text
roleARN :: Maybe Text
timeoutInMinutes :: Maybe Natural
tags :: Maybe [Tag]
resourceTypes :: Maybe [Text]
onFailure :: Maybe OnFailure
rollbackConfiguration :: Maybe RollbackConfiguration
capabilities :: Maybe [Capability]
clientRequestToken :: Maybe Text
templateURL :: Maybe Text
templateBody :: Maybe Text
stackPolicyURL :: Maybe Text
parameters :: Maybe [Parameter]
stackPolicyBody :: Maybe Text
enableTerminationProtection :: Maybe Bool
notificationARNs :: Maybe [Text]
disableRollback :: Maybe Bool
$sel:stackName:CreateStack' :: CreateStack -> Text
$sel:roleARN:CreateStack' :: CreateStack -> Maybe Text
$sel:timeoutInMinutes:CreateStack' :: CreateStack -> Maybe Natural
$sel:tags:CreateStack' :: CreateStack -> Maybe [Tag]
$sel:resourceTypes:CreateStack' :: CreateStack -> Maybe [Text]
$sel:onFailure:CreateStack' :: CreateStack -> Maybe OnFailure
$sel:rollbackConfiguration:CreateStack' :: CreateStack -> Maybe RollbackConfiguration
$sel:capabilities:CreateStack' :: CreateStack -> Maybe [Capability]
$sel:clientRequestToken:CreateStack' :: CreateStack -> Maybe Text
$sel:templateURL:CreateStack' :: CreateStack -> Maybe Text
$sel:templateBody:CreateStack' :: CreateStack -> Maybe Text
$sel:stackPolicyURL:CreateStack' :: CreateStack -> Maybe Text
$sel:parameters:CreateStack' :: CreateStack -> Maybe [Parameter]
$sel:stackPolicyBody:CreateStack' :: CreateStack -> Maybe Text
$sel:enableTerminationProtection:CreateStack' :: CreateStack -> Maybe Bool
$sel:notificationARNs:CreateStack' :: CreateStack -> Maybe [Text]
$sel:disableRollback:CreateStack' :: CreateStack -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateStack" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"DisableRollback" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
disableRollback,
        ByteString
"NotificationARNs"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
notificationARNs
            ),
        ByteString
"EnableTerminationProtection"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enableTerminationProtection,
        ByteString
"StackPolicyBody" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackPolicyBody,
        ByteString
"Parameters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Parameter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Parameter] -> QueryString)
-> Maybe [Parameter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Parameter]
parameters),
        ByteString
"StackPolicyURL" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackPolicyURL,
        ByteString
"TemplateBody" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateBody,
        ByteString
"TemplateURL" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateURL,
        ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
        ByteString
"Capabilities"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Capability] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Capability] -> QueryString)
-> Maybe [Capability] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Capability]
capabilities),
        ByteString
"RollbackConfiguration"
          ByteString -> Maybe RollbackConfiguration -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RollbackConfiguration
rollbackConfiguration,
        ByteString
"OnFailure" ByteString -> Maybe OnFailure -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe OnFailure
onFailure,
        ByteString
"ResourceTypes"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourceTypes
            ),
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"TimeoutInMinutes" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
timeoutInMinutes,
        ByteString
"RoleARN" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
roleARN,
        ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
      ]

-- | The output for a CreateStack action.
--
-- /See:/ 'newCreateStackResponse' smart constructor.
data CreateStackResponse = CreateStackResponse'
  { -- | Unique identifier of the stack.
    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' - Unique identifier of the stack.
--
-- '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_
    }

-- | Unique identifier of the stack.
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