{-# 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.StackInstance
-- 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.StackInstance where

import Amazonka.CloudFormation.Types.Parameter
import Amazonka.CloudFormation.Types.StackDriftStatus
import Amazonka.CloudFormation.Types.StackInstanceComprehensiveStatus
import Amazonka.CloudFormation.Types.StackInstanceStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An CloudFormation stack, in a specific account and Region, that\'s part
-- of a stack set operation. A stack instance is a reference to an
-- attempted or actual stack in a given account within a given Region. A
-- stack instance can exist without a stack—for example, if the stack
-- couldn\'t be created for some reason. A stack instance is associated
-- with only one stack set. Each stack instance contains the ID of its
-- associated stack set, as well as the ID of the actual stack and the
-- stack status.
--
-- /See:/ 'newStackInstance' smart constructor.
data StackInstance = StackInstance'
  { -- | The status of the stack instance, in terms of its synchronization with
    -- its associated stack set.
    --
    -- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
    --     the stack in an unstable state. Stacks in this state are excluded
    --     from further @UpdateStackSet@ operations. You might need to perform
    --     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
    --     @true@, to delete the stack instance, and then delete the stack
    --     manually.
    --
    -- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
    --     because:
    --
    --     -   The associated stack failed during a @CreateStackSet@ or
    --         @UpdateStackSet@ operation.
    --
    --     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
    --         operation that failed or was stopped before the stack was
    --         created or updated.
    --
    -- -   @CURRENT@: The stack is currently up to date with the stack set.
    StackInstance -> Maybe StackInstanceStatus
status :: Prelude.Maybe StackInstanceStatus,
    -- | Most recent time when CloudFormation performed a drift detection
    -- operation on the stack instance. This value will be @NULL@ for any stack
    -- instance on which drift detection has not yet been performed.
    StackInstance -> Maybe ISO8601
lastDriftCheckTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | [Self-managed permissions] The name of the Amazon Web Services account
    -- that the stack instance is associated with.
    StackInstance -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
    -- | Status of the stack instance\'s actual configuration compared to the
    -- expected template and parameter configuration of the stack set to which
    -- it belongs.
    --
    -- -   @DRIFTED@: The stack differs from the expected template and
    --     parameter configuration of the stack set to which it belongs. 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 if the stack instance
    --     differs from its expected stack set configuration.
    --
    -- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
    --     expected stack set configuration.
    --
    -- -   @UNKNOWN@: This value is reserved for future use.
    StackInstance -> Maybe StackDriftStatus
driftStatus :: Prelude.Maybe StackDriftStatus,
    -- | [Service-managed permissions] The organization root ID or organizational
    -- unit (OU) IDs that you specified for
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
    StackInstance -> Maybe Text
organizationalUnitId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Web Services Region that the stack instance is
    -- associated with.
    StackInstance -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The explanation for the specific status code that is assigned to this
    -- stack instance.
    StackInstance -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The ID of the stack instance.
    StackInstance -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | The detailed status of the stack instance.
    StackInstance -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus :: Prelude.Maybe StackInstanceComprehensiveStatus,
    -- | A list of parameters from the stack set template whose values have been
    -- overridden in this stack instance.
    StackInstance -> Maybe [Parameter]
parameterOverrides :: Prelude.Maybe [Parameter],
    -- | The name or unique ID of the stack set that the stack instance is
    -- associated with.
    StackInstance -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text
  }
  deriving (StackInstance -> StackInstance -> Bool
(StackInstance -> StackInstance -> Bool)
-> (StackInstance -> StackInstance -> Bool) -> Eq StackInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackInstance -> StackInstance -> Bool
$c/= :: StackInstance -> StackInstance -> Bool
== :: StackInstance -> StackInstance -> Bool
$c== :: StackInstance -> StackInstance -> Bool
Prelude.Eq, ReadPrec [StackInstance]
ReadPrec StackInstance
Int -> ReadS StackInstance
ReadS [StackInstance]
(Int -> ReadS StackInstance)
-> ReadS [StackInstance]
-> ReadPrec StackInstance
-> ReadPrec [StackInstance]
-> Read StackInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackInstance]
$creadListPrec :: ReadPrec [StackInstance]
readPrec :: ReadPrec StackInstance
$creadPrec :: ReadPrec StackInstance
readList :: ReadS [StackInstance]
$creadList :: ReadS [StackInstance]
readsPrec :: Int -> ReadS StackInstance
$creadsPrec :: Int -> ReadS StackInstance
Prelude.Read, Int -> StackInstance -> ShowS
[StackInstance] -> ShowS
StackInstance -> String
(Int -> StackInstance -> ShowS)
-> (StackInstance -> String)
-> ([StackInstance] -> ShowS)
-> Show StackInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackInstance] -> ShowS
$cshowList :: [StackInstance] -> ShowS
show :: StackInstance -> String
$cshow :: StackInstance -> String
showsPrec :: Int -> StackInstance -> ShowS
$cshowsPrec :: Int -> StackInstance -> ShowS
Prelude.Show, (forall x. StackInstance -> Rep StackInstance x)
-> (forall x. Rep StackInstance x -> StackInstance)
-> Generic StackInstance
forall x. Rep StackInstance x -> StackInstance
forall x. StackInstance -> Rep StackInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackInstance x -> StackInstance
$cfrom :: forall x. StackInstance -> Rep StackInstance x
Prelude.Generic)

-- |
-- Create a value of 'StackInstance' 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:
--
-- 'status', 'stackInstance_status' - The status of the stack instance, in terms of its synchronization with
-- its associated stack set.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
--     because:
--
--     -   The associated stack failed during a @CreateStackSet@ or
--         @UpdateStackSet@ operation.
--
--     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
--         operation that failed or was stopped before the stack was
--         created or updated.
--
-- -   @CURRENT@: The stack is currently up to date with the stack set.
--
-- 'lastDriftCheckTimestamp', 'stackInstance_lastDriftCheckTimestamp' - Most recent time when CloudFormation performed a drift detection
-- operation on the stack instance. This value will be @NULL@ for any stack
-- instance on which drift detection has not yet been performed.
--
-- 'account', 'stackInstance_account' - [Self-managed permissions] The name of the Amazon Web Services account
-- that the stack instance is associated with.
--
-- 'driftStatus', 'stackInstance_driftStatus' - Status of the stack instance\'s actual configuration compared to the
-- expected template and parameter configuration of the stack set to which
-- it belongs.
--
-- -   @DRIFTED@: The stack differs from the expected template and
--     parameter configuration of the stack set to which it belongs. 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 if the stack instance
--     differs from its expected stack set configuration.
--
-- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
--     expected stack set configuration.
--
-- -   @UNKNOWN@: This value is reserved for future use.
--
-- 'organizationalUnitId', 'stackInstance_organizationalUnitId' - [Service-managed permissions] The organization root ID or organizational
-- unit (OU) IDs that you specified for
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
--
-- 'region', 'stackInstance_region' - The name of the Amazon Web Services Region that the stack instance is
-- associated with.
--
-- 'statusReason', 'stackInstance_statusReason' - The explanation for the specific status code that is assigned to this
-- stack instance.
--
-- 'stackId', 'stackInstance_stackId' - The ID of the stack instance.
--
-- 'stackInstanceStatus', 'stackInstance_stackInstanceStatus' - The detailed status of the stack instance.
--
-- 'parameterOverrides', 'stackInstance_parameterOverrides' - A list of parameters from the stack set template whose values have been
-- overridden in this stack instance.
--
-- 'stackSetId', 'stackInstance_stackSetId' - The name or unique ID of the stack set that the stack instance is
-- associated with.
newStackInstance ::
  StackInstance
newStackInstance :: StackInstance
newStackInstance =
  StackInstance' :: Maybe StackInstanceStatus
-> Maybe ISO8601
-> Maybe Text
-> Maybe StackDriftStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StackInstanceComprehensiveStatus
-> Maybe [Parameter]
-> Maybe Text
-> StackInstance
StackInstance'
    { $sel:status:StackInstance' :: Maybe StackInstanceStatus
status = Maybe StackInstanceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastDriftCheckTimestamp:StackInstance' :: Maybe ISO8601
lastDriftCheckTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:account:StackInstance' :: Maybe Text
account = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:driftStatus:StackInstance' :: Maybe StackDriftStatus
driftStatus = Maybe StackDriftStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationalUnitId:StackInstance' :: Maybe Text
organizationalUnitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:StackInstance' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:StackInstance' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:StackInstance' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackInstanceStatus:StackInstance' :: Maybe StackInstanceComprehensiveStatus
stackInstanceStatus = Maybe StackInstanceComprehensiveStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterOverrides:StackInstance' :: Maybe [Parameter]
parameterOverrides = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetId:StackInstance' :: Maybe Text
stackSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the stack instance, in terms of its synchronization with
-- its associated stack set.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @OUTDATED@: The stack isn\'t currently up to date with the stack set
--     because:
--
--     -   The associated stack failed during a @CreateStackSet@ or
--         @UpdateStackSet@ operation.
--
--     -   The stack was part of a @CreateStackSet@ or @UpdateStackSet@
--         operation that failed or was stopped before the stack was
--         created or updated.
--
-- -   @CURRENT@: The stack is currently up to date with the stack set.
stackInstance_status :: Lens.Lens' StackInstance (Prelude.Maybe StackInstanceStatus)
stackInstance_status :: (Maybe StackInstanceStatus -> f (Maybe StackInstanceStatus))
-> StackInstance -> f StackInstance
stackInstance_status = (StackInstance -> Maybe StackInstanceStatus)
-> (StackInstance -> Maybe StackInstanceStatus -> StackInstance)
-> Lens
     StackInstance
     StackInstance
     (Maybe StackInstanceStatus)
     (Maybe StackInstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe StackInstanceStatus
status :: Maybe StackInstanceStatus
$sel:status:StackInstance' :: StackInstance -> Maybe StackInstanceStatus
status} -> Maybe StackInstanceStatus
status) (\s :: StackInstance
s@StackInstance' {} Maybe StackInstanceStatus
a -> StackInstance
s {$sel:status:StackInstance' :: Maybe StackInstanceStatus
status = Maybe StackInstanceStatus
a} :: StackInstance)

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

-- | [Self-managed permissions] The name of the Amazon Web Services account
-- that the stack instance is associated with.
stackInstance_account :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_account :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_account = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
account :: Maybe Text
$sel:account:StackInstance' :: StackInstance -> Maybe Text
account} -> Maybe Text
account) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:account:StackInstance' :: Maybe Text
account = Maybe Text
a} :: StackInstance)

-- | Status of the stack instance\'s actual configuration compared to the
-- expected template and parameter configuration of the stack set to which
-- it belongs.
--
-- -   @DRIFTED@: The stack differs from the expected template and
--     parameter configuration of the stack set to which it belongs. 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 if the stack instance
--     differs from its expected stack set configuration.
--
-- -   @IN_SYNC@: The stack instance\'s actual configuration matches its
--     expected stack set configuration.
--
-- -   @UNKNOWN@: This value is reserved for future use.
stackInstance_driftStatus :: Lens.Lens' StackInstance (Prelude.Maybe StackDriftStatus)
stackInstance_driftStatus :: (Maybe StackDriftStatus -> f (Maybe StackDriftStatus))
-> StackInstance -> f StackInstance
stackInstance_driftStatus = (StackInstance -> Maybe StackDriftStatus)
-> (StackInstance -> Maybe StackDriftStatus -> StackInstance)
-> Lens
     StackInstance
     StackInstance
     (Maybe StackDriftStatus)
     (Maybe StackDriftStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe StackDriftStatus
driftStatus :: Maybe StackDriftStatus
$sel:driftStatus:StackInstance' :: StackInstance -> Maybe StackDriftStatus
driftStatus} -> Maybe StackDriftStatus
driftStatus) (\s :: StackInstance
s@StackInstance' {} Maybe StackDriftStatus
a -> StackInstance
s {$sel:driftStatus:StackInstance' :: Maybe StackDriftStatus
driftStatus = Maybe StackDriftStatus
a} :: StackInstance)

-- | [Service-managed permissions] The organization root ID or organizational
-- unit (OU) IDs that you specified for
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeploymentTargets.html DeploymentTargets>.
stackInstance_organizationalUnitId :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_organizationalUnitId :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_organizationalUnitId = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
organizationalUnitId :: Maybe Text
$sel:organizationalUnitId:StackInstance' :: StackInstance -> Maybe Text
organizationalUnitId} -> Maybe Text
organizationalUnitId) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:organizationalUnitId:StackInstance' :: Maybe Text
organizationalUnitId = Maybe Text
a} :: StackInstance)

-- | The name of the Amazon Web Services Region that the stack instance is
-- associated with.
stackInstance_region :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_region :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_region = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
region :: Maybe Text
$sel:region:StackInstance' :: StackInstance -> Maybe Text
region} -> Maybe Text
region) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:region:StackInstance' :: Maybe Text
region = Maybe Text
a} :: StackInstance)

-- | The explanation for the specific status code that is assigned to this
-- stack instance.
stackInstance_statusReason :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_statusReason :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_statusReason = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:StackInstance' :: StackInstance -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:statusReason:StackInstance' :: Maybe Text
statusReason = Maybe Text
a} :: StackInstance)

-- | The ID of the stack instance.
stackInstance_stackId :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_stackId :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_stackId = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
stackId :: Maybe Text
$sel:stackId:StackInstance' :: StackInstance -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:stackId:StackInstance' :: Maybe Text
stackId = Maybe Text
a} :: StackInstance)

-- | The detailed status of the stack instance.
stackInstance_stackInstanceStatus :: Lens.Lens' StackInstance (Prelude.Maybe StackInstanceComprehensiveStatus)
stackInstance_stackInstanceStatus :: (Maybe StackInstanceComprehensiveStatus
 -> f (Maybe StackInstanceComprehensiveStatus))
-> StackInstance -> f StackInstance
stackInstance_stackInstanceStatus = (StackInstance -> Maybe StackInstanceComprehensiveStatus)
-> (StackInstance
    -> Maybe StackInstanceComprehensiveStatus -> StackInstance)
-> Lens
     StackInstance
     StackInstance
     (Maybe StackInstanceComprehensiveStatus)
     (Maybe StackInstanceComprehensiveStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe StackInstanceComprehensiveStatus
stackInstanceStatus :: Maybe StackInstanceComprehensiveStatus
$sel:stackInstanceStatus:StackInstance' :: StackInstance -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus} -> Maybe StackInstanceComprehensiveStatus
stackInstanceStatus) (\s :: StackInstance
s@StackInstance' {} Maybe StackInstanceComprehensiveStatus
a -> StackInstance
s {$sel:stackInstanceStatus:StackInstance' :: Maybe StackInstanceComprehensiveStatus
stackInstanceStatus = Maybe StackInstanceComprehensiveStatus
a} :: StackInstance)

-- | A list of parameters from the stack set template whose values have been
-- overridden in this stack instance.
stackInstance_parameterOverrides :: Lens.Lens' StackInstance (Prelude.Maybe [Parameter])
stackInstance_parameterOverrides :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> StackInstance -> f StackInstance
stackInstance_parameterOverrides = (StackInstance -> Maybe [Parameter])
-> (StackInstance -> Maybe [Parameter] -> StackInstance)
-> Lens
     StackInstance StackInstance (Maybe [Parameter]) (Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe [Parameter]
parameterOverrides :: Maybe [Parameter]
$sel:parameterOverrides:StackInstance' :: StackInstance -> Maybe [Parameter]
parameterOverrides} -> Maybe [Parameter]
parameterOverrides) (\s :: StackInstance
s@StackInstance' {} Maybe [Parameter]
a -> StackInstance
s {$sel:parameterOverrides:StackInstance' :: Maybe [Parameter]
parameterOverrides = Maybe [Parameter]
a} :: StackInstance) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> StackInstance -> f StackInstance)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> StackInstance
-> f StackInstance
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 name or unique ID of the stack set that the stack instance is
-- associated with.
stackInstance_stackSetId :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_stackSetId :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_stackSetId = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
stackSetId :: Maybe Text
$sel:stackSetId:StackInstance' :: StackInstance -> Maybe Text
stackSetId} -> Maybe Text
stackSetId) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:stackSetId:StackInstance' :: Maybe Text
stackSetId = Maybe Text
a} :: StackInstance)

instance Core.FromXML StackInstance where
  parseXML :: [Node] -> Either String StackInstance
parseXML [Node]
x =
    Maybe StackInstanceStatus
-> Maybe ISO8601
-> Maybe Text
-> Maybe StackDriftStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StackInstanceComprehensiveStatus
-> Maybe [Parameter]
-> Maybe Text
-> StackInstance
StackInstance'
      (Maybe StackInstanceStatus
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe StackDriftStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe StackInstanceComprehensiveStatus
 -> Maybe [Parameter]
 -> Maybe Text
 -> StackInstance)
-> Either String (Maybe StackInstanceStatus)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe StackInstanceStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => 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 Text
   -> Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StackDriftStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => 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
"Account")
      Either
  String
  (Maybe StackDriftStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe StackDriftStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StackDriftStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DriftStatus")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => 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
"OrganizationalUnitId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => 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
"Region")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter]
      -> Maybe Text
      -> StackInstance)
forall (f :: * -> *) a b. Applicative f => 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
"StatusReason")
      Either
  String
  (Maybe Text
   -> Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter]
   -> Maybe Text
   -> StackInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StackInstanceComprehensiveStatus
      -> Maybe [Parameter] -> Maybe Text -> StackInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackId")
      Either
  String
  (Maybe StackInstanceComprehensiveStatus
   -> Maybe [Parameter] -> Maybe Text -> StackInstance)
-> Either String (Maybe StackInstanceComprehensiveStatus)
-> Either String (Maybe [Parameter] -> Maybe Text -> StackInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe StackInstanceComprehensiveStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackInstanceStatus")
      Either String (Maybe [Parameter] -> Maybe Text -> StackInstance)
-> Either String (Maybe [Parameter])
-> Either String (Maybe Text -> StackInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ParameterOverrides"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Parameter]))
-> Either String (Maybe [Parameter])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Parameter])
-> [Node] -> Either String (Maybe [Parameter])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Parameter]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe Text -> StackInstance)
-> Either String (Maybe Text) -> Either String StackInstance
forall (f :: * -> *) a b. Applicative f => 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")

instance Prelude.Hashable StackInstance

instance Prelude.NFData StackInstance