AWS CloudFormation

2024/03/04 - AWS CloudFormation - 4 updated api methods

Changes  Add DetailedStatus field to DescribeStackEvents and DescribeStacks APIs

DescribeStackEvents (updated) Link ¶
Changes (response)
{'StackEvents': {'DetailedStatus': 'CONFIGURATION_COMPLETE | '
                                   'VALIDATION_FAILED'}}

Returns all stack related events for a specified stack in reverse chronological order. For more information about a stack's event history, go to Stacks in the CloudFormation User Guide .

Note

You can list events for stacks that have failed to create or have been deleted by specifying the unique stack identifier (stack ID).

See also: AWS API Documentation

Request Syntax

client.describe_stack_events(
    StackName='string',
    NextToken='string'
)
type StackName

string

param StackName

The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:

  • Running stacks: You can specify either the stack's name or its unique stack ID.

  • Deleted stacks: You must specify the unique stack ID.

Default: There is no default value.

type NextToken

string

param NextToken

A string that identifies the next page of events that you want to retrieve.

rtype

dict

returns

Response Syntax

{
    'StackEvents': [
        {
            'StackId': 'string',
            'EventId': 'string',
            'StackName': 'string',
            'LogicalResourceId': 'string',
            'PhysicalResourceId': 'string',
            'ResourceType': 'string',
            'Timestamp': datetime(2015, 1, 1),
            'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED',
            'ResourceStatusReason': 'string',
            'ResourceProperties': 'string',
            'ClientRequestToken': 'string',
            'HookType': 'string',
            'HookStatus': 'HOOK_IN_PROGRESS'|'HOOK_COMPLETE_SUCCEEDED'|'HOOK_COMPLETE_FAILED'|'HOOK_FAILED',
            'HookStatusReason': 'string',
            'HookInvocationPoint': 'PRE_PROVISION',
            'HookFailureMode': 'FAIL'|'WARN',
            'DetailedStatus': 'CONFIGURATION_COMPLETE'|'VALIDATION_FAILED'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    The output for a DescribeStackEvents action.

    • StackEvents (list) --

      A list of StackEvents structures.

      • (dict) --

        The StackEvent data type.

        • StackId (string) --

          The unique ID name of the instance of the stack.

        • EventId (string) --

          The unique ID of this event.

        • StackName (string) --

          The name associated with a stack.

        • LogicalResourceId (string) --

          The logical name of the resource specified in the template.

        • PhysicalResourceId (string) --

          The name or unique identifier associated with the physical instance of the resource.

        • ResourceType (string) --

          Type of resource. (For more information, go to Amazon Web Services Resource Types Reference in the CloudFormation User Guide.)

        • Timestamp (datetime) --

          Time the status was updated.

        • ResourceStatus (string) --

          Current status of the resource.

        • ResourceStatusReason (string) --

          Success/failure message associated with the resource.

        • ResourceProperties (string) --

          BLOB of the properties used to create the resource.

        • ClientRequestToken (string) --

          The token passed to the operation that generated this event.

          All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1 , then all the StackEvents generated by that operation will have ClientRequestToken set as token1 .

          In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID , which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002 .

        • HookType (string) --

          The name of the hook.

        • HookStatus (string) --

          Provides the status of the change set hook.

        • HookStatusReason (string) --

          Provides the reason for the hook status.

        • HookInvocationPoint (string) --

          Invocation points are points in provisioning logic where hooks are initiated.

        • HookFailureMode (string) --

          Specify the hook failure mode for non-compliant resources in the followings ways.

          • FAIL Stops provisioning resources.

          • WARN Allows provisioning to continue with a warning message.

        • DetailedStatus (string) --

          An optional field containing information about the detailed status of the stack event.

          • CONFIGURATION_COMPLETE - all of the resources in the stack have reached that event. For more information, see CloudFormation stack deployment in the CloudFormation User Guide .

          • VALIDATION_FAILED - template validation failed because of invalid properties in the template. The ResourceStatusReason field shows what properties are defined incorrectly.

    • NextToken (string) --

      If the output exceeds 1 MB in size, a string that identifies the next page of events. If no additional page exists, this value is null.

DescribeStackInstance (updated) Link ¶
Changes (response)
{'StackInstance': {'StackInstanceStatus': {'DetailedStatus': {'FAILED_IMPORT'}}}}

Returns the stack instance that's associated with the specified StackSet, Amazon Web Services account, and Amazon Web Services Region.

For a list of stack instances that are associated with a specific StackSet, use ListStackInstances.

See also: AWS API Documentation

Request Syntax

client.describe_stack_instance(
    StackSetName='string',
    StackInstanceAccount='string',
    StackInstanceRegion='string',
    CallAs='SELF'|'DELEGATED_ADMIN'
)
type StackSetName

string

param StackSetName

[REQUIRED]

The name or the unique stack ID of the stack set that you want to get stack instance information for.

type StackInstanceAccount

string

param StackInstanceAccount

[REQUIRED]

The ID of an Amazon Web Services account that's associated with this stack instance.

type StackInstanceRegion

string

param StackInstanceRegion

[REQUIRED]

The name of a Region that's associated with this stack instance.

type CallAs

string

param CallAs

[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.

By default, SELF is specified. Use SELF for stack sets with self-managed permissions.

  • If you are signed in to the management account, specify SELF .

  • If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN . Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide .

rtype

dict

returns

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'|'SKIPPED_SUSPENDED_ACCOUNT'|'FAILED_IMPORT'
        },
        'StatusReason': 'string',
        'OrganizationalUnitId': 'string',
        'DriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED',
        'LastDriftCheckTimestamp': datetime(2015, 1, 1),
        'LastOperationId': 'string'
    }
}

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 Amazon Web Services Region that the stack instance is associated with.

      • Account (string) --

        [Self-managed permissions] The name of the Amazon Web Services 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, CloudFormation uses the default value that's 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 SSM parameter key. This field is returned only for 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. INOPERABLE can be returned here when the cause is a failed import. If it's due to a failed import, the operation can be retried once the failures are fixed. To see if this is due to a failed import, look at the DetailedStatus member in the StackInstanceSummary member that is a peer to this Status member.

        • 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 canceled. 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.

          • FAILED_IMPORT : The import of the stack instance in the specified account and Region failed and left the stack in an unstable state. Once the issues causing the failure are fixed, the import operation can be retried. If enough stack set operations fail 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.

          • SKIPPED_SUSPENDED_ACCOUNT : The operation in the specified account and Region has been skipped because the account was suspended at the time of the operation.

          • SUCCEEDED : The operation in the specified account and Region completed successfully.

      • StatusReason (string) --

        The explanation for the specific status code that's 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 : 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 (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 hasn't yet been performed.

      • LastOperationId (string) --

        The last unique ID of a StackSet operation performed on a stack instance.

DescribeStacks (updated) Link ¶
Changes (response)
{'Stacks': {'DetailedStatus': 'CONFIGURATION_COMPLETE | VALIDATION_FAILED'}}

Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.

Note

If the stack doesn't exist, a ValidationError is returned.

See also: AWS API Documentation

Request Syntax

client.describe_stacks(
    StackName='string',
    NextToken='string'
)
type StackName

string

param StackName

Note

If you don't pass a parameter to StackName , the API returns a response that describes all resources in the account, which can impact performance. This requires ListStacks and DescribeStacks permissions.

Consider using the ListStacks API if you're not passing a parameter to StackName .

The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:::stack//" }] }

The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:

  • Running stacks: You can specify either the stack's name or its unique stack ID.

  • Deleted stacks: You must specify the unique stack ID.

Default: There is no default value.

type NextToken

string

param NextToken

A string that identifies the next page of stacks that you want to retrieve.

rtype

dict

returns

Response Syntax

{
    'Stacks': [
        {
            'StackId': 'string',
            'StackName': 'string',
            'ChangeSetId': 'string',
            'Description': 'string',
            'Parameters': [
                {
                    'ParameterKey': 'string',
                    'ParameterValue': 'string',
                    'UsePreviousValue': True|False,
                    'ResolvedValue': 'string'
                },
            ],
            'CreationTime': datetime(2015, 1, 1),
            'DeletionTime': datetime(2015, 1, 1),
            'LastUpdatedTime': datetime(2015, 1, 1),
            'RollbackConfiguration': {
                'RollbackTriggers': [
                    {
                        'Arn': 'string',
                        'Type': 'string'
                    },
                ],
                'MonitoringTimeInMinutes': 123
            },
            'StackStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_FAILED'|'ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'|'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'REVIEW_IN_PROGRESS'|'IMPORT_IN_PROGRESS'|'IMPORT_COMPLETE'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE',
            'StackStatusReason': 'string',
            'DisableRollback': True|False,
            'NotificationARNs': [
                'string',
            ],
            'TimeoutInMinutes': 123,
            'Capabilities': [
                'CAPABILITY_IAM'|'CAPABILITY_NAMED_IAM'|'CAPABILITY_AUTO_EXPAND',
            ],
            'Outputs': [
                {
                    'OutputKey': 'string',
                    'OutputValue': 'string',
                    'Description': 'string',
                    'ExportName': 'string'
                },
            ],
            'RoleARN': 'string',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'EnableTerminationProtection': True|False,
            'ParentId': 'string',
            'RootId': 'string',
            'DriftInformation': {
                'StackDriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED',
                'LastCheckTimestamp': datetime(2015, 1, 1)
            },
            'RetainExceptOnCreate': True|False,
            'DetailedStatus': 'CONFIGURATION_COMPLETE'|'VALIDATION_FAILED'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    The output for a DescribeStacks action.

    • Stacks (list) --

      A list of stack structures.

      • (dict) --

        The Stack data type.

        • StackId (string) --

          Unique identifier of the stack.

        • StackName (string) --

          The name associated with the stack.

        • ChangeSetId (string) --

          The unique ID of the change set.

        • Description (string) --

          A user-defined description associated with the stack.

        • Parameters (list) --

          A list of Parameter structures.

          • (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, CloudFormation uses the default value that's 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 SSM parameter key. This field is returned only for SSM parameter types in the template.

        • CreationTime (datetime) --

          The time at which the stack was created.

        • DeletionTime (datetime) --

          The time the stack was deleted.

        • LastUpdatedTime (datetime) --

          The time the stack was last updated. This field will only be returned if the stack has been updated at least once.

        • RollbackConfiguration (dict) --

          The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.

          • RollbackTriggers (list) --

            The triggers to monitor during stack creation or update actions.

            By default, CloudFormation saves the rollback triggers specified for a stack and applies them to any subsequent update operations for the stack, unless you specify otherwise. If you do specify rollback triggers for this parameter, those triggers replace any list of triggers previously specified for the stack. This means:

            • To use the rollback triggers previously specified for this stack, if any, don't specify this parameter.

            • To specify new or updated rollback triggers, you must specify all the triggers that you want used for this stack, even triggers you've specified before (for example, when creating the stack or during a previous stack update). Any triggers that you don't include in the updated list of triggers are no longer applied to the stack.

            • To remove all currently specified triggers, specify an empty list for this parameter.

            If a specified trigger is missing, the entire stack operation fails and is rolled back.

            • (dict) --

              A rollback trigger CloudFormation monitors during creation and updating of stacks. If any of the alarms you specify goes to ALARM state during the stack operation or within the specified monitoring period afterwards, CloudFormation rolls back the entire stack operation.

              • Arn (string) --

                The Amazon Resource Name (ARN) of the rollback trigger.

                If a specified trigger is missing, the entire stack operation fails and is rolled back.

              • Type (string) --

                The resource type of the rollback trigger. Specify either AWS::CloudWatch::Alarm or AWS::CloudWatch::CompositeAlarm resource types.

          • MonitoringTimeInMinutes (integer) --

            The amount of time, in minutes, during which CloudFormation should monitor all the rollback triggers after the stack creation or update operation deploys all necessary resources.

            The default is 0 minutes.

            If you specify a monitoring period but don't specify any rollback triggers, CloudFormation still waits the specified period of time before cleaning up old resources after update operations. You can use this monitoring period to perform any manual stack validation desired, and manually cancel the stack creation or update (using CancelUpdateStack, for example) as necessary.

            If you specify 0 for this parameter, CloudFormation still monitors the specified rollback triggers during stack creation and update operations. Then, for update operations, it begins disposing of old resources immediately once the operation completes.

        • StackStatus (string) --

          Current status of the stack.

        • StackStatusReason (string) --

          Success/failure message associated with the stack status.

        • DisableRollback (boolean) --

          Boolean to enable or disable rollback on stack creation failures:

          • true : disable rollback.

          • false : enable rollback.

        • NotificationARNs (list) --

          Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.

          • (string) --

        • TimeoutInMinutes (integer) --

          The amount of time within which stack creation should complete.

        • Capabilities (list) --

          The capabilities allowed in the stack.

          • (string) --

        • Outputs (list) --

          A list of output structures.

          • (dict) --

            The Output data type.

            • OutputKey (string) --

              The key associated with the output.

            • OutputValue (string) --

              The value associated with the output.

            • Description (string) --

              User defined description associated with the output.

            • ExportName (string) --

              The name of the export associated with the output.

        • RoleARN (string) --

          The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that's associated with the stack. During a stack operation, CloudFormation uses this role's credentials to make calls on your behalf.

        • Tags (list) --

          A list of Tag s that specify information about the stack.

          • (dict) --

            The Tag type enables you to specify a key-value pair that can be used to store information about an CloudFormation stack.

            • Key (string) --

              Required . A string used to identify this tag. You can specify a maximum of 128 characters for a tag key. Tags owned by Amazon Web Services (Amazon Web Services) have the reserved prefix: aws: .

            • Value (string) --

              Required . A string containing the value for this tag. You can specify a maximum of 256 characters for a tag value.

        • EnableTerminationProtection (boolean) --

          Whether termination protection is enabled for the stack.

          For nested stacks, termination protection is set on the root stack and can't be changed directly on the nested stack. For more information, see Protecting a Stack From Being Deleted in the CloudFormation User Guide .

        • ParentId (string) --

          For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of this stack. For the first level of nested stacks, the root stack is also the parent stack.

          For more information, see Working with Nested Stacks in the CloudFormation User Guide .

        • RootId (string) --

          For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to which the nested stack ultimately belongs.

          For more information, see Working with Nested Stacks in the CloudFormation User Guide .

        • DriftInformation (dict) --

          Information about whether a stack's actual configuration differs, or has drifted , from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to Stacks and Resources.

          • StackDriftStatus (string) --

            Status of the stack's actual configuration compared to its expected template configuration.

            • DRIFTED : The stack differs from its expected template configuration. A stack is considered to have drifted if one or more of its resources have drifted.

            • NOT_CHECKED : CloudFormation hasn't checked if the stack differs from its expected template configuration.

            • IN_SYNC : The stack's actual configuration matches its expected template configuration.

            • UNKNOWN : This value is reserved for future use.

          • LastCheckTimestamp (datetime) --

            Most recent time when a drift detection operation was initiated on the stack, or any of its individual resources that support drift detection.

        • RetainExceptOnCreate (boolean) --

          When set to true , newly created resources are deleted when the operation rolls back. This includes newly created resources marked with a deletion policy of Retain .

          Default: false

        • DetailedStatus (string) --

          The detailed status of the resource or stack. If CONFIGURATION_COMPLETE is present, the resource or resource configuration phase has completed and the stabilization of the resources is in progress. The stack sets CONFIGURATION_COMPLETE when all of the resources in the stack have reached that event. For more information, see CloudFormation stack deployment in the CloudFormation User Guide .

    • NextToken (string) --

      If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page exists, this value is null.

ListStackInstances (updated) Link ¶
Changes (response)
{'Summaries': {'StackInstanceStatus': {'DetailedStatus': {'FAILED_IMPORT'}}}}

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 Amazon Web Services 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'|'LAST_OPERATION_ID'|'DRIFT_STATUS',
            'Values': 'string'
        },
    ],
    StackInstanceAccount='string',
    StackInstanceRegion='string',
    CallAs='SELF'|'DELEGATED_ADMIN'
)
type StackSetName

string

param StackSetName

[REQUIRED]

The name or unique ID of the stack set that you want to list stack instances for.

type NextToken

string

param NextToken

If the previous request didn't return all 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 .

type MaxResults

integer

param MaxResults

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.

type Filters

list

param Filters

The filter to apply to stack instances

  • (dict) --

    The filter to apply to stack instances

    • Name (string) --

      The type of filter to apply.

    • Values (string) --

      The status to filter by.

type StackInstanceAccount

string

param StackInstanceAccount

The name of the Amazon Web Services account that you want to list stack instances for.

type StackInstanceRegion

string

param StackInstanceRegion

The name of the Region where you want to list stack instances.

type CallAs

string

param CallAs

[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.

By default, SELF is specified. Use SELF for stack sets with self-managed permissions.

  • If you are signed in to the management account, specify SELF .

  • If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN . Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide .

rtype

dict

returns

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'|'SKIPPED_SUSPENDED_ACCOUNT'|'FAILED_IMPORT'
            },
            'OrganizationalUnitId': 'string',
            'DriftStatus': 'DRIFTED'|'IN_SYNC'|'UNKNOWN'|'NOT_CHECKED',
            'LastDriftCheckTimestamp': datetime(2015, 1, 1),
            'LastOperationId': 'string'
        },
    ],
    '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 Amazon Web Services Region that the stack instance is associated with.

        • Account (string) --

          [Self-managed permissions] The name of the Amazon Web Services 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. INOPERABLE can be returned here when the cause is a failed import. If it's due to a failed import, the operation can be retried once the failures are fixed. To see if this is due to a failed import, call the DescribeStackInstance API operation, look at the DetailedStatus member returned in the StackInstanceSummary member.

          • 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 canceled. 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.

            • FAILED_IMPORT : The import of the stack instance in the specified account and Region failed and left the stack in an unstable state. Once the issues causing the failure are fixed, the import operation can be retried. If enough stack set operations fail 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.

            • SKIPPED_SUSPENDED_ACCOUNT : The operation in the specified account and Region has been skipped because the account was suspended at the time of the operation.

            • 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 : 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 (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 hasn't yet been performed.

        • LastOperationId (string) --

          The last unique ID of a StackSet operation performed on a stack instance.

    • NextToken (string) --

      If the request doesn't return all 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 .