{-# 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.StackSetDriftDetectionDetails
-- 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)
module Amazonka.CloudFormation.Types.StackSetDriftDetectionDetails where

import Amazonka.CloudFormation.Types.StackSetDriftDetectionStatus
import Amazonka.CloudFormation.Types.StackSetDriftStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Detailed information about the drift status of the stack set.
--
-- For stack sets, contains information about the last /completed/ drift
-- operation performed on the stack set. Information about drift operations
-- in-progress is not included.
--
-- For stack set operations, includes information about drift operations
-- currently being performed on the stack set.
--
-- 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/.
--
-- /See:/ 'newStackSetDriftDetectionDetails' smart constructor.
data StackSetDriftDetectionDetails = StackSetDriftDetectionDetails'
  { -- | Most recent time when CloudFormation performed a drift detection
    -- operation on the stack set. This value will be @NULL@ for any stack set
    -- on which drift detection has not yet been performed.
    StackSetDriftDetectionDetails -> Maybe ISO8601
lastDriftCheckTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | The total number of stack instances belonging to this stack set.
    --
    -- The total number of stack instances is equal to the total of:
    --
    -- -   Stack instances that match the stack set configuration.
    --
    -- -   Stack instances that have drifted from the stack set configuration.
    --
    -- -   Stack instances where the drift detection operation has failed.
    --
    -- -   Stack instances currently being checked for drift.
    StackSetDriftDetectionDetails -> Maybe Natural
totalStackInstancesCount :: Prelude.Maybe Prelude.Natural,
    -- | The number of stack instances that are currently being checked for
    -- drift.
    StackSetDriftDetectionDetails -> Maybe Natural
inProgressStackInstancesCount :: Prelude.Maybe Prelude.Natural,
    -- | The number of stack instances that have drifted from the expected
    -- template and parameter configuration of the stack set. A stack instance
    -- is considered to have drifted if one or more of the resources in the
    -- associated stack do not match their expected configuration.
    StackSetDriftDetectionDetails -> Maybe Natural
driftedStackInstancesCount :: Prelude.Maybe Prelude.Natural,
    -- | The status of the stack set drift detection operation.
    --
    -- -   @COMPLETED@: The drift detection operation completed without failing
    --     on any stack instances.
    --
    -- -   @FAILED@: The drift detection operation exceeded the specified
    --     failure tolerance.
    --
    -- -   @PARTIAL_SUCCESS@: The drift detection operation completed without
    --     exceeding the failure tolerance for the operation.
    --
    -- -   @IN_PROGRESS@: The drift detection operation is currently being
    --     performed.
    --
    -- -   @STOPPED@: The user has cancelled the drift detection operation.
    StackSetDriftDetectionDetails -> Maybe StackSetDriftDetectionStatus
driftDetectionStatus :: Prelude.Maybe StackSetDriftDetectionStatus,
    -- | Status of the stack set\'s actual configuration compared to its expected
    -- template and parameter configuration. A stack set is considered to have
    -- drifted if one or more of its stack instances have drifted from their
    -- expected template and parameter configuration.
    --
    -- -   @DRIFTED@: One or more of the stack instances belonging to the stack
    --     set stack differs from the expected template and parameter
    --     configuration. A stack instance is considered to have drifted if one
    --     or more of the resources in the associated stack have drifted.
    --
    -- -   @NOT_CHECKED@: CloudFormation has not checked the stack set for
    --     drift.
    --
    -- -   @IN_SYNC@: All of the stack instances belonging to the stack set
    --     stack match from the expected template and parameter configuration.
    StackSetDriftDetectionDetails -> Maybe StackSetDriftStatus
driftStatus :: Prelude.Maybe StackSetDriftStatus,
    -- | The number of stack instances for which the drift detection operation
    -- failed.
    StackSetDriftDetectionDetails -> Maybe Natural
failedStackInstancesCount :: Prelude.Maybe Prelude.Natural,
    -- | The number of stack instances which match the expected template and
    -- parameter configuration of the stack set.
    StackSetDriftDetectionDetails -> Maybe Natural
inSyncStackInstancesCount :: Prelude.Maybe Prelude.Natural
  }
  deriving (StackSetDriftDetectionDetails
-> StackSetDriftDetectionDetails -> Bool
(StackSetDriftDetectionDetails
 -> StackSetDriftDetectionDetails -> Bool)
-> (StackSetDriftDetectionDetails
    -> StackSetDriftDetectionDetails -> Bool)
-> Eq StackSetDriftDetectionDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetDriftDetectionDetails
-> StackSetDriftDetectionDetails -> Bool
$c/= :: StackSetDriftDetectionDetails
-> StackSetDriftDetectionDetails -> Bool
== :: StackSetDriftDetectionDetails
-> StackSetDriftDetectionDetails -> Bool
$c== :: StackSetDriftDetectionDetails
-> StackSetDriftDetectionDetails -> Bool
Prelude.Eq, ReadPrec [StackSetDriftDetectionDetails]
ReadPrec StackSetDriftDetectionDetails
Int -> ReadS StackSetDriftDetectionDetails
ReadS [StackSetDriftDetectionDetails]
(Int -> ReadS StackSetDriftDetectionDetails)
-> ReadS [StackSetDriftDetectionDetails]
-> ReadPrec StackSetDriftDetectionDetails
-> ReadPrec [StackSetDriftDetectionDetails]
-> Read StackSetDriftDetectionDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetDriftDetectionDetails]
$creadListPrec :: ReadPrec [StackSetDriftDetectionDetails]
readPrec :: ReadPrec StackSetDriftDetectionDetails
$creadPrec :: ReadPrec StackSetDriftDetectionDetails
readList :: ReadS [StackSetDriftDetectionDetails]
$creadList :: ReadS [StackSetDriftDetectionDetails]
readsPrec :: Int -> ReadS StackSetDriftDetectionDetails
$creadsPrec :: Int -> ReadS StackSetDriftDetectionDetails
Prelude.Read, Int -> StackSetDriftDetectionDetails -> ShowS
[StackSetDriftDetectionDetails] -> ShowS
StackSetDriftDetectionDetails -> String
(Int -> StackSetDriftDetectionDetails -> ShowS)
-> (StackSetDriftDetectionDetails -> String)
-> ([StackSetDriftDetectionDetails] -> ShowS)
-> Show StackSetDriftDetectionDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetDriftDetectionDetails] -> ShowS
$cshowList :: [StackSetDriftDetectionDetails] -> ShowS
show :: StackSetDriftDetectionDetails -> String
$cshow :: StackSetDriftDetectionDetails -> String
showsPrec :: Int -> StackSetDriftDetectionDetails -> ShowS
$cshowsPrec :: Int -> StackSetDriftDetectionDetails -> ShowS
Prelude.Show, (forall x.
 StackSetDriftDetectionDetails
 -> Rep StackSetDriftDetectionDetails x)
-> (forall x.
    Rep StackSetDriftDetectionDetails x
    -> StackSetDriftDetectionDetails)
-> Generic StackSetDriftDetectionDetails
forall x.
Rep StackSetDriftDetectionDetails x
-> StackSetDriftDetectionDetails
forall x.
StackSetDriftDetectionDetails
-> Rep StackSetDriftDetectionDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackSetDriftDetectionDetails x
-> StackSetDriftDetectionDetails
$cfrom :: forall x.
StackSetDriftDetectionDetails
-> Rep StackSetDriftDetectionDetails x
Prelude.Generic)

-- |
-- Create a value of 'StackSetDriftDetectionDetails' 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:
--
-- 'lastDriftCheckTimestamp', 'stackSetDriftDetectionDetails_lastDriftCheckTimestamp' - Most recent time when CloudFormation performed a drift detection
-- operation on the stack set. This value will be @NULL@ for any stack set
-- on which drift detection has not yet been performed.
--
-- 'totalStackInstancesCount', 'stackSetDriftDetectionDetails_totalStackInstancesCount' - The total number of stack instances belonging to this stack set.
--
-- The total number of stack instances is equal to the total of:
--
-- -   Stack instances that match the stack set configuration.
--
-- -   Stack instances that have drifted from the stack set configuration.
--
-- -   Stack instances where the drift detection operation has failed.
--
-- -   Stack instances currently being checked for drift.
--
-- 'inProgressStackInstancesCount', 'stackSetDriftDetectionDetails_inProgressStackInstancesCount' - The number of stack instances that are currently being checked for
-- drift.
--
-- 'driftedStackInstancesCount', 'stackSetDriftDetectionDetails_driftedStackInstancesCount' - The number of stack instances that have drifted from the expected
-- template and parameter configuration of the stack set. A stack instance
-- is considered to have drifted if one or more of the resources in the
-- associated stack do not match their expected configuration.
--
-- 'driftDetectionStatus', 'stackSetDriftDetectionDetails_driftDetectionStatus' - The status of the stack set drift detection operation.
--
-- -   @COMPLETED@: The drift detection operation completed without failing
--     on any stack instances.
--
-- -   @FAILED@: The drift detection operation exceeded the specified
--     failure tolerance.
--
-- -   @PARTIAL_SUCCESS@: The drift detection operation completed without
--     exceeding the failure tolerance for the operation.
--
-- -   @IN_PROGRESS@: The drift detection operation is currently being
--     performed.
--
-- -   @STOPPED@: The user has cancelled the drift detection operation.
--
-- 'driftStatus', 'stackSetDriftDetectionDetails_driftStatus' - Status of the stack set\'s actual configuration compared to its expected
-- template and parameter configuration. A stack set is considered to have
-- drifted if one or more of its stack instances have drifted from their
-- expected template and parameter configuration.
--
-- -   @DRIFTED@: One or more of the stack instances belonging to the stack
--     set stack differs from the expected template and parameter
--     configuration. A stack instance is considered to have drifted if one
--     or more of the resources in the associated stack have drifted.
--
-- -   @NOT_CHECKED@: CloudFormation has not checked the stack set for
--     drift.
--
-- -   @IN_SYNC@: All of the stack instances belonging to the stack set
--     stack match from the expected template and parameter configuration.
--
-- 'failedStackInstancesCount', 'stackSetDriftDetectionDetails_failedStackInstancesCount' - The number of stack instances for which the drift detection operation
-- failed.
--
-- 'inSyncStackInstancesCount', 'stackSetDriftDetectionDetails_inSyncStackInstancesCount' - The number of stack instances which match the expected template and
-- parameter configuration of the stack set.
newStackSetDriftDetectionDetails ::
  StackSetDriftDetectionDetails
newStackSetDriftDetectionDetails :: StackSetDriftDetectionDetails
newStackSetDriftDetectionDetails =
  StackSetDriftDetectionDetails' :: Maybe ISO8601
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe StackSetDriftDetectionStatus
-> Maybe StackSetDriftStatus
-> Maybe Natural
-> Maybe Natural
-> StackSetDriftDetectionDetails
StackSetDriftDetectionDetails'
    { $sel:lastDriftCheckTimestamp:StackSetDriftDetectionDetails' :: Maybe ISO8601
lastDriftCheckTimestamp =
        Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:totalStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
totalStackInstancesCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:inProgressStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
inProgressStackInstancesCount =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:driftedStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
driftedStackInstancesCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:driftDetectionStatus:StackSetDriftDetectionDetails' :: Maybe StackSetDriftDetectionStatus
driftDetectionStatus = Maybe StackSetDriftDetectionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:driftStatus:StackSetDriftDetectionDetails' :: Maybe StackSetDriftStatus
driftStatus = Maybe StackSetDriftStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:failedStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
failedStackInstancesCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:inSyncStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
inSyncStackInstancesCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Most recent time when CloudFormation performed a drift detection
-- operation on the stack set. This value will be @NULL@ for any stack set
-- on which drift detection has not yet been performed.
stackSetDriftDetectionDetails_lastDriftCheckTimestamp :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.UTCTime)
stackSetDriftDetectionDetails_lastDriftCheckTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_lastDriftCheckTimestamp = (StackSetDriftDetectionDetails -> Maybe ISO8601)
-> (StackSetDriftDetectionDetails
    -> Maybe ISO8601 -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe ISO8601
lastDriftCheckTimestamp :: Maybe ISO8601
$sel:lastDriftCheckTimestamp:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe ISO8601
lastDriftCheckTimestamp} -> Maybe ISO8601
lastDriftCheckTimestamp) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe ISO8601
a -> StackSetDriftDetectionDetails
s {$sel:lastDriftCheckTimestamp:StackSetDriftDetectionDetails' :: Maybe ISO8601
lastDriftCheckTimestamp = Maybe ISO8601
a} :: StackSetDriftDetectionDetails) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> StackSetDriftDetectionDetails
 -> f StackSetDriftDetectionDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StackSetDriftDetectionDetails
-> f StackSetDriftDetectionDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The total number of stack instances belonging to this stack set.
--
-- The total number of stack instances is equal to the total of:
--
-- -   Stack instances that match the stack set configuration.
--
-- -   Stack instances that have drifted from the stack set configuration.
--
-- -   Stack instances where the drift detection operation has failed.
--
-- -   Stack instances currently being checked for drift.
stackSetDriftDetectionDetails_totalStackInstancesCount :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.Natural)
stackSetDriftDetectionDetails_totalStackInstancesCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_totalStackInstancesCount = (StackSetDriftDetectionDetails -> Maybe Natural)
-> (StackSetDriftDetectionDetails
    -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe Natural
totalStackInstancesCount :: Maybe Natural
$sel:totalStackInstancesCount:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe Natural
totalStackInstancesCount} -> Maybe Natural
totalStackInstancesCount) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe Natural
a -> StackSetDriftDetectionDetails
s {$sel:totalStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
totalStackInstancesCount = Maybe Natural
a} :: StackSetDriftDetectionDetails)

-- | The number of stack instances that are currently being checked for
-- drift.
stackSetDriftDetectionDetails_inProgressStackInstancesCount :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.Natural)
stackSetDriftDetectionDetails_inProgressStackInstancesCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_inProgressStackInstancesCount = (StackSetDriftDetectionDetails -> Maybe Natural)
-> (StackSetDriftDetectionDetails
    -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe Natural
inProgressStackInstancesCount :: Maybe Natural
$sel:inProgressStackInstancesCount:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe Natural
inProgressStackInstancesCount} -> Maybe Natural
inProgressStackInstancesCount) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe Natural
a -> StackSetDriftDetectionDetails
s {$sel:inProgressStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
inProgressStackInstancesCount = Maybe Natural
a} :: StackSetDriftDetectionDetails)

-- | The number of stack instances that have drifted from the expected
-- template and parameter configuration of the stack set. A stack instance
-- is considered to have drifted if one or more of the resources in the
-- associated stack do not match their expected configuration.
stackSetDriftDetectionDetails_driftedStackInstancesCount :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.Natural)
stackSetDriftDetectionDetails_driftedStackInstancesCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_driftedStackInstancesCount = (StackSetDriftDetectionDetails -> Maybe Natural)
-> (StackSetDriftDetectionDetails
    -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe Natural
driftedStackInstancesCount :: Maybe Natural
$sel:driftedStackInstancesCount:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe Natural
driftedStackInstancesCount} -> Maybe Natural
driftedStackInstancesCount) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe Natural
a -> StackSetDriftDetectionDetails
s {$sel:driftedStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
driftedStackInstancesCount = Maybe Natural
a} :: StackSetDriftDetectionDetails)

-- | The status of the stack set drift detection operation.
--
-- -   @COMPLETED@: The drift detection operation completed without failing
--     on any stack instances.
--
-- -   @FAILED@: The drift detection operation exceeded the specified
--     failure tolerance.
--
-- -   @PARTIAL_SUCCESS@: The drift detection operation completed without
--     exceeding the failure tolerance for the operation.
--
-- -   @IN_PROGRESS@: The drift detection operation is currently being
--     performed.
--
-- -   @STOPPED@: The user has cancelled the drift detection operation.
stackSetDriftDetectionDetails_driftDetectionStatus :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe StackSetDriftDetectionStatus)
stackSetDriftDetectionDetails_driftDetectionStatus :: (Maybe StackSetDriftDetectionStatus
 -> f (Maybe StackSetDriftDetectionStatus))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_driftDetectionStatus = (StackSetDriftDetectionDetails
 -> Maybe StackSetDriftDetectionStatus)
-> (StackSetDriftDetectionDetails
    -> Maybe StackSetDriftDetectionStatus
    -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe StackSetDriftDetectionStatus)
     (Maybe StackSetDriftDetectionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe StackSetDriftDetectionStatus
driftDetectionStatus :: Maybe StackSetDriftDetectionStatus
$sel:driftDetectionStatus:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe StackSetDriftDetectionStatus
driftDetectionStatus} -> Maybe StackSetDriftDetectionStatus
driftDetectionStatus) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe StackSetDriftDetectionStatus
a -> StackSetDriftDetectionDetails
s {$sel:driftDetectionStatus:StackSetDriftDetectionDetails' :: Maybe StackSetDriftDetectionStatus
driftDetectionStatus = Maybe StackSetDriftDetectionStatus
a} :: StackSetDriftDetectionDetails)

-- | Status of the stack set\'s actual configuration compared to its expected
-- template and parameter configuration. A stack set is considered to have
-- drifted if one or more of its stack instances have drifted from their
-- expected template and parameter configuration.
--
-- -   @DRIFTED@: One or more of the stack instances belonging to the stack
--     set stack differs from the expected template and parameter
--     configuration. A stack instance is considered to have drifted if one
--     or more of the resources in the associated stack have drifted.
--
-- -   @NOT_CHECKED@: CloudFormation has not checked the stack set for
--     drift.
--
-- -   @IN_SYNC@: All of the stack instances belonging to the stack set
--     stack match from the expected template and parameter configuration.
stackSetDriftDetectionDetails_driftStatus :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe StackSetDriftStatus)
stackSetDriftDetectionDetails_driftStatus :: (Maybe StackSetDriftStatus -> f (Maybe StackSetDriftStatus))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_driftStatus = (StackSetDriftDetectionDetails -> Maybe StackSetDriftStatus)
-> (StackSetDriftDetectionDetails
    -> Maybe StackSetDriftStatus -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe StackSetDriftStatus)
     (Maybe StackSetDriftStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe StackSetDriftStatus
driftStatus :: Maybe StackSetDriftStatus
$sel:driftStatus:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe StackSetDriftStatus
driftStatus} -> Maybe StackSetDriftStatus
driftStatus) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe StackSetDriftStatus
a -> StackSetDriftDetectionDetails
s {$sel:driftStatus:StackSetDriftDetectionDetails' :: Maybe StackSetDriftStatus
driftStatus = Maybe StackSetDriftStatus
a} :: StackSetDriftDetectionDetails)

-- | The number of stack instances for which the drift detection operation
-- failed.
stackSetDriftDetectionDetails_failedStackInstancesCount :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.Natural)
stackSetDriftDetectionDetails_failedStackInstancesCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_failedStackInstancesCount = (StackSetDriftDetectionDetails -> Maybe Natural)
-> (StackSetDriftDetectionDetails
    -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe Natural
failedStackInstancesCount :: Maybe Natural
$sel:failedStackInstancesCount:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe Natural
failedStackInstancesCount} -> Maybe Natural
failedStackInstancesCount) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe Natural
a -> StackSetDriftDetectionDetails
s {$sel:failedStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
failedStackInstancesCount = Maybe Natural
a} :: StackSetDriftDetectionDetails)

-- | The number of stack instances which match the expected template and
-- parameter configuration of the stack set.
stackSetDriftDetectionDetails_inSyncStackInstancesCount :: Lens.Lens' StackSetDriftDetectionDetails (Prelude.Maybe Prelude.Natural)
stackSetDriftDetectionDetails_inSyncStackInstancesCount :: (Maybe Natural -> f (Maybe Natural))
-> StackSetDriftDetectionDetails -> f StackSetDriftDetectionDetails
stackSetDriftDetectionDetails_inSyncStackInstancesCount = (StackSetDriftDetectionDetails -> Maybe Natural)
-> (StackSetDriftDetectionDetails
    -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Lens
     StackSetDriftDetectionDetails
     StackSetDriftDetectionDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetDriftDetectionDetails' {Maybe Natural
inSyncStackInstancesCount :: Maybe Natural
$sel:inSyncStackInstancesCount:StackSetDriftDetectionDetails' :: StackSetDriftDetectionDetails -> Maybe Natural
inSyncStackInstancesCount} -> Maybe Natural
inSyncStackInstancesCount) (\s :: StackSetDriftDetectionDetails
s@StackSetDriftDetectionDetails' {} Maybe Natural
a -> StackSetDriftDetectionDetails
s {$sel:inSyncStackInstancesCount:StackSetDriftDetectionDetails' :: Maybe Natural
inSyncStackInstancesCount = Maybe Natural
a} :: StackSetDriftDetectionDetails)

instance Core.FromXML StackSetDriftDetectionDetails where
  parseXML :: [Node] -> Either String StackSetDriftDetectionDetails
parseXML [Node]
x =
    Maybe ISO8601
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe StackSetDriftDetectionStatus
-> Maybe StackSetDriftStatus
-> Maybe Natural
-> Maybe Natural
-> StackSetDriftDetectionDetails
StackSetDriftDetectionDetails'
      (Maybe ISO8601
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe StackSetDriftDetectionStatus
 -> Maybe StackSetDriftStatus
 -> Maybe Natural
 -> Maybe Natural
 -> StackSetDriftDetectionDetails)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe StackSetDriftDetectionStatus
      -> Maybe StackSetDriftStatus
      -> Maybe Natural
      -> Maybe Natural
      -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastDriftCheckTimestamp")
      Either
  String
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe StackSetDriftDetectionStatus
   -> Maybe StackSetDriftStatus
   -> Maybe Natural
   -> Maybe Natural
   -> StackSetDriftDetectionDetails)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Natural
      -> Maybe Natural
      -> Maybe StackSetDriftDetectionStatus
      -> Maybe StackSetDriftStatus
      -> Maybe Natural
      -> Maybe Natural
      -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TotalStackInstancesCount")
      Either
  String
  (Maybe Natural
   -> Maybe Natural
   -> Maybe StackSetDriftDetectionStatus
   -> Maybe StackSetDriftStatus
   -> Maybe Natural
   -> Maybe Natural
   -> StackSetDriftDetectionDetails)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Natural
      -> Maybe StackSetDriftDetectionStatus
      -> Maybe StackSetDriftStatus
      -> Maybe Natural
      -> Maybe Natural
      -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InProgressStackInstancesCount")
      Either
  String
  (Maybe Natural
   -> Maybe StackSetDriftDetectionStatus
   -> Maybe StackSetDriftStatus
   -> Maybe Natural
   -> Maybe Natural
   -> StackSetDriftDetectionDetails)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe StackSetDriftDetectionStatus
      -> Maybe StackSetDriftStatus
      -> Maybe Natural
      -> Maybe Natural
      -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftedStackInstancesCount")
      Either
  String
  (Maybe StackSetDriftDetectionStatus
   -> Maybe StackSetDriftStatus
   -> Maybe Natural
   -> Maybe Natural
   -> StackSetDriftDetectionDetails)
-> Either String (Maybe StackSetDriftDetectionStatus)
-> Either
     String
     (Maybe StackSetDriftStatus
      -> Maybe Natural -> Maybe Natural -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe StackSetDriftDetectionStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftDetectionStatus")
      Either
  String
  (Maybe StackSetDriftStatus
   -> Maybe Natural -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Either String (Maybe StackSetDriftStatus)
-> Either
     String
     (Maybe Natural -> Maybe Natural -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StackSetDriftStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftStatus")
      Either
  String
  (Maybe Natural -> Maybe Natural -> StackSetDriftDetectionDetails)
-> Either String (Maybe Natural)
-> Either String (Maybe Natural -> StackSetDriftDetectionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailedStackInstancesCount")
      Either String (Maybe Natural -> StackSetDriftDetectionDetails)
-> Either String (Maybe Natural)
-> Either String StackSetDriftDetectionDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InSyncStackInstancesCount")

instance
  Prelude.Hashable
    StackSetDriftDetectionDetails

instance Prelude.NFData StackSetDriftDetectionDetails