{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.StackSetOperation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.StackSetOperation where

import Amazonka.CloudFormation.Types.DeploymentTargets
import Amazonka.CloudFormation.Types.StackSetDriftDetectionDetails
import Amazonka.CloudFormation.Types.StackSetOperationAction
import Amazonka.CloudFormation.Types.StackSetOperationPreferences
import Amazonka.CloudFormation.Types.StackSetOperationStatus
import Amazonka.CloudFormation.Types.StackSetOperationStatusDetails
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The structure that contains information about a stack set operation.
--
-- /See:/ 'newStackSetOperation' smart constructor.
data StackSetOperation = StackSetOperation'
  { -- | The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
    -- and delete operations affect only the specified stack set instances that
    -- are associated with the specified stack set. Update operations affect
    -- both the stack set itself, in addition to /all/ associated stack set
    -- instances.
    StackSetOperation -> Maybe StackSetOperationAction
action :: Prelude.Maybe StackSetOperationAction,
    -- | The Amazon Resource Name (ARN) of the IAM role used to perform this
    -- stack set operation.
    --
    -- Use 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 Define Permissions for Multiple Administrators>
    -- in the /CloudFormation User Guide/.
    StackSetOperation -> Maybe Text
administrationRoleARN :: Prelude.Maybe Prelude.Text,
    -- | The time at which the operation was initiated. Note that the creation
    -- times for the stack set operation might differ from the creation time of
    -- the individual stacks themselves. This is because CloudFormation needs
    -- to perform preparatory work for the operation, such as dispatching the
    -- work to the requested Regions, before actually creating the first
    -- stacks.
    StackSetOperation -> Maybe ISO8601
creationTimestamp :: Prelude.Maybe Data.ISO8601,
    -- | [Service-managed permissions] The Organizations accounts affected by the
    -- stack operation.
    StackSetOperation -> Maybe DeploymentTargets
deploymentTargets :: Prelude.Maybe DeploymentTargets,
    -- | The time at which the stack set operation ended, across all accounts and
    -- Regions specified. Note that this doesn\'t necessarily mean that the
    -- stack set operation was successful, or even attempted, in each account
    -- or Region.
    StackSetOperation -> Maybe ISO8601
endTimestamp :: Prelude.Maybe Data.ISO8601,
    -- | The name of the IAM execution role used to create or update the stack
    -- set.
    --
    -- Use customized execution roles to control which stack resources users
    -- and groups can include in their stack sets.
    StackSetOperation -> Maybe Text
executionRoleName :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of a stack set operation.
    StackSetOperation -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
    -- | The preferences for how CloudFormation performs this stack set
    -- operation.
    StackSetOperation -> Maybe StackSetOperationPreferences
operationPreferences :: Prelude.Maybe StackSetOperationPreferences,
    -- | For stack set operations of action type @DELETE@, specifies whether to
    -- remove the stack instances from the specified stack set, but doesn\'t
    -- delete the stacks. You can\'t re-associate a retained stack, or add an
    -- existing, saved stack to a new stack set.
    StackSetOperation -> Maybe Bool
retainStacks :: Prelude.Maybe Prelude.Bool,
    -- | Detailed information about the drift status of the stack set. This
    -- includes information about drift operations currently being performed on
    -- the stack set.
    --
    -- This information will only be present for stack set operations whose
    -- @Action@ type is @DETECT_DRIFT@.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
    -- in the CloudFormation User Guide.
    StackSetOperation -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails :: Prelude.Maybe StackSetDriftDetectionDetails,
    -- | The ID of the stack set.
    StackSetOperation -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text,
    -- | The status of the operation.
    --
    -- -   @FAILED@: The operation exceeded the specified failure tolerance.
    --     The failure tolerance value that you\'ve set for an operation is
    --     applied for each Region during stack create and update operations.
    --     If the number of failed stacks within a Region exceeds the failure
    --     tolerance, the status of the operation in the Region is set to
    --     @FAILED@. This in turn sets the status of the operation as a whole
    --     to @FAILED@, and CloudFormation cancels the operation in any
    --     remaining Regions.
    --
    -- -   @QUEUED@: [Service-managed permissions] For automatic deployments
    --     that require a sequence of operations, the operation is queued to be
    --     performed. For more information, see the
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
    --     in the CloudFormation User Guide.
    --
    -- -   @RUNNING@: The operation is currently being performed.
    --
    -- -   @STOPPED@: The user has canceled the operation.
    --
    -- -   @STOPPING@: The operation is in the process of stopping, at user
    --     request.
    --
    -- -   @SUCCEEDED@: The operation completed creating or updating all the
    --     specified stacks without exceeding the failure tolerance for the
    --     operation.
    StackSetOperation -> Maybe StackSetOperationStatus
status :: Prelude.Maybe StackSetOperationStatus,
    -- | Detailed information about the StackSet operation.
    StackSetOperation -> Maybe StackSetOperationStatusDetails
statusDetails :: Prelude.Maybe StackSetOperationStatusDetails,
    -- | The status of the operation in details.
    StackSetOperation -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text
  }
  deriving (StackSetOperation -> StackSetOperation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetOperation -> StackSetOperation -> Bool
$c/= :: StackSetOperation -> StackSetOperation -> Bool
== :: StackSetOperation -> StackSetOperation -> Bool
$c== :: StackSetOperation -> StackSetOperation -> Bool
Prelude.Eq, ReadPrec [StackSetOperation]
ReadPrec StackSetOperation
Int -> ReadS StackSetOperation
ReadS [StackSetOperation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetOperation]
$creadListPrec :: ReadPrec [StackSetOperation]
readPrec :: ReadPrec StackSetOperation
$creadPrec :: ReadPrec StackSetOperation
readList :: ReadS [StackSetOperation]
$creadList :: ReadS [StackSetOperation]
readsPrec :: Int -> ReadS StackSetOperation
$creadsPrec :: Int -> ReadS StackSetOperation
Prelude.Read, Int -> StackSetOperation -> ShowS
[StackSetOperation] -> ShowS
StackSetOperation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetOperation] -> ShowS
$cshowList :: [StackSetOperation] -> ShowS
show :: StackSetOperation -> String
$cshow :: StackSetOperation -> String
showsPrec :: Int -> StackSetOperation -> ShowS
$cshowsPrec :: Int -> StackSetOperation -> ShowS
Prelude.Show, forall x. Rep StackSetOperation x -> StackSetOperation
forall x. StackSetOperation -> Rep StackSetOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackSetOperation x -> StackSetOperation
$cfrom :: forall x. StackSetOperation -> Rep StackSetOperation x
Prelude.Generic)

-- |
-- Create a value of 'StackSetOperation' 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:
--
-- 'action', 'stackSetOperation_action' - The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
-- and delete operations affect only the specified stack set instances that
-- are associated with the specified stack set. Update operations affect
-- both the stack set itself, in addition to /all/ associated stack set
-- instances.
--
-- 'administrationRoleARN', 'stackSetOperation_administrationRoleARN' - The Amazon Resource Name (ARN) of the IAM role used to perform this
-- stack set operation.
--
-- Use 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 Define Permissions for Multiple Administrators>
-- in the /CloudFormation User Guide/.
--
-- 'creationTimestamp', 'stackSetOperation_creationTimestamp' - The time at which the operation was initiated. Note that the creation
-- times for the stack set operation might differ from the creation time of
-- the individual stacks themselves. This is because CloudFormation needs
-- to perform preparatory work for the operation, such as dispatching the
-- work to the requested Regions, before actually creating the first
-- stacks.
--
-- 'deploymentTargets', 'stackSetOperation_deploymentTargets' - [Service-managed permissions] The Organizations accounts affected by the
-- stack operation.
--
-- 'endTimestamp', 'stackSetOperation_endTimestamp' - The time at which the stack set operation ended, across all accounts and
-- Regions specified. Note that this doesn\'t necessarily mean that the
-- stack set operation was successful, or even attempted, in each account
-- or Region.
--
-- 'executionRoleName', 'stackSetOperation_executionRoleName' - The name of the IAM execution role used to create or update the stack
-- set.
--
-- Use customized execution roles to control which stack resources users
-- and groups can include in their stack sets.
--
-- 'operationId', 'stackSetOperation_operationId' - The unique ID of a stack set operation.
--
-- 'operationPreferences', 'stackSetOperation_operationPreferences' - The preferences for how CloudFormation performs this stack set
-- operation.
--
-- 'retainStacks', 'stackSetOperation_retainStacks' - For stack set operations of action type @DELETE@, specifies whether to
-- remove the stack instances from the specified stack set, but doesn\'t
-- delete the stacks. You can\'t re-associate a retained stack, or add an
-- existing, saved stack to a new stack set.
--
-- 'stackSetDriftDetectionDetails', 'stackSetOperation_stackSetDriftDetectionDetails' - Detailed information about the drift status of the stack set. This
-- includes information about drift operations currently being performed on
-- the stack set.
--
-- This information will only be present for stack set operations whose
-- @Action@ type is @DETECT_DRIFT@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
-- in the CloudFormation User Guide.
--
-- 'stackSetId', 'stackSetOperation_stackSetId' - The ID of the stack set.
--
-- 'status', 'stackSetOperation_status' - The status of the operation.
--
-- -   @FAILED@: The operation exceeded the specified failure tolerance.
--     The failure tolerance value that you\'ve set for an operation is
--     applied for each Region during stack create and update operations.
--     If the number of failed stacks within a Region exceeds the failure
--     tolerance, the status of the operation in the Region is set to
--     @FAILED@. This in turn sets the status of the operation as a whole
--     to @FAILED@, and CloudFormation cancels the operation in any
--     remaining Regions.
--
-- -   @QUEUED@: [Service-managed permissions] For automatic deployments
--     that require a sequence of operations, the operation is queued to be
--     performed. For more information, see the
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
--     in the CloudFormation User Guide.
--
-- -   @RUNNING@: The operation is currently being performed.
--
-- -   @STOPPED@: The user has canceled the operation.
--
-- -   @STOPPING@: The operation is in the process of stopping, at user
--     request.
--
-- -   @SUCCEEDED@: The operation completed creating or updating all the
--     specified stacks without exceeding the failure tolerance for the
--     operation.
--
-- 'statusDetails', 'stackSetOperation_statusDetails' - Detailed information about the StackSet operation.
--
-- 'statusReason', 'stackSetOperation_statusReason' - The status of the operation in details.
newStackSetOperation ::
  StackSetOperation
newStackSetOperation :: StackSetOperation
newStackSetOperation =
  StackSetOperation'
    { $sel:action:StackSetOperation' :: Maybe StackSetOperationAction
action = forall a. Maybe a
Prelude.Nothing,
      $sel:administrationRoleARN:StackSetOperation' :: Maybe Text
administrationRoleARN = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:StackSetOperation' :: Maybe ISO8601
creationTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentTargets:StackSetOperation' :: Maybe DeploymentTargets
deploymentTargets = forall a. Maybe a
Prelude.Nothing,
      $sel:endTimestamp:StackSetOperation' :: Maybe ISO8601
endTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:executionRoleName:StackSetOperation' :: Maybe Text
executionRoleName = forall a. Maybe a
Prelude.Nothing,
      $sel:operationId:StackSetOperation' :: Maybe Text
operationId = forall a. Maybe a
Prelude.Nothing,
      $sel:operationPreferences:StackSetOperation' :: Maybe StackSetOperationPreferences
operationPreferences = forall a. Maybe a
Prelude.Nothing,
      $sel:retainStacks:StackSetOperation' :: Maybe Bool
retainStacks = forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetDriftDetectionDetails:StackSetOperation' :: Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetId:StackSetOperation' :: Maybe Text
stackSetId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:StackSetOperation' :: Maybe StackSetOperationStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:StackSetOperation' :: Maybe StackSetOperationStatusDetails
statusDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:StackSetOperation' :: Maybe Text
statusReason = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of stack set operation: @CREATE@, @UPDATE@, or @DELETE@. Create
-- and delete operations affect only the specified stack set instances that
-- are associated with the specified stack set. Update operations affect
-- both the stack set itself, in addition to /all/ associated stack set
-- instances.
stackSetOperation_action :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationAction)
stackSetOperation_action :: Lens' StackSetOperation (Maybe StackSetOperationAction)
stackSetOperation_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationAction
action :: Maybe StackSetOperationAction
$sel:action:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationAction
action} -> Maybe StackSetOperationAction
action) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationAction
a -> StackSetOperation
s {$sel:action:StackSetOperation' :: Maybe StackSetOperationAction
action = Maybe StackSetOperationAction
a} :: StackSetOperation)

-- | The Amazon Resource Name (ARN) of the IAM role used to perform this
-- stack set operation.
--
-- Use 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 Define Permissions for Multiple Administrators>
-- in the /CloudFormation User Guide/.
stackSetOperation_administrationRoleARN :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_administrationRoleARN :: Lens' StackSetOperation (Maybe Text)
stackSetOperation_administrationRoleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
administrationRoleARN :: Maybe Text
$sel:administrationRoleARN:StackSetOperation' :: StackSetOperation -> Maybe Text
administrationRoleARN} -> Maybe Text
administrationRoleARN) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:administrationRoleARN:StackSetOperation' :: Maybe Text
administrationRoleARN = Maybe Text
a} :: StackSetOperation)

-- | The time at which the operation was initiated. Note that the creation
-- times for the stack set operation might differ from the creation time of
-- the individual stacks themselves. This is because CloudFormation needs
-- to perform preparatory work for the operation, such as dispatching the
-- work to the requested Regions, before actually creating the first
-- stacks.
stackSetOperation_creationTimestamp :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.UTCTime)
stackSetOperation_creationTimestamp :: Lens' StackSetOperation (Maybe UTCTime)
stackSetOperation_creationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe ISO8601
creationTimestamp :: Maybe ISO8601
$sel:creationTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
creationTimestamp} -> Maybe ISO8601
creationTimestamp) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe ISO8601
a -> StackSetOperation
s {$sel:creationTimestamp:StackSetOperation' :: Maybe ISO8601
creationTimestamp = Maybe ISO8601
a} :: StackSetOperation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | [Service-managed permissions] The Organizations accounts affected by the
-- stack operation.
stackSetOperation_deploymentTargets :: Lens.Lens' StackSetOperation (Prelude.Maybe DeploymentTargets)
stackSetOperation_deploymentTargets :: Lens' StackSetOperation (Maybe DeploymentTargets)
stackSetOperation_deploymentTargets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe DeploymentTargets
deploymentTargets :: Maybe DeploymentTargets
$sel:deploymentTargets:StackSetOperation' :: StackSetOperation -> Maybe DeploymentTargets
deploymentTargets} -> Maybe DeploymentTargets
deploymentTargets) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe DeploymentTargets
a -> StackSetOperation
s {$sel:deploymentTargets:StackSetOperation' :: Maybe DeploymentTargets
deploymentTargets = Maybe DeploymentTargets
a} :: StackSetOperation)

-- | The time at which the stack set operation ended, across all accounts and
-- Regions specified. Note that this doesn\'t necessarily mean that the
-- stack set operation was successful, or even attempted, in each account
-- or Region.
stackSetOperation_endTimestamp :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.UTCTime)
stackSetOperation_endTimestamp :: Lens' StackSetOperation (Maybe UTCTime)
stackSetOperation_endTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe ISO8601
endTimestamp :: Maybe ISO8601
$sel:endTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
endTimestamp} -> Maybe ISO8601
endTimestamp) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe ISO8601
a -> StackSetOperation
s {$sel:endTimestamp:StackSetOperation' :: Maybe ISO8601
endTimestamp = Maybe ISO8601
a} :: StackSetOperation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the IAM execution role used to create or update the stack
-- set.
--
-- Use customized execution roles to control which stack resources users
-- and groups can include in their stack sets.
stackSetOperation_executionRoleName :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_executionRoleName :: Lens' StackSetOperation (Maybe Text)
stackSetOperation_executionRoleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
executionRoleName :: Maybe Text
$sel:executionRoleName:StackSetOperation' :: StackSetOperation -> Maybe Text
executionRoleName} -> Maybe Text
executionRoleName) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:executionRoleName:StackSetOperation' :: Maybe Text
executionRoleName = Maybe Text
a} :: StackSetOperation)

-- | The unique ID of a stack set operation.
stackSetOperation_operationId :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_operationId :: Lens' StackSetOperation (Maybe Text)
stackSetOperation_operationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
operationId :: Maybe Text
$sel:operationId:StackSetOperation' :: StackSetOperation -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:operationId:StackSetOperation' :: Maybe Text
operationId = Maybe Text
a} :: StackSetOperation)

-- | The preferences for how CloudFormation performs this stack set
-- operation.
stackSetOperation_operationPreferences :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationPreferences)
stackSetOperation_operationPreferences :: Lens' StackSetOperation (Maybe StackSetOperationPreferences)
stackSetOperation_operationPreferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationPreferences
operationPreferences :: Maybe StackSetOperationPreferences
$sel:operationPreferences:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationPreferences
operationPreferences} -> Maybe StackSetOperationPreferences
operationPreferences) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationPreferences
a -> StackSetOperation
s {$sel:operationPreferences:StackSetOperation' :: Maybe StackSetOperationPreferences
operationPreferences = Maybe StackSetOperationPreferences
a} :: StackSetOperation)

-- | For stack set operations of action type @DELETE@, specifies whether to
-- remove the stack instances from the specified stack set, but doesn\'t
-- delete the stacks. You can\'t re-associate a retained stack, or add an
-- existing, saved stack to a new stack set.
stackSetOperation_retainStacks :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Bool)
stackSetOperation_retainStacks :: Lens' StackSetOperation (Maybe Bool)
stackSetOperation_retainStacks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Bool
retainStacks :: Maybe Bool
$sel:retainStacks:StackSetOperation' :: StackSetOperation -> Maybe Bool
retainStacks} -> Maybe Bool
retainStacks) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Bool
a -> StackSetOperation
s {$sel:retainStacks:StackSetOperation' :: Maybe Bool
retainStacks = Maybe Bool
a} :: StackSetOperation)

-- | Detailed information about the drift status of the stack set. This
-- includes information about drift operations currently being performed on
-- the stack set.
--
-- This information will only be present for stack set operations whose
-- @Action@ type is @DETECT_DRIFT@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html Detecting Unmanaged Changes in Stack Sets>
-- in the CloudFormation User Guide.
stackSetOperation_stackSetDriftDetectionDetails :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetDriftDetectionDetails)
stackSetOperation_stackSetDriftDetectionDetails :: Lens' StackSetOperation (Maybe StackSetDriftDetectionDetails)
stackSetOperation_stackSetDriftDetectionDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails :: Maybe StackSetDriftDetectionDetails
$sel:stackSetDriftDetectionDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails} -> Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetDriftDetectionDetails
a -> StackSetOperation
s {$sel:stackSetDriftDetectionDetails:StackSetOperation' :: Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails = Maybe StackSetDriftDetectionDetails
a} :: StackSetOperation)

-- | The ID of the stack set.
stackSetOperation_stackSetId :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_stackSetId :: Lens' StackSetOperation (Maybe Text)
stackSetOperation_stackSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
stackSetId :: Maybe Text
$sel:stackSetId:StackSetOperation' :: StackSetOperation -> Maybe Text
stackSetId} -> Maybe Text
stackSetId) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:stackSetId:StackSetOperation' :: Maybe Text
stackSetId = Maybe Text
a} :: StackSetOperation)

-- | The status of the operation.
--
-- -   @FAILED@: The operation exceeded the specified failure tolerance.
--     The failure tolerance value that you\'ve set for an operation is
--     applied for each Region during stack create and update operations.
--     If the number of failed stacks within a Region exceeds the failure
--     tolerance, the status of the operation in the Region is set to
--     @FAILED@. This in turn sets the status of the operation as a whole
--     to @FAILED@, and CloudFormation cancels the operation in any
--     remaining Regions.
--
-- -   @QUEUED@: [Service-managed permissions] For automatic deployments
--     that require a sequence of operations, the operation is queued to be
--     performed. For more information, see the
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes stack set operation status codes>
--     in the CloudFormation User Guide.
--
-- -   @RUNNING@: The operation is currently being performed.
--
-- -   @STOPPED@: The user has canceled the operation.
--
-- -   @STOPPING@: The operation is in the process of stopping, at user
--     request.
--
-- -   @SUCCEEDED@: The operation completed creating or updating all the
--     specified stacks without exceeding the failure tolerance for the
--     operation.
stackSetOperation_status :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationStatus)
stackSetOperation_status :: Lens' StackSetOperation (Maybe StackSetOperationStatus)
stackSetOperation_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationStatus
status :: Maybe StackSetOperationStatus
$sel:status:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatus
status} -> Maybe StackSetOperationStatus
status) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationStatus
a -> StackSetOperation
s {$sel:status:StackSetOperation' :: Maybe StackSetOperationStatus
status = Maybe StackSetOperationStatus
a} :: StackSetOperation)

-- | Detailed information about the StackSet operation.
stackSetOperation_statusDetails :: Lens.Lens' StackSetOperation (Prelude.Maybe StackSetOperationStatusDetails)
stackSetOperation_statusDetails :: Lens' StackSetOperation (Maybe StackSetOperationStatusDetails)
stackSetOperation_statusDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe StackSetOperationStatusDetails
statusDetails :: Maybe StackSetOperationStatusDetails
$sel:statusDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatusDetails
statusDetails} -> Maybe StackSetOperationStatusDetails
statusDetails) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe StackSetOperationStatusDetails
a -> StackSetOperation
s {$sel:statusDetails:StackSetOperation' :: Maybe StackSetOperationStatusDetails
statusDetails = Maybe StackSetOperationStatusDetails
a} :: StackSetOperation)

-- | The status of the operation in details.
stackSetOperation_statusReason :: Lens.Lens' StackSetOperation (Prelude.Maybe Prelude.Text)
stackSetOperation_statusReason :: Lens' StackSetOperation (Maybe Text)
stackSetOperation_statusReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperation' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:StackSetOperation' :: StackSetOperation -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: StackSetOperation
s@StackSetOperation' {} Maybe Text
a -> StackSetOperation
s {$sel:statusReason:StackSetOperation' :: Maybe Text
statusReason = Maybe Text
a} :: StackSetOperation)

instance Data.FromXML StackSetOperation where
  parseXML :: [Node] -> Either String StackSetOperation
parseXML [Node]
x =
    Maybe StackSetOperationAction
-> Maybe Text
-> Maybe ISO8601
-> Maybe DeploymentTargets
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe StackSetOperationPreferences
-> Maybe Bool
-> Maybe StackSetDriftDetectionDetails
-> Maybe Text
-> Maybe StackSetOperationStatus
-> Maybe StackSetOperationStatusDetails
-> Maybe Text
-> StackSetOperation
StackSetOperation'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Action")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AdministrationRoleARN")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CreationTimestamp")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DeploymentTargets")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EndTimestamp")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ExecutionRoleName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"OperationId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"OperationPreferences")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RetainStacks")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackSetDriftDetectionDetails")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackSetId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Status")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StatusDetails")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StatusReason")

instance Prelude.Hashable StackSetOperation where
  hashWithSalt :: Int -> StackSetOperation -> Int
hashWithSalt Int
_salt StackSetOperation' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe DeploymentTargets
Maybe StackSetDriftDetectionDetails
Maybe StackSetOperationAction
Maybe StackSetOperationPreferences
Maybe StackSetOperationStatus
Maybe StackSetOperationStatusDetails
statusReason :: Maybe Text
statusDetails :: Maybe StackSetOperationStatusDetails
status :: Maybe StackSetOperationStatus
stackSetId :: Maybe Text
stackSetDriftDetectionDetails :: Maybe StackSetDriftDetectionDetails
retainStacks :: Maybe Bool
operationPreferences :: Maybe StackSetOperationPreferences
operationId :: Maybe Text
executionRoleName :: Maybe Text
endTimestamp :: Maybe ISO8601
deploymentTargets :: Maybe DeploymentTargets
creationTimestamp :: Maybe ISO8601
administrationRoleARN :: Maybe Text
action :: Maybe StackSetOperationAction
$sel:statusReason:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:statusDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatusDetails
$sel:status:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatus
$sel:stackSetId:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:stackSetDriftDetectionDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetDriftDetectionDetails
$sel:retainStacks:StackSetOperation' :: StackSetOperation -> Maybe Bool
$sel:operationPreferences:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationPreferences
$sel:operationId:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:executionRoleName:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:endTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
$sel:deploymentTargets:StackSetOperation' :: StackSetOperation -> Maybe DeploymentTargets
$sel:creationTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
$sel:administrationRoleARN:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:action:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationAction
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationAction
action
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
administrationRoleARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentTargets
deploymentTargets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionRoleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
operationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationPreferences
operationPreferences
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
retainStacks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackSetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetOperationStatusDetails
statusDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusReason

instance Prelude.NFData StackSetOperation where
  rnf :: StackSetOperation -> ()
rnf StackSetOperation' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe DeploymentTargets
Maybe StackSetDriftDetectionDetails
Maybe StackSetOperationAction
Maybe StackSetOperationPreferences
Maybe StackSetOperationStatus
Maybe StackSetOperationStatusDetails
statusReason :: Maybe Text
statusDetails :: Maybe StackSetOperationStatusDetails
status :: Maybe StackSetOperationStatus
stackSetId :: Maybe Text
stackSetDriftDetectionDetails :: Maybe StackSetDriftDetectionDetails
retainStacks :: Maybe Bool
operationPreferences :: Maybe StackSetOperationPreferences
operationId :: Maybe Text
executionRoleName :: Maybe Text
endTimestamp :: Maybe ISO8601
deploymentTargets :: Maybe DeploymentTargets
creationTimestamp :: Maybe ISO8601
administrationRoleARN :: Maybe Text
action :: Maybe StackSetOperationAction
$sel:statusReason:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:statusDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatusDetails
$sel:status:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationStatus
$sel:stackSetId:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:stackSetDriftDetectionDetails:StackSetOperation' :: StackSetOperation -> Maybe StackSetDriftDetectionDetails
$sel:retainStacks:StackSetOperation' :: StackSetOperation -> Maybe Bool
$sel:operationPreferences:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationPreferences
$sel:operationId:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:executionRoleName:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:endTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
$sel:deploymentTargets:StackSetOperation' :: StackSetOperation -> Maybe DeploymentTargets
$sel:creationTimestamp:StackSetOperation' :: StackSetOperation -> Maybe ISO8601
$sel:administrationRoleARN:StackSetOperation' :: StackSetOperation -> Maybe Text
$sel:action:StackSetOperation' :: StackSetOperation -> Maybe StackSetOperationAction
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationAction
action
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
administrationRoleARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentTargets
deploymentTargets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionRoleName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationPreferences
operationPreferences
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
retainStacks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetDriftDetectionDetails
stackSetDriftDetectionDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackSetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackSetOperationStatusDetails
statusDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusReason