{-# 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.CreateStackSet
-- 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 set.
module Amazonka.CloudFormation.CreateStackSet
  ( -- * Creating a Request
    CreateStackSet (..),
    newCreateStackSet,

    -- * Request Lenses
    createStackSet_administrationRoleARN,
    createStackSet_callAs,
    createStackSet_autoDeployment,
    createStackSet_permissionModel,
    createStackSet_parameters,
    createStackSet_templateBody,
    createStackSet_templateURL,
    createStackSet_stackId,
    createStackSet_clientRequestToken,
    createStackSet_description,
    createStackSet_capabilities,
    createStackSet_tags,
    createStackSet_executionRoleName,
    createStackSet_stackSetName,

    -- * Destructuring the Response
    CreateStackSetResponse (..),
    newCreateStackSetResponse,

    -- * Response Lenses
    createStackSetResponse_stackSetId,
    createStackSetResponse_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

-- | /See:/ 'newCreateStackSet' smart constructor.
data CreateStackSet = CreateStackSet'
  { -- | The Amazon Resource Number (ARN) of the IAM role to use to create this
    -- stack set.
    --
    -- Specify an IAM role only if you are using customized administrator roles
    -- to control which users or groups can manage specific stack sets within
    -- the same administrator account. For more information, see
    -- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Prerequisites: Granting Permissions for Stack Set Operations>
    -- in the /CloudFormation User Guide/.
    CreateStackSet -> Maybe Text
administrationRoleARN :: Prelude.Maybe Prelude.Text,
    -- | [Service-managed permissions] Specifies whether you are acting as an
    -- account administrator in the organization\'s management account or as a
    -- delegated administrator in a member account.
    --
    -- By default, @SELF@ is specified. Use @SELF@ for stack sets with
    -- self-managed permissions.
    --
    -- -   To create a stack set with service-managed permissions while signed
    --     in to the management account, specify @SELF@.
    --
    -- -   To create a stack set with service-managed permissions while signed
    --     in to a delegated administrator account, specify @DELEGATED_ADMIN@.
    --
    --     Your Amazon Web Services account must be registered as a delegated
    --     admin in the management account. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
    --     in the /CloudFormation User Guide/.
    --
    -- Stack sets with service-managed permissions are created in the
    -- management account, including stack sets that are created by delegated
    -- administrators.
    CreateStackSet -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | Describes whether StackSets automatically deploys to Organizations
    -- accounts that are added to the target organization or organizational
    -- unit (OU). Specify only if @PermissionModel@ is @SERVICE_MANAGED@.
    CreateStackSet -> Maybe AutoDeployment
autoDeployment :: Prelude.Maybe AutoDeployment,
    -- | Describes how the IAM roles required for stack set operations are
    -- created. By default, @SELF-MANAGED@ is specified.
    --
    -- -   With @self-managed@ permissions, you must create the administrator
    --     and execution roles required to deploy to target accounts. For more
    --     information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
    --
    -- -   With @service-managed@ permissions, StackSets automatically creates
    --     the IAM roles required to deploy to accounts managed by
    --     Organizations. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
    CreateStackSet -> Maybe PermissionModels
permissionModel :: Prelude.Maybe PermissionModels,
    -- | The input parameters for the stack set template.
    CreateStackSet -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
    -- | The structure that contains the template body, with a minimum length of
    -- 1 byte and a maximum length of 51,200 bytes. For more information, see
    -- <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.
    CreateStackSet -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | The location of the file that contains the template body. The URL must
    -- point to a template (maximum size: 460,800 bytes) that\'s located in an
    -- Amazon S3 bucket or a Systems Manager document. For more information,
    -- see
    -- <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.
    CreateStackSet -> Maybe Text
templateURL :: Prelude.Maybe Prelude.Text,
    -- | The stack ID you are importing into a new stack set. Specify the Amazon
    -- Resource Number (ARN) of the stack.
    CreateStackSet -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for this @CreateStackSet@ request. Specify this
    -- token if you plan to retry requests so that CloudFormation knows that
    -- you\'re not attempting to create another stack set with the same name.
    -- You might retry @CreateStackSet@ requests to ensure that CloudFormation
    -- successfully received them.
    --
    -- If you don\'t specify an operation ID, the SDK generates one
    -- automatically.
    CreateStackSet -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | A description of the stack set. You can use the description to identify
    -- the stack set\'s purpose or other important information.
    CreateStackSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | In some cases, you must explicitly acknowledge that your stack set
    -- template contains certain capabilities in order for CloudFormation to
    -- create the stack set and related stack instances.
    --
    -- -   @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
    --     stack sets, 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 templates reference macros. If your stack set template
    --     references one or more macros, you must create the stack set
    --     directly from the processed template, without first reviewing the
    --     resulting changes in a change set. To create the stack set directly,
    --     you must acknowledge this capability. For more information, see
    --     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
    --
    --     Stack sets with service-managed permissions do not currently support
    --     the use of macros in templates. (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.) Even if you
    --     specify this capability for a stack set with service-managed
    --     permissions, if you reference a macro in your template the stack set
    --     operation will fail.
    CreateStackSet -> Maybe [Capability]
capabilities :: Prelude.Maybe [Capability],
    -- | The key-value pairs to associate with this stack set and the stacks
    -- created from it. CloudFormation also propagates these tags to supported
    -- resources that are created in the stacks. A maximum number of 50 tags
    -- can be specified.
    --
    -- If you specify tags as part of a @CreateStackSet@ action, CloudFormation
    -- checks to see if you have the required IAM permission to tag resources.
    -- If you don\'t, the entire @CreateStackSet@ action fails with an
    -- @access denied@ error, and the stack set is not created.
    CreateStackSet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the IAM execution role to use to create the stack set. If
    -- you do not specify an execution role, CloudFormation uses the
    -- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
    -- operation.
    --
    -- Specify an IAM role only if you are using customized execution roles to
    -- control which stack resources users and groups can include in their
    -- stack sets.
    CreateStackSet -> Maybe Text
executionRoleName :: Prelude.Maybe Prelude.Text,
    -- | The name to associate with the stack set. The name must be unique in the
    -- Region where you create your stack set.
    --
    -- A stack name can contain only alphanumeric characters (case-sensitive)
    -- and hyphens. It must start with an alphabetic character and can\'t be
    -- longer than 128 characters.
    CreateStackSet -> Text
stackSetName :: Prelude.Text
  }
  deriving (CreateStackSet -> CreateStackSet -> Bool
(CreateStackSet -> CreateStackSet -> Bool)
-> (CreateStackSet -> CreateStackSet -> Bool) -> Eq CreateStackSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStackSet -> CreateStackSet -> Bool
$c/= :: CreateStackSet -> CreateStackSet -> Bool
== :: CreateStackSet -> CreateStackSet -> Bool
$c== :: CreateStackSet -> CreateStackSet -> Bool
Prelude.Eq, ReadPrec [CreateStackSet]
ReadPrec CreateStackSet
Int -> ReadS CreateStackSet
ReadS [CreateStackSet]
(Int -> ReadS CreateStackSet)
-> ReadS [CreateStackSet]
-> ReadPrec CreateStackSet
-> ReadPrec [CreateStackSet]
-> Read CreateStackSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStackSet]
$creadListPrec :: ReadPrec [CreateStackSet]
readPrec :: ReadPrec CreateStackSet
$creadPrec :: ReadPrec CreateStackSet
readList :: ReadS [CreateStackSet]
$creadList :: ReadS [CreateStackSet]
readsPrec :: Int -> ReadS CreateStackSet
$creadsPrec :: Int -> ReadS CreateStackSet
Prelude.Read, Int -> CreateStackSet -> ShowS
[CreateStackSet] -> ShowS
CreateStackSet -> String
(Int -> CreateStackSet -> ShowS)
-> (CreateStackSet -> String)
-> ([CreateStackSet] -> ShowS)
-> Show CreateStackSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStackSet] -> ShowS
$cshowList :: [CreateStackSet] -> ShowS
show :: CreateStackSet -> String
$cshow :: CreateStackSet -> String
showsPrec :: Int -> CreateStackSet -> ShowS
$cshowsPrec :: Int -> CreateStackSet -> ShowS
Prelude.Show, (forall x. CreateStackSet -> Rep CreateStackSet x)
-> (forall x. Rep CreateStackSet x -> CreateStackSet)
-> Generic CreateStackSet
forall x. Rep CreateStackSet x -> CreateStackSet
forall x. CreateStackSet -> Rep CreateStackSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStackSet x -> CreateStackSet
$cfrom :: forall x. CreateStackSet -> Rep CreateStackSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateStackSet' 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:
--
-- 'administrationRoleARN', 'createStackSet_administrationRoleARN' - The Amazon Resource Number (ARN) of the IAM role to use to create this
-- stack set.
--
-- Specify an IAM role only if you are using customized administrator roles
-- to control which users or groups can manage specific stack sets within
-- the same administrator account. For more information, see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Prerequisites: Granting Permissions for Stack Set Operations>
-- in the /CloudFormation User Guide/.
--
-- 'callAs', 'createStackSet_callAs' - [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   To create a stack set with service-managed permissions while signed
--     in to the management account, specify @SELF@.
--
-- -   To create a stack set with service-managed permissions while signed
--     in to a delegated administrator account, specify @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     admin in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
--
-- Stack sets with service-managed permissions are created in the
-- management account, including stack sets that are created by delegated
-- administrators.
--
-- 'autoDeployment', 'createStackSet_autoDeployment' - Describes whether StackSets automatically deploys to Organizations
-- accounts that are added to the target organization or organizational
-- unit (OU). Specify only if @PermissionModel@ is @SERVICE_MANAGED@.
--
-- 'permissionModel', 'createStackSet_permissionModel' - Describes how the IAM roles required for stack set operations are
-- created. By default, @SELF-MANAGED@ is specified.
--
-- -   With @self-managed@ permissions, you must create the administrator
--     and execution roles required to deploy to target accounts. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
--
-- -   With @service-managed@ permissions, StackSets automatically creates
--     the IAM roles required to deploy to accounts managed by
--     Organizations. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
--
-- 'parameters', 'createStackSet_parameters' - The input parameters for the stack set template.
--
-- 'templateBody', 'createStackSet_templateBody' - The structure that contains the template body, with a minimum length of
-- 1 byte and a maximum length of 51,200 bytes. For more information, see
-- <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', 'createStackSet_templateURL' - The location of the file that contains the template body. The URL must
-- point to a template (maximum size: 460,800 bytes) that\'s located in an
-- Amazon S3 bucket or a Systems Manager document. For more information,
-- see
-- <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.
--
-- 'stackId', 'createStackSet_stackId' - The stack ID you are importing into a new stack set. Specify the Amazon
-- Resource Number (ARN) of the stack.
--
-- 'clientRequestToken', 'createStackSet_clientRequestToken' - A unique identifier for this @CreateStackSet@ request. Specify this
-- token if you plan to retry requests so that CloudFormation knows that
-- you\'re not attempting to create another stack set with the same name.
-- You might retry @CreateStackSet@ requests to ensure that CloudFormation
-- successfully received them.
--
-- If you don\'t specify an operation ID, the SDK generates one
-- automatically.
--
-- 'description', 'createStackSet_description' - A description of the stack set. You can use the description to identify
-- the stack set\'s purpose or other important information.
--
-- 'capabilities', 'createStackSet_capabilities' - In some cases, you must explicitly acknowledge that your stack set
-- template contains certain capabilities in order for CloudFormation to
-- create the stack set and related stack instances.
--
-- -   @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
--     stack sets, 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 templates reference macros. If your stack set template
--     references one or more macros, you must create the stack set
--     directly from the processed template, without first reviewing the
--     resulting changes in a change set. To create the stack set directly,
--     you must acknowledge this capability. For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
--
--     Stack sets with service-managed permissions do not currently support
--     the use of macros in templates. (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.) Even if you
--     specify this capability for a stack set with service-managed
--     permissions, if you reference a macro in your template the stack set
--     operation will fail.
--
-- 'tags', 'createStackSet_tags' - The key-value pairs to associate with this stack set and the stacks
-- created from it. CloudFormation also propagates these tags to supported
-- resources that are created in the stacks. A maximum number of 50 tags
-- can be specified.
--
-- If you specify tags as part of a @CreateStackSet@ action, CloudFormation
-- checks to see if you have the required IAM permission to tag resources.
-- If you don\'t, the entire @CreateStackSet@ action fails with an
-- @access denied@ error, and the stack set is not created.
--
-- 'executionRoleName', 'createStackSet_executionRoleName' - The name of the IAM execution role to use to create the stack set. If
-- you do not specify an execution role, CloudFormation uses the
-- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
-- operation.
--
-- Specify an IAM role only if you are using customized execution roles to
-- control which stack resources users and groups can include in their
-- stack sets.
--
-- 'stackSetName', 'createStackSet_stackSetName' - The name to associate with the stack set. The name must be unique in the
-- Region where you create your stack set.
--
-- A stack name can contain only alphanumeric characters (case-sensitive)
-- and hyphens. It must start with an alphabetic character and can\'t be
-- longer than 128 characters.
newCreateStackSet ::
  -- | 'stackSetName'
  Prelude.Text ->
  CreateStackSet
newCreateStackSet :: Text -> CreateStackSet
newCreateStackSet Text
pStackSetName_ =
  CreateStackSet' :: Maybe Text
-> Maybe CallAs
-> Maybe AutoDeployment
-> Maybe PermissionModels
-> Maybe [Parameter]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Capability]
-> Maybe [Tag]
-> Maybe Text
-> Text
-> CreateStackSet
CreateStackSet'
    { $sel:administrationRoleARN:CreateStackSet' :: Maybe Text
administrationRoleARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:callAs:CreateStackSet' :: Maybe CallAs
callAs = Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
      $sel:autoDeployment:CreateStackSet' :: Maybe AutoDeployment
autoDeployment = Maybe AutoDeployment
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionModel:CreateStackSet' :: Maybe PermissionModels
permissionModel = Maybe PermissionModels
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:CreateStackSet' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:CreateStackSet' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateURL:CreateStackSet' :: Maybe Text
templateURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:CreateStackSet' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateStackSet' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateStackSet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:capabilities:CreateStackSet' :: Maybe [Capability]
capabilities = Maybe [Capability]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateStackSet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:executionRoleName:CreateStackSet' :: Maybe Text
executionRoleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetName:CreateStackSet' :: Text
stackSetName = Text
pStackSetName_
    }

-- | The Amazon Resource Number (ARN) of the IAM role to use to create this
-- stack set.
--
-- Specify an IAM role only if you are using customized administrator roles
-- to control which users or groups can manage specific stack sets within
-- the same administrator account. For more information, see
-- <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html Prerequisites: Granting Permissions for Stack Set Operations>
-- in the /CloudFormation User Guide/.
createStackSet_administrationRoleARN :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_administrationRoleARN :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_administrationRoleARN = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
administrationRoleARN :: Maybe Text
$sel:administrationRoleARN:CreateStackSet' :: CreateStackSet -> Maybe Text
administrationRoleARN} -> Maybe Text
administrationRoleARN) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:administrationRoleARN:CreateStackSet' :: Maybe Text
administrationRoleARN = Maybe Text
a} :: CreateStackSet)

-- | [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   To create a stack set with service-managed permissions while signed
--     in to the management account, specify @SELF@.
--
-- -   To create a stack set with service-managed permissions while signed
--     in to a delegated administrator account, specify @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     admin in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
--
-- Stack sets with service-managed permissions are created in the
-- management account, including stack sets that are created by delegated
-- administrators.
createStackSet_callAs :: Lens.Lens' CreateStackSet (Prelude.Maybe CallAs)
createStackSet_callAs :: (Maybe CallAs -> f (Maybe CallAs))
-> CreateStackSet -> f CreateStackSet
createStackSet_callAs = (CreateStackSet -> Maybe CallAs)
-> (CreateStackSet -> Maybe CallAs -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe CallAs) (Maybe CallAs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:CreateStackSet' :: CreateStackSet -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe CallAs
a -> CreateStackSet
s {$sel:callAs:CreateStackSet' :: Maybe CallAs
callAs = Maybe CallAs
a} :: CreateStackSet)

-- | Describes whether StackSets automatically deploys to Organizations
-- accounts that are added to the target organization or organizational
-- unit (OU). Specify only if @PermissionModel@ is @SERVICE_MANAGED@.
createStackSet_autoDeployment :: Lens.Lens' CreateStackSet (Prelude.Maybe AutoDeployment)
createStackSet_autoDeployment :: (Maybe AutoDeployment -> f (Maybe AutoDeployment))
-> CreateStackSet -> f CreateStackSet
createStackSet_autoDeployment = (CreateStackSet -> Maybe AutoDeployment)
-> (CreateStackSet -> Maybe AutoDeployment -> CreateStackSet)
-> Lens
     CreateStackSet
     CreateStackSet
     (Maybe AutoDeployment)
     (Maybe AutoDeployment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe AutoDeployment
autoDeployment :: Maybe AutoDeployment
$sel:autoDeployment:CreateStackSet' :: CreateStackSet -> Maybe AutoDeployment
autoDeployment} -> Maybe AutoDeployment
autoDeployment) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe AutoDeployment
a -> CreateStackSet
s {$sel:autoDeployment:CreateStackSet' :: Maybe AutoDeployment
autoDeployment = Maybe AutoDeployment
a} :: CreateStackSet)

-- | Describes how the IAM roles required for stack set operations are
-- created. By default, @SELF-MANAGED@ is specified.
--
-- -   With @self-managed@ permissions, you must create the administrator
--     and execution roles required to deploy to target accounts. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html Grant Self-Managed Stack Set Permissions>.
--
-- -   With @service-managed@ permissions, StackSets automatically creates
--     the IAM roles required to deploy to accounts managed by
--     Organizations. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html Grant Service-Managed Stack Set Permissions>.
createStackSet_permissionModel :: Lens.Lens' CreateStackSet (Prelude.Maybe PermissionModels)
createStackSet_permissionModel :: (Maybe PermissionModels -> f (Maybe PermissionModels))
-> CreateStackSet -> f CreateStackSet
createStackSet_permissionModel = (CreateStackSet -> Maybe PermissionModels)
-> (CreateStackSet -> Maybe PermissionModels -> CreateStackSet)
-> Lens
     CreateStackSet
     CreateStackSet
     (Maybe PermissionModels)
     (Maybe PermissionModels)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe PermissionModels
permissionModel :: Maybe PermissionModels
$sel:permissionModel:CreateStackSet' :: CreateStackSet -> Maybe PermissionModels
permissionModel} -> Maybe PermissionModels
permissionModel) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe PermissionModels
a -> CreateStackSet
s {$sel:permissionModel:CreateStackSet' :: Maybe PermissionModels
permissionModel = Maybe PermissionModels
a} :: CreateStackSet)

-- | The input parameters for the stack set template.
createStackSet_parameters :: Lens.Lens' CreateStackSet (Prelude.Maybe [Parameter])
createStackSet_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> CreateStackSet -> f CreateStackSet
createStackSet_parameters = (CreateStackSet -> Maybe [Parameter])
-> (CreateStackSet -> Maybe [Parameter] -> CreateStackSet)
-> Lens
     CreateStackSet
     CreateStackSet
     (Maybe [Parameter])
     (Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:CreateStackSet' :: CreateStackSet -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe [Parameter]
a -> CreateStackSet
s {$sel:parameters:CreateStackSet' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: CreateStackSet) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> CreateStackSet -> f CreateStackSet)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> CreateStackSet
-> f CreateStackSet
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

-- | The structure that contains the template body, with a minimum length of
-- 1 byte and a maximum length of 51,200 bytes. For more information, see
-- <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.
createStackSet_templateBody :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_templateBody :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_templateBody = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:CreateStackSet' :: CreateStackSet -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:templateBody:CreateStackSet' :: Maybe Text
templateBody = Maybe Text
a} :: CreateStackSet)

-- | The location of the file that contains the template body. The URL must
-- point to a template (maximum size: 460,800 bytes) that\'s located in an
-- Amazon S3 bucket or a Systems Manager document. For more information,
-- see
-- <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.
createStackSet_templateURL :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_templateURL :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_templateURL = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
templateURL :: Maybe Text
$sel:templateURL:CreateStackSet' :: CreateStackSet -> Maybe Text
templateURL} -> Maybe Text
templateURL) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:templateURL:CreateStackSet' :: Maybe Text
templateURL = Maybe Text
a} :: CreateStackSet)

-- | The stack ID you are importing into a new stack set. Specify the Amazon
-- Resource Number (ARN) of the stack.
createStackSet_stackId :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_stackId :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_stackId = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
stackId :: Maybe Text
$sel:stackId:CreateStackSet' :: CreateStackSet -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:stackId:CreateStackSet' :: Maybe Text
stackId = Maybe Text
a} :: CreateStackSet)

-- | A unique identifier for this @CreateStackSet@ request. Specify this
-- token if you plan to retry requests so that CloudFormation knows that
-- you\'re not attempting to create another stack set with the same name.
-- You might retry @CreateStackSet@ requests to ensure that CloudFormation
-- successfully received them.
--
-- If you don\'t specify an operation ID, the SDK generates one
-- automatically.
createStackSet_clientRequestToken :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_clientRequestToken = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateStackSet' :: CreateStackSet -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:clientRequestToken:CreateStackSet' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateStackSet)

-- | A description of the stack set. You can use the description to identify
-- the stack set\'s purpose or other important information.
createStackSet_description :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_description :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_description = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
description :: Maybe Text
$sel:description:CreateStackSet' :: CreateStackSet -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:description:CreateStackSet' :: Maybe Text
description = Maybe Text
a} :: CreateStackSet)

-- | In some cases, you must explicitly acknowledge that your stack set
-- template contains certain capabilities in order for CloudFormation to
-- create the stack set and related stack instances.
--
-- -   @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
--     stack sets, 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 templates reference macros. If your stack set template
--     references one or more macros, you must create the stack set
--     directly from the processed template, without first reviewing the
--     resulting changes in a change set. To create the stack set directly,
--     you must acknowledge this capability. For more information, see
--     <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html Using CloudFormation Macros to Perform Custom Processing on Templates>.
--
--     Stack sets with service-managed permissions do not currently support
--     the use of macros in templates. (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.) Even if you
--     specify this capability for a stack set with service-managed
--     permissions, if you reference a macro in your template the stack set
--     operation will fail.
createStackSet_capabilities :: Lens.Lens' CreateStackSet (Prelude.Maybe [Capability])
createStackSet_capabilities :: (Maybe [Capability] -> f (Maybe [Capability]))
-> CreateStackSet -> f CreateStackSet
createStackSet_capabilities = (CreateStackSet -> Maybe [Capability])
-> (CreateStackSet -> Maybe [Capability] -> CreateStackSet)
-> Lens
     CreateStackSet
     CreateStackSet
     (Maybe [Capability])
     (Maybe [Capability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe [Capability]
capabilities :: Maybe [Capability]
$sel:capabilities:CreateStackSet' :: CreateStackSet -> Maybe [Capability]
capabilities} -> Maybe [Capability]
capabilities) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe [Capability]
a -> CreateStackSet
s {$sel:capabilities:CreateStackSet' :: Maybe [Capability]
capabilities = Maybe [Capability]
a} :: CreateStackSet) ((Maybe [Capability] -> f (Maybe [Capability]))
 -> CreateStackSet -> f CreateStackSet)
-> ((Maybe [Capability] -> f (Maybe [Capability]))
    -> Maybe [Capability] -> f (Maybe [Capability]))
-> (Maybe [Capability] -> f (Maybe [Capability]))
-> CreateStackSet
-> f CreateStackSet
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 key-value pairs to associate with this stack set and the stacks
-- created from it. CloudFormation also propagates these tags to supported
-- resources that are created in the stacks. A maximum number of 50 tags
-- can be specified.
--
-- If you specify tags as part of a @CreateStackSet@ action, CloudFormation
-- checks to see if you have the required IAM permission to tag resources.
-- If you don\'t, the entire @CreateStackSet@ action fails with an
-- @access denied@ error, and the stack set is not created.
createStackSet_tags :: Lens.Lens' CreateStackSet (Prelude.Maybe [Tag])
createStackSet_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStackSet -> f CreateStackSet
createStackSet_tags = (CreateStackSet -> Maybe [Tag])
-> (CreateStackSet -> Maybe [Tag] -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateStackSet' :: CreateStackSet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe [Tag]
a -> CreateStackSet
s {$sel:tags:CreateStackSet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateStackSet) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateStackSet -> f CreateStackSet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStackSet
-> f CreateStackSet
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 name of the IAM execution role to use to create the stack set. If
-- you do not specify an execution role, CloudFormation uses the
-- @AWSCloudFormationStackSetExecutionRole@ role for the stack set
-- operation.
--
-- Specify an IAM role only if you are using customized execution roles to
-- control which stack resources users and groups can include in their
-- stack sets.
createStackSet_executionRoleName :: Lens.Lens' CreateStackSet (Prelude.Maybe Prelude.Text)
createStackSet_executionRoleName :: (Maybe Text -> f (Maybe Text))
-> CreateStackSet -> f CreateStackSet
createStackSet_executionRoleName = (CreateStackSet -> Maybe Text)
-> (CreateStackSet -> Maybe Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Maybe Text
executionRoleName :: Maybe Text
$sel:executionRoleName:CreateStackSet' :: CreateStackSet -> Maybe Text
executionRoleName} -> Maybe Text
executionRoleName) (\s :: CreateStackSet
s@CreateStackSet' {} Maybe Text
a -> CreateStackSet
s {$sel:executionRoleName:CreateStackSet' :: Maybe Text
executionRoleName = Maybe Text
a} :: CreateStackSet)

-- | The name to associate with the stack set. The name must be unique in the
-- Region where you create your stack set.
--
-- A stack name can contain only alphanumeric characters (case-sensitive)
-- and hyphens. It must start with an alphabetic character and can\'t be
-- longer than 128 characters.
createStackSet_stackSetName :: Lens.Lens' CreateStackSet Prelude.Text
createStackSet_stackSetName :: (Text -> f Text) -> CreateStackSet -> f CreateStackSet
createStackSet_stackSetName = (CreateStackSet -> Text)
-> (CreateStackSet -> Text -> CreateStackSet)
-> Lens CreateStackSet CreateStackSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSet' {Text
stackSetName :: Text
$sel:stackSetName:CreateStackSet' :: CreateStackSet -> Text
stackSetName} -> Text
stackSetName) (\s :: CreateStackSet
s@CreateStackSet' {} Text
a -> CreateStackSet
s {$sel:stackSetName:CreateStackSet' :: Text
stackSetName = Text
a} :: CreateStackSet)

instance Core.AWSRequest CreateStackSet where
  type
    AWSResponse CreateStackSet =
      CreateStackSetResponse
  request :: CreateStackSet -> Request CreateStackSet
request = Service -> CreateStackSet -> Request CreateStackSet
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateStackSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStackSet)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateStackSet))
-> Logger
-> Service
-> Proxy CreateStackSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStackSet)))
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
"CreateStackSetResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Int -> CreateStackSetResponse
CreateStackSetResponse'
            (Maybe Text -> Int -> CreateStackSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateStackSetResponse)
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
"StackSetId")
            Either String (Int -> CreateStackSetResponse)
-> Either String Int -> Either String CreateStackSetResponse
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 CreateStackSet

instance Prelude.NFData CreateStackSet

instance Core.ToHeaders CreateStackSet where
  toHeaders :: CreateStackSet -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateStackSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery CreateStackSet where
  toQuery :: CreateStackSet -> QueryString
toQuery CreateStackSet' {Maybe [Capability]
Maybe [Parameter]
Maybe [Tag]
Maybe Text
Maybe AutoDeployment
Maybe CallAs
Maybe PermissionModels
Text
stackSetName :: Text
executionRoleName :: Maybe Text
tags :: Maybe [Tag]
capabilities :: Maybe [Capability]
description :: Maybe Text
clientRequestToken :: Maybe Text
stackId :: Maybe Text
templateURL :: Maybe Text
templateBody :: Maybe Text
parameters :: Maybe [Parameter]
permissionModel :: Maybe PermissionModels
autoDeployment :: Maybe AutoDeployment
callAs :: Maybe CallAs
administrationRoleARN :: Maybe Text
$sel:stackSetName:CreateStackSet' :: CreateStackSet -> Text
$sel:executionRoleName:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:tags:CreateStackSet' :: CreateStackSet -> Maybe [Tag]
$sel:capabilities:CreateStackSet' :: CreateStackSet -> Maybe [Capability]
$sel:description:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:clientRequestToken:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:stackId:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:templateURL:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:templateBody:CreateStackSet' :: CreateStackSet -> Maybe Text
$sel:parameters:CreateStackSet' :: CreateStackSet -> Maybe [Parameter]
$sel:permissionModel:CreateStackSet' :: CreateStackSet -> Maybe PermissionModels
$sel:autoDeployment:CreateStackSet' :: CreateStackSet -> Maybe AutoDeployment
$sel:callAs:CreateStackSet' :: CreateStackSet -> Maybe CallAs
$sel:administrationRoleARN:CreateStackSet' :: CreateStackSet -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateStackSet" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"AdministrationRoleARN"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
administrationRoleARN,
        ByteString
"CallAs" ByteString -> Maybe CallAs -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CallAs
callAs,
        ByteString
"AutoDeployment" ByteString -> Maybe AutoDeployment -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AutoDeployment
autoDeployment,
        ByteString
"PermissionModel" ByteString -> Maybe PermissionModels -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PermissionModels
permissionModel,
        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
"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
"StackId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackId,
        ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
        ByteString
"Description" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
description,
        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
"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
"ExecutionRoleName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
executionRoleName,
        ByteString
"StackSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackSetName
      ]

-- | /See:/ 'newCreateStackSetResponse' smart constructor.
data CreateStackSetResponse = CreateStackSetResponse'
  { -- | The ID of the stack set that you\'re creating.
    CreateStackSetResponse -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateStackSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateStackSetResponse -> CreateStackSetResponse -> Bool
(CreateStackSetResponse -> CreateStackSetResponse -> Bool)
-> (CreateStackSetResponse -> CreateStackSetResponse -> Bool)
-> Eq CreateStackSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStackSetResponse -> CreateStackSetResponse -> Bool
$c/= :: CreateStackSetResponse -> CreateStackSetResponse -> Bool
== :: CreateStackSetResponse -> CreateStackSetResponse -> Bool
$c== :: CreateStackSetResponse -> CreateStackSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateStackSetResponse]
ReadPrec CreateStackSetResponse
Int -> ReadS CreateStackSetResponse
ReadS [CreateStackSetResponse]
(Int -> ReadS CreateStackSetResponse)
-> ReadS [CreateStackSetResponse]
-> ReadPrec CreateStackSetResponse
-> ReadPrec [CreateStackSetResponse]
-> Read CreateStackSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStackSetResponse]
$creadListPrec :: ReadPrec [CreateStackSetResponse]
readPrec :: ReadPrec CreateStackSetResponse
$creadPrec :: ReadPrec CreateStackSetResponse
readList :: ReadS [CreateStackSetResponse]
$creadList :: ReadS [CreateStackSetResponse]
readsPrec :: Int -> ReadS CreateStackSetResponse
$creadsPrec :: Int -> ReadS CreateStackSetResponse
Prelude.Read, Int -> CreateStackSetResponse -> ShowS
[CreateStackSetResponse] -> ShowS
CreateStackSetResponse -> String
(Int -> CreateStackSetResponse -> ShowS)
-> (CreateStackSetResponse -> String)
-> ([CreateStackSetResponse] -> ShowS)
-> Show CreateStackSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStackSetResponse] -> ShowS
$cshowList :: [CreateStackSetResponse] -> ShowS
show :: CreateStackSetResponse -> String
$cshow :: CreateStackSetResponse -> String
showsPrec :: Int -> CreateStackSetResponse -> ShowS
$cshowsPrec :: Int -> CreateStackSetResponse -> ShowS
Prelude.Show, (forall x. CreateStackSetResponse -> Rep CreateStackSetResponse x)
-> (forall x.
    Rep CreateStackSetResponse x -> CreateStackSetResponse)
-> Generic CreateStackSetResponse
forall x. Rep CreateStackSetResponse x -> CreateStackSetResponse
forall x. CreateStackSetResponse -> Rep CreateStackSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStackSetResponse x -> CreateStackSetResponse
$cfrom :: forall x. CreateStackSetResponse -> Rep CreateStackSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateStackSetResponse' 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:
--
-- 'stackSetId', 'createStackSetResponse_stackSetId' - The ID of the stack set that you\'re creating.
--
-- 'httpStatus', 'createStackSetResponse_httpStatus' - The response's http status code.
newCreateStackSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStackSetResponse
newCreateStackSetResponse :: Int -> CreateStackSetResponse
newCreateStackSetResponse Int
pHttpStatus_ =
  CreateStackSetResponse' :: Maybe Text -> Int -> CreateStackSetResponse
CreateStackSetResponse'
    { $sel:stackSetId:CreateStackSetResponse' :: Maybe Text
stackSetId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStackSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the stack set that you\'re creating.
createStackSetResponse_stackSetId :: Lens.Lens' CreateStackSetResponse (Prelude.Maybe Prelude.Text)
createStackSetResponse_stackSetId :: (Maybe Text -> f (Maybe Text))
-> CreateStackSetResponse -> f CreateStackSetResponse
createStackSetResponse_stackSetId = (CreateStackSetResponse -> Maybe Text)
-> (CreateStackSetResponse -> Maybe Text -> CreateStackSetResponse)
-> Lens
     CreateStackSetResponse
     CreateStackSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStackSetResponse' {Maybe Text
stackSetId :: Maybe Text
$sel:stackSetId:CreateStackSetResponse' :: CreateStackSetResponse -> Maybe Text
stackSetId} -> Maybe Text
stackSetId) (\s :: CreateStackSetResponse
s@CreateStackSetResponse' {} Maybe Text
a -> CreateStackSetResponse
s {$sel:stackSetId:CreateStackSetResponse' :: Maybe Text
stackSetId = Maybe Text
a} :: CreateStackSetResponse)

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

instance Prelude.NFData CreateStackSetResponse