{-# 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-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.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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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, in addition to the ID of the actual stack and the
-- stack status.
--
-- /See:/ 'newStackInstance' smart constructor.
data StackInstance = StackInstance'
  { -- | [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 hasn\'t 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,
    -- | 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 hasn\'t yet been performed.
    StackInstance -> Maybe ISO8601
lastDriftCheckTimestamp :: Prelude.Maybe Data.ISO8601,
    -- | The last unique ID of a StackSet operation performed on a stack
    -- instance.
    StackInstance -> Maybe Text
lastOperationId :: Prelude.Maybe Prelude.Text,
    -- | [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,
    -- | 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 of the Amazon Web Services Region that the stack instance is
    -- associated with.
    StackInstance -> Maybe Text
region :: 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,
    -- | The name or unique ID of the stack set that the stack instance is
    -- associated with.
    StackInstance -> Maybe Text
stackSetId :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | The explanation for the specific status code that\'s assigned to this
    -- stack instance.
    StackInstance -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text
  }
  deriving (StackInstance -> StackInstance -> Bool
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]
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
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. 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:
--
-- '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 hasn\'t 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.
--
-- '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 hasn\'t yet been performed.
--
-- 'lastOperationId', 'stackInstance_lastOperationId' - The last unique ID of a StackSet operation performed on a stack
-- instance.
--
-- '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>.
--
-- 'parameterOverrides', 'stackInstance_parameterOverrides' - A list of parameters from the stack set template whose values have been
-- overridden in this stack instance.
--
-- 'region', 'stackInstance_region' - The name of the Amazon Web Services Region that the stack instance is
-- associated with.
--
-- 'stackId', 'stackInstance_stackId' - The ID of the stack instance.
--
-- 'stackInstanceStatus', 'stackInstance_stackInstanceStatus' - The detailed status of the stack instance.
--
-- 'stackSetId', 'stackInstance_stackSetId' - The name or unique ID of the stack set that the stack instance is
-- associated with.
--
-- '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.
--
-- 'statusReason', 'stackInstance_statusReason' - The explanation for the specific status code that\'s assigned to this
-- stack instance.
newStackInstance ::
  StackInstance
newStackInstance :: StackInstance
newStackInstance =
  StackInstance'
    { $sel:account:StackInstance' :: Maybe Text
account = forall a. Maybe a
Prelude.Nothing,
      $sel:driftStatus:StackInstance' :: Maybe StackDriftStatus
driftStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:lastDriftCheckTimestamp:StackInstance' :: Maybe ISO8601
lastDriftCheckTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:lastOperationId:StackInstance' :: Maybe Text
lastOperationId = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationalUnitId:StackInstance' :: Maybe Text
organizationalUnitId = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterOverrides:StackInstance' :: Maybe [Parameter]
parameterOverrides = forall a. Maybe a
Prelude.Nothing,
      $sel:region:StackInstance' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:StackInstance' :: Maybe Text
stackId = forall a. Maybe a
Prelude.Nothing,
      $sel:stackInstanceStatus:StackInstance' :: Maybe StackInstanceComprehensiveStatus
stackInstanceStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetId:StackInstance' :: Maybe Text
stackSetId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:StackInstance' :: Maybe StackInstanceStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:StackInstance' :: Maybe Text
statusReason = forall a. Maybe a
Prelude.Nothing
    }

-- | [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 :: Lens' StackInstance (Maybe Text)
stackInstance_account = 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 hasn\'t 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 :: Lens' StackInstance (Maybe StackDriftStatus)
stackInstance_driftStatus = 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)

-- | 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 hasn\'t yet been performed.
stackInstance_lastDriftCheckTimestamp :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.UTCTime)
stackInstance_lastDriftCheckTimestamp :: Lens' StackInstance (Maybe UTCTime)
stackInstance_lastDriftCheckTimestamp = 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) 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 last unique ID of a StackSet operation performed on a stack
-- instance.
stackInstance_lastOperationId :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_lastOperationId :: Lens' StackInstance (Maybe Text)
stackInstance_lastOperationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
lastOperationId :: Maybe Text
$sel:lastOperationId:StackInstance' :: StackInstance -> Maybe Text
lastOperationId} -> Maybe Text
lastOperationId) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:lastOperationId:StackInstance' :: Maybe Text
lastOperationId = Maybe Text
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 :: Lens' StackInstance (Maybe Text)
stackInstance_organizationalUnitId = 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)

-- | 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 :: Lens' StackInstance (Maybe [Parameter])
stackInstance_parameterOverrides = 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) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' StackInstance (Maybe Text)
stackInstance_region = 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 ID of the stack instance.
stackInstance_stackId :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_stackId :: Lens' StackInstance (Maybe Text)
stackInstance_stackId = 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 :: Lens' StackInstance (Maybe StackInstanceComprehensiveStatus)
stackInstance_stackInstanceStatus = 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)

-- | 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 :: Lens' StackInstance (Maybe Text)
stackInstance_stackSetId = 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)

-- | 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 :: Lens' StackInstance (Maybe StackInstanceStatus)
stackInstance_status = 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)

-- | The explanation for the specific status code that\'s assigned to this
-- stack instance.
stackInstance_statusReason :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_statusReason :: Lens' StackInstance (Maybe Text)
stackInstance_statusReason = 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)

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

instance Prelude.Hashable StackInstance where
  hashWithSalt :: Int -> StackInstance -> Int
hashWithSalt Int
_salt StackInstance' {Maybe [Parameter]
Maybe Text
Maybe ISO8601
Maybe StackDriftStatus
Maybe StackInstanceComprehensiveStatus
Maybe StackInstanceStatus
statusReason :: Maybe Text
status :: Maybe StackInstanceStatus
stackSetId :: Maybe Text
stackInstanceStatus :: Maybe StackInstanceComprehensiveStatus
stackId :: Maybe Text
region :: Maybe Text
parameterOverrides :: Maybe [Parameter]
organizationalUnitId :: Maybe Text
lastOperationId :: Maybe Text
lastDriftCheckTimestamp :: Maybe ISO8601
driftStatus :: Maybe StackDriftStatus
account :: Maybe Text
$sel:statusReason:StackInstance' :: StackInstance -> Maybe Text
$sel:status:StackInstance' :: StackInstance -> Maybe StackInstanceStatus
$sel:stackSetId:StackInstance' :: StackInstance -> Maybe Text
$sel:stackInstanceStatus:StackInstance' :: StackInstance -> Maybe StackInstanceComprehensiveStatus
$sel:stackId:StackInstance' :: StackInstance -> Maybe Text
$sel:region:StackInstance' :: StackInstance -> Maybe Text
$sel:parameterOverrides:StackInstance' :: StackInstance -> Maybe [Parameter]
$sel:organizationalUnitId:StackInstance' :: StackInstance -> Maybe Text
$sel:lastOperationId:StackInstance' :: StackInstance -> Maybe Text
$sel:lastDriftCheckTimestamp:StackInstance' :: StackInstance -> Maybe ISO8601
$sel:driftStatus:StackInstance' :: StackInstance -> Maybe StackDriftStatus
$sel:account:StackInstance' :: StackInstance -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
account
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackDriftStatus
driftStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastDriftCheckTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastOperationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
organizationalUnitId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Parameter]
parameterOverrides
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackInstanceComprehensiveStatus
stackInstanceStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackSetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackInstanceStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusReason

instance Prelude.NFData StackInstance where
  rnf :: StackInstance -> ()
rnf StackInstance' {Maybe [Parameter]
Maybe Text
Maybe ISO8601
Maybe StackDriftStatus
Maybe StackInstanceComprehensiveStatus
Maybe StackInstanceStatus
statusReason :: Maybe Text
status :: Maybe StackInstanceStatus
stackSetId :: Maybe Text
stackInstanceStatus :: Maybe StackInstanceComprehensiveStatus
stackId :: Maybe Text
region :: Maybe Text
parameterOverrides :: Maybe [Parameter]
organizationalUnitId :: Maybe Text
lastOperationId :: Maybe Text
lastDriftCheckTimestamp :: Maybe ISO8601
driftStatus :: Maybe StackDriftStatus
account :: Maybe Text
$sel:statusReason:StackInstance' :: StackInstance -> Maybe Text
$sel:status:StackInstance' :: StackInstance -> Maybe StackInstanceStatus
$sel:stackSetId:StackInstance' :: StackInstance -> Maybe Text
$sel:stackInstanceStatus:StackInstance' :: StackInstance -> Maybe StackInstanceComprehensiveStatus
$sel:stackId:StackInstance' :: StackInstance -> Maybe Text
$sel:region:StackInstance' :: StackInstance -> Maybe Text
$sel:parameterOverrides:StackInstance' :: StackInstance -> Maybe [Parameter]
$sel:organizationalUnitId:StackInstance' :: StackInstance -> Maybe Text
$sel:lastOperationId:StackInstance' :: StackInstance -> Maybe Text
$sel:lastDriftCheckTimestamp:StackInstance' :: StackInstance -> Maybe ISO8601
$sel:driftStatus:StackInstance' :: StackInstance -> Maybe StackDriftStatus
$sel:account:StackInstance' :: StackInstance -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
account
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackDriftStatus
driftStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastDriftCheckTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastOperationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationalUnitId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Parameter]
parameterOverrides
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StackInstanceComprehensiveStatus
stackInstanceStatus
      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 StackInstanceStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusReason