2020/06/26 - AWS CloudFormation - 2 updated api methods
Changes ListStackInstances and DescribeStackInstance now return a new `StackInstanceStatus` object that contains `DetailedStatus` values: a disambiguation of the more generic `Status` value. ListStackInstances output can now be filtered on `DetailedStatus` using the new `Filters` parameter.
{'StackInstance': {'StackInstanceStatus': {'DetailedStatus': 'PENDING | ' 'RUNNING | ' 'SUCCEEDED | ' 'FAILED | ' 'CANCELLED | ' 'INOPERABLE'}}}
Returns the stack instance that's associated with the specified stack set, AWS account, and Region.
For a list of stack instances that are associated with a specific stack set, use ListStackInstances .
See also: AWS API Documentation
Request Syntax
client.describe_stack_instance( StackSetName='string', StackInstanceAccount='string', StackInstanceRegion='string' )
string
[REQUIRED]
The name or the unique stack ID of the stack set that you want to get stack instance information for.
string
[REQUIRED]
The ID of an AWS account that's associated with this stack instance.
string
[REQUIRED]
The name of a Region that's associated with this stack instance.
dict
Response Syntax
{ 'StackInstance': { 'StackSetId': 'string', 'Region': 'string', 'Account': 'string', 'StackId': 'string', 'ParameterOverrides': [ { 'ParameterKey': 'string', 'ParameterValue': 'string', 'UsePreviousValue': True|False, 'ResolvedValue': 'string' }, ], 'Status': 'CURRENT'|'OUTDATED'|'INOPERABLE', 'StackInstanceStatus': { 'DetailedStatus': 'PENDING'|'RUNNING'|'SUCCEEDED'|'FAILED'|'CANCELLED'|'INOPERABLE' }, 'StatusReason': 'string', 'OrganizationalUnitId': 'string', 'DriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED', 'LastDriftCheckTimestamp': datetime(2015, 1, 1) } }
Response Structure
(dict) --
StackInstance (dict) --
The stack instance that matches the specified request parameters.
StackSetId (string) --
The name or unique ID of the stack set that the stack instance is associated with.
Region (string) --
The name of the AWS Region that the stack instance is associated with.
Account (string) --
[Self-managed permissions] The name of the AWS account that the stack instance is associated with.
StackId (string) --
The ID of the stack instance.
ParameterOverrides (list) --
A list of parameters from the stack set template whose values have been overridden in this stack instance.
(dict) --
The Parameter data type.
ParameterKey (string) --
The key associated with the parameter. If you don't specify a key and value for a particular parameter, AWS CloudFormation uses the default value that is specified in your template.
ParameterValue (string) --
The input value associated with the parameter.
UsePreviousValue (boolean) --
During a stack update, use the existing parameter value that the stack is using for a given parameter key. If you specify true , do not specify a parameter value.
ResolvedValue (string) --
Read-only. The value that corresponds to a Systems Manager parameter key. This field is returned only for ` SSM parameter types <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types>`__ in the template.
Status (string) --
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.
StackInstanceStatus (dict) --
The detailed status of the stack instance.
DetailedStatus (string) --
CANCELLED : The operation in the specified account and Region has been cancelled. This is either because a user has stopped the stack set operation, or because the failure tolerance of the stack set operation has been exceeded.
FAILED : The operation in the specified account and Region failed. If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack set operation as a whole might be exceeded.
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.
PENDING : The operation in the specified account and Region has yet to start.
RUNNING : The operation in the specified account and Region is currently in progress.
SUCCEEDED : The operation in the specified account and Region completed successfully.
StatusReason (string) --
The explanation for the specific status code that is assigned to this stack instance.
OrganizationalUnitId (string) --
[Service-managed permissions] The organization root ID or organizational unit (OU) IDs that you specified for DeploymentTargets .
DriftStatus (string) --
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 : AWS 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.
LastDriftCheckTimestamp (datetime) --
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.
{'Filters': [{'Name': 'DETAILED_STATUS', 'Values': 'string'}]}Response
{'Summaries': {'StackInstanceStatus': {'DetailedStatus': 'PENDING | RUNNING | ' 'SUCCEEDED | FAILED | ' 'CANCELLED | ' 'INOPERABLE'}}}
Returns summary information about stack instances that are associated with the specified stack set. You can filter for stack instances that are associated with a specific AWS account name or Region, or that have a specific status.
See also: AWS API Documentation
Request Syntax
client.list_stack_instances( StackSetName='string', NextToken='string', MaxResults=123, Filters=[ { 'Name': 'DETAILED_STATUS', 'Values': 'string' }, ], StackInstanceAccount='string', StackInstanceRegion='string' )
string
[REQUIRED]
The name or unique ID of the stack set that you want to list stack instances for.
string
If the previous request didn't return all of the remaining results, the response's NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackInstances again and assign that token to the request object's NextToken parameter. If there are no remaining results, the previous response object's NextToken parameter is set to null .
integer
The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
list
The status that stack instances are filtered by.
(dict) --
The status that stack instances are filtered by.
Name (string) --
The type of filter to apply.
Values (string) --
The status to filter by.
string
The name of the AWS account that you want to list stack instances for.
string
The name of the Region where you want to list stack instances.
dict
Response Syntax
{ 'Summaries': [ { 'StackSetId': 'string', 'Region': 'string', 'Account': 'string', 'StackId': 'string', 'Status': 'CURRENT'|'OUTDATED'|'INOPERABLE', 'StatusReason': 'string', 'StackInstanceStatus': { 'DetailedStatus': 'PENDING'|'RUNNING'|'SUCCEEDED'|'FAILED'|'CANCELLED'|'INOPERABLE' }, 'OrganizationalUnitId': 'string', 'DriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED', 'LastDriftCheckTimestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Summaries (list) --
A list of StackInstanceSummary structures that contain information about the specified stack instances.
(dict) --
The structure that contains summary information about a stack instance.
StackSetId (string) --
The name or unique ID of the stack set that the stack instance is associated with.
Region (string) --
The name of the AWS Region that the stack instance is associated with.
Account (string) --
[Self-managed permissions] The name of the AWS account that the stack instance is associated with.
StackId (string) --
The ID of the stack instance.
Status (string) --
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 (string) --
The explanation for the specific status code assigned to this stack instance.
StackInstanceStatus (dict) --
The detailed status of the stack instance.
DetailedStatus (string) --
CANCELLED : The operation in the specified account and Region has been cancelled. This is either because a user has stopped the stack set operation, or because the failure tolerance of the stack set operation has been exceeded.
FAILED : The operation in the specified account and Region failed. If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack set operation as a whole might be exceeded.
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.
PENDING : The operation in the specified account and Region has yet to start.
RUNNING : The operation in the specified account and Region is currently in progress.
SUCCEEDED : The operation in the specified account and Region completed successfully.
OrganizationalUnitId (string) --
[Service-managed permissions] The organization root ID or organizational unit (OU) IDs that you specified for DeploymentTargets .
DriftStatus (string) --
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 : AWS 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.
LastDriftCheckTimestamp (datetime) --
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.
NextToken (string) --
If the request doesn't return all of the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListStackInstances again and assign that token to the request object's NextToken parameter. If the request returns all results, NextToken is set to null .