AWS CloudFormation

2022/05/25 - AWS CloudFormation - 2 updated api methods

Changes  Add a new parameter statusReason to DescribeStackSetOperation output for additional details

DescribeStackSetOperation (updated) Link ¶
Changes (response)
{'StackSetOperation': {'StatusReason': 'string'}}

Returns the description of the specified stack set operation.

See also: AWS API Documentation

Request Syntax

client.describe_stack_set_operation(
    StackSetName='string',
    OperationId='string',
    CallAs='SELF'|'DELEGATED_ADMIN'
)
type StackSetName

string

param StackSetName

[REQUIRED]

The name or the unique stack ID of the stack set for the stack operation.

type OperationId

string

param OperationId

[REQUIRED]

The unique ID of the stack set operation.

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

{
    'StackSetOperation': {
        'OperationId': 'string',
        'StackSetId': 'string',
        'Action': 'CREATE'|'UPDATE'|'DELETE'|'DETECT_DRIFT',
        'Status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'STOPPING'|'STOPPED'|'QUEUED',
        'OperationPreferences': {
            'RegionConcurrencyType': 'SEQUENTIAL'|'PARALLEL',
            'RegionOrder': [
                'string',
            ],
            'FailureToleranceCount': 123,
            'FailureTolerancePercentage': 123,
            'MaxConcurrentCount': 123,
            'MaxConcurrentPercentage': 123
        },
        'RetainStacks': True|False,
        'AdministrationRoleARN': 'string',
        'ExecutionRoleName': 'string',
        'CreationTimestamp': datetime(2015, 1, 1),
        'EndTimestamp': datetime(2015, 1, 1),
        'DeploymentTargets': {
            'Accounts': [
                'string',
            ],
            'AccountsUrl': 'string',
            'OrganizationalUnitIds': [
                'string',
            ]
        },
        'StackSetDriftDetectionDetails': {
            'DriftStatus': 'DRIFTED'|'IN_SYNC'|'NOT_CHECKED',
            'DriftDetectionStatus': 'COMPLETED'|'FAILED'|'PARTIAL_SUCCESS'|'IN_PROGRESS'|'STOPPED',
            'LastDriftCheckTimestamp': datetime(2015, 1, 1),
            'TotalStackInstancesCount': 123,
            'DriftedStackInstancesCount': 123,
            'InSyncStackInstancesCount': 123,
            'InProgressStackInstancesCount': 123,
            'FailedStackInstancesCount': 123
        },
        'StatusReason': 'string'
    }
}

Response Structure

  • (dict) --

    • StackSetOperation (dict) --

      The specified stack set operation.

      • OperationId (string) --

        The unique ID of a stack set operation.

      • StackSetId (string) --

        The ID of the stack set.

      • Action (string) --

        The type of stack set operation: CREATE , UPDATE , or DELETE . Create and delete operations affect only the specified stack set instances that are associated with the specified stack set. Update operations affect both the stack set itself, in addition to all associated stack set instances.

      • Status (string) --

        The status of the operation.

        • FAILED : The operation exceeded the specified failure tolerance. The failure tolerance value that you've set for an operation is applied for each Region during stack create and update operations. If the number of failed stacks within a Region exceeds the failure tolerance, the status of the operation in the Region is set to FAILED . This in turn sets the status of the operation as a whole to FAILED , and CloudFormation cancels the operation in any remaining Regions.

        • QUEUED : [Service-managed permissions] For automatic deployments that require a sequence of operations, the operation is queued to be performed. For more information, see the stack set operation status codes in the CloudFormation User Guide.

        • RUNNING : The operation is currently being performed.

        • STOPPED : The user has canceled the operation.

        • STOPPING : The operation is in the process of stopping, at user request.

        • SUCCEEDED : The operation completed creating or updating all the specified stacks without exceeding the failure tolerance for the operation.

      • OperationPreferences (dict) --

        The preferences for how CloudFormation performs this stack set operation.

        • RegionConcurrencyType (string) --

          The concurrency type of deploying StackSets operations in Regions, could be in parallel or one Region at a time.

        • RegionOrder (list) --

          The order of the Regions in where you want to perform the stack operation.

          • (string) --

        • FailureToleranceCount (integer) --

          The number of accounts, per Region, for which this operation can fail before CloudFormation stops the operation in that Region. If the operation is stopped in a Region, CloudFormation doesn't attempt the operation in any subsequent Regions.

          Conditional: You must specify either FailureToleranceCount or FailureTolerancePercentage (but not both).

          By default, 0 is specified.

        • FailureTolerancePercentage (integer) --

          The percentage of accounts, per Region, for which this stack operation can fail before CloudFormation stops the operation in that Region. If the operation is stopped in a Region, CloudFormation doesn't attempt the operation in any subsequent Regions.

          When calculating the number of accounts based on the specified percentage, CloudFormation rounds down to the next whole number.

          Conditional: You must specify either FailureToleranceCount or FailureTolerancePercentage , but not both.

          By default, 0 is specified.

        • MaxConcurrentCount (integer) --

          The maximum number of accounts in which to perform this operation at one time. This is dependent on the value of FailureToleranceCount . MaxConcurrentCount is at most one more than the FailureToleranceCount .

          Note that this setting lets you specify the maximum for operations. For large deployments, under certain circumstances the actual number of accounts acted upon concurrently may be lower due to service throttling.

          Conditional: You must specify either MaxConcurrentCount or MaxConcurrentPercentage , but not both.

          By default, 1 is specified.

        • MaxConcurrentPercentage (integer) --

          The maximum percentage of accounts in which to perform this operation at one time.

          When calculating the number of accounts based on the specified percentage, CloudFormation rounds down to the next whole number. This is true except in cases where rounding down would result is zero. In this case, CloudFormation sets the number as one instead.

          Note that this setting lets you specify the maximum for operations. For large deployments, under certain circumstances the actual number of accounts acted upon concurrently may be lower due to service throttling.

          Conditional: You must specify either MaxConcurrentCount or MaxConcurrentPercentage , but not both.

          By default, 1 is specified.

      • RetainStacks (boolean) --

        For stack set operations of action type DELETE , specifies whether to remove the stack instances from the specified stack set, but doesn't delete the stacks. You can't re-associate a retained stack, or add an existing, saved stack to a new stack set.

      • AdministrationRoleARN (string) --

        The Amazon Resource Name (ARN) of the IAM role used to perform this stack set operation.

        Use customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account. For more information, see Define Permissions for Multiple Administrators in the CloudFormation User Guide .

      • ExecutionRoleName (string) --

        The name of the IAM execution role used to create or update the stack set.

        Use customized execution roles to control which stack resources users and groups can include in their stack sets.

      • CreationTimestamp (datetime) --

        The time at which the operation was initiated. Note that the creation times for the stack set operation might differ from the creation time of the individual stacks themselves. This is because CloudFormation needs to perform preparatory work for the operation, such as dispatching the work to the requested Regions, before actually creating the first stacks.

      • EndTimestamp (datetime) --

        The time at which the stack set operation ended, across all accounts and Regions specified. Note that this doesn't necessarily mean that the stack set operation was successful, or even attempted, in each account or Region.

      • DeploymentTargets (dict) --

        [Service-managed permissions] The Organizations accounts affected by the stack operation.

        • Accounts (list) --

          The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.

          • (string) --

        • AccountsUrl (string) --

          Returns the value of the AccountsUrl property.

        • OrganizationalUnitIds (list) --

          The organization root ID or organizational unit (OU) IDs to which StackSets deploys.

          • (string) --

      • StackSetDriftDetectionDetails (dict) --

        Detailed information about the drift status of the stack set. This includes information about drift operations currently being performed on the stack set.

        This information will only be present for stack set operations whose Action type is DETECT_DRIFT .

        For more information, see Detecting Unmanaged Changes in Stack Sets in the CloudFormation User Guide.

        • DriftStatus (string) --

          Status of the stack set's actual configuration compared to its expected template and parameter configuration. A stack set is considered to have drifted if one or more of its stack instances have drifted from their expected template and parameter configuration.

          • DRIFTED : One or more of the stack instances belonging to the stack set stack differs from the expected template and parameter configuration. A stack instance is considered to have drifted if one or more of the resources in the associated stack have drifted.

          • NOT_CHECKED : CloudFormation hasn't checked the stack set for drift.

          • IN_SYNC : All of the stack instances belonging to the stack set stack match from the expected template and parameter configuration.

        • DriftDetectionStatus (string) --

          The status of the stack set drift detection operation.

          • COMPLETED : The drift detection operation completed without failing on any stack instances.

          • FAILED : The drift detection operation exceeded the specified failure tolerance.

          • PARTIAL_SUCCESS : The drift detection operation completed without exceeding the failure tolerance for the operation.

          • IN_PROGRESS : The drift detection operation is currently being performed.

          • STOPPED : The user has canceled the drift detection operation.

        • LastDriftCheckTimestamp (datetime) --

          Most recent time when CloudFormation performed a drift detection operation on the stack set. This value will be NULL for any stack set on which drift detection hasn't yet been performed.

        • TotalStackInstancesCount (integer) --

          The total number of stack instances belonging to this stack set.

          The total number of stack instances is equal to the total of:

          • Stack instances that match the stack set configuration.

          • Stack instances that have drifted from the stack set configuration.

          • Stack instances where the drift detection operation has failed.

          • Stack instances currently being checked for drift.

        • DriftedStackInstancesCount (integer) --

          The number of stack instances that have drifted from the expected template and parameter configuration of the stack set. A stack instance is considered to have drifted if one or more of the resources in the associated stack don't match their expected configuration.

        • InSyncStackInstancesCount (integer) --

          The number of stack instances which match the expected template and parameter configuration of the stack set.

        • InProgressStackInstancesCount (integer) --

          The number of stack instances that are currently being checked for drift.

        • FailedStackInstancesCount (integer) --

          The number of stack instances for which the drift detection operation failed.

      • StatusReason (string) --

        The status of the operation in details.

ListStackSetOperations (updated) Link ¶
Changes (response)
{'Summaries': {'StatusReason': 'string'}}

Returns summary information about operations performed on a stack set.

See also: AWS API Documentation

Request Syntax

client.list_stack_set_operations(
    StackSetName='string',
    NextToken='string',
    MaxResults=123,
    CallAs='SELF'|'DELEGATED_ADMIN'
)
type StackSetName

string

param StackSetName

[REQUIRED]

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

type NextToken

string

param NextToken

If the previous paginated request didn't return all of the remaining results, the response object's NextToken parameter value is set to a token. To retrieve the next set of results, call ListStackSetOperations 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 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': [
        {
            'OperationId': 'string',
            'Action': 'CREATE'|'UPDATE'|'DELETE'|'DETECT_DRIFT',
            'Status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'STOPPING'|'STOPPED'|'QUEUED',
            'CreationTimestamp': datetime(2015, 1, 1),
            'EndTimestamp': datetime(2015, 1, 1),
            'StatusReason': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Summaries (list) --

      A list of StackSetOperationSummary structures that contain summary information about operations for the specified stack set.

      • (dict) --

        The structures that contain summary information about the specified operation.

        • OperationId (string) --

          The unique ID of the stack set operation.

        • Action (string) --

          The type of operation: CREATE , UPDATE , or DELETE . Create and delete operations affect only the specified stack instances that are associated with the specified stack set. Update operations affect both the stack set itself and all associated stack set instances.

        • Status (string) --

          The overall status of the operation.

          • FAILED : The operation exceeded the specified failure tolerance. The failure tolerance value that you've set for an operation is applied for each Region during stack create and update operations. If the number of failed stacks within a Region exceeds the failure tolerance, the status of the operation in the Region is set to FAILED . This in turn sets the status of the operation as a whole to FAILED , and CloudFormation cancels the operation in any remaining Regions.

          • QUEUED : [Service-managed permissions] For automatic deployments that require a sequence of operations, the operation is queued to be performed. For more information, see the stack set operation status codes in the CloudFormation User Guide.

          • RUNNING : The operation is currently being performed.

          • STOPPED : The user has canceled the operation.

          • STOPPING : The operation is in the process of stopping, at user request.

          • SUCCEEDED : The operation completed creating or updating all the specified stacks without exceeding the failure tolerance for the operation.

        • CreationTimestamp (datetime) --

          The time at which the operation was initiated. Note that the creation times for the stack set operation might differ from the creation time of the individual stacks themselves. This is because CloudFormation needs to perform preparatory work for the operation, such as dispatching the work to the requested Regions, before actually creating the first stacks.

        • EndTimestamp (datetime) --

          The time at which the stack set operation ended, across all accounts and Regions specified. Note that this doesn't necessarily mean that the stack set operation was successful, or even attempted, in each account or Region.

        • StatusReason (string) --

          The status of the operation in details.

    • NextToken (string) --

      If the request doesn't return all results, NextToken is set to a token. To retrieve the next set of results, call ListOperationResults again and assign that token to the request object's NextToken parameter. If there are no remaining results, NextToken is set to null .