delete_stack_instances
¶
delete_stack_instances(
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
stack_set_name: Optional[StackSetName] = None,
accounts: Optional[AccountList] = None,
deployment_targets: Optional[DeploymentTargets] = None,
regions: Optional[RegionList] = None,
operation_preferences: Optional[StackSetOperationPreferences] = None,
retain_stacks: Optional[RetainStacks] = None,
operation_id: Optional[ClientRequestToken] = None,
call_as: Optional[CallAs] = None,
) -> DeleteStackInstancesOutput
Deletes stack instances for the specified accounts, in the specified Amazon Web Services Regions.
The maximum number of organizational unit (OUs) supported by a DeleteStackInstances operation is 50.
If you need more than 50, consider the following options:
-
Batch processing: If you don't want to expose your OU hierarchy, split up the operations into multiple calls with less than 50 OUs each.
-
Parent OU strategy: If you don't mind exposing the OU hierarchy, target a parent OU that contains all desired child OUs.
Parameters:
-
stack_set_name(Optional[StackSetName], default:None) –The name or unique ID of the StackSet that you want to delete stack instances for.
-
accounts(Optional[AccountList], default:None) –[Self-managed permissions] The account IDs of the Amazon Web Services accounts that you want to delete stack instances for.
You can specify
AccountsorDeploymentTargets, but not both. -
deployment_targets(Optional[DeploymentTargets], default:None) –[Service-managed permissions] The Organizations accounts from which to delete stack instances.
You can specify
AccountsorDeploymentTargets, but not both. -
regions(Optional[RegionList], default:None) –The Amazon Web Services Regions where you want to delete StackSet instances.
-
operation_preferences(Optional[StackSetOperationPreferences], default:None) –Preferences for how CloudFormation performs this StackSet operation.
-
retain_stacks(Optional[RetainStacks], default:None) –Removes the stack instances from the specified StackSet, but doesn't delete the stacks. You can't reassociate a retained stack or add an existing, saved stack to a new stack set.
For more information, see StackSet operation options.
-
operation_id(Optional[ClientRequestToken], default:None) –The unique identifier for this StackSet operation.
If you don't specify an operation ID, the SDK generates one automatically.
The operation ID also functions as an idempotency token, to ensure that CloudFormation performs the StackSet operation only once, even if you retry the request multiple times. You can retry StackSet operation requests to ensure that CloudFormation successfully received them.
Repeating this StackSet operation with a new operation ID retries all stack instances whose status is
OUTDATED. -
call_as(Optional[CallAs], default:None) –[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,
SELFis specified. UseSELFfor StackSets 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.
-
Raises:
-
InvalidOperationException–The specified operation isn't valid.
-
OperationIdAlreadyExistsException–The specified operation ID already exists.
-
OperationInProgressException–Another operation is currently in progress for this StackSet. Only one operation can be performed for a stack set at a given time.
-
StackSetNotFoundException–The specified StackSet doesn't exist.
-
StaleRequestException–Another operation has been performed on this StackSet since the specified operation was performed.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 | |