Aws Stackset Lifecycle
Write-side retirement operations for a CloudFormation StackSet, run from the
management / delegated-admin account. Two MUTATING methods, each a single
locked execution that writes one result resource (deleteInstances polls
its operation to a terminal state; deleteStackSet is a direct delete).
deleteInstances runs DeleteStackInstances for an explicit batch of
deployment targets (OUs + accounts) and regions, with an explicit
retainStacks flag — use it batch-by-batch so each member is only briefly
affected. A safety guard refuses to operate on a whole OU/root unless
confirmWholeTarget: true is set, so a fat-fingered fleet-wide delete is
impossible. deleteStackSet runs DeleteStackSet once the stackset is empty.
The official @swamp/aws/cloudformation/stack-set (Cloud Control) type deletes
every instance at once with no batching and no RetainStacks control, so it
cannot express a staged, low-blast-radius retirement. This model fills that gap
using the native CloudFormation StackSets API, as the mutating sibling to the
read-only @jentz/aws-stackset-audit and @jentz/aws-stackset-drift-detect.
MUTATING: needs cloudformation:DeleteStackInstances /
cloudformation:DeleteStackSet plus the stackset admin role — a *-readonly
profile cannot run these, by design.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| stackSetName | string | The name of the CloudFormation StackSet to operate on (e.g. 'ExampleOrgBaseline'). |
| callAs | enum | Who you are calling as. SELF from the org management account; |
| region | string | Region of the CloudFormation endpoint (the stackset admin region — where |
| profile | string | Named AWS profile to use (resolved via fromIni). Empty (default) uses the |
| Argument | Type | Description |
|---|---|---|
| regions | array | Instance regions to delete in this account set. List every region this |
| retainStacks | boolean | REQUIRED by the API. false = delete the member stacks AND their resources. |
| confirmWholeTarget | boolean | Safety guard. Must be true to delete instances for a whole OU/root with no |
| pollSeconds | number | Seconds between operation status polls. |
| maxPolls | number | Maximum status polls before timing out. |
Resources
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned