# atmos aws cloudformation stackset delete

Delete a CloudFormation StackSet. CloudFormation requires every stack
instance to be removed before the StackSet itself can be deleted, so
`stackset delete` lists the StackSet's current instances, deletes them all
(`DeleteStackInstances`, retaining no resources) if any exist, waits for
that operation to finish, and only then deletes the StackSet
(`DeleteStackSet`).

> ⚠️ Experimental

## Usage

```shell
atmos aws cloudformation stackset delete <component> --stack <stack> [options]
```

```shell
atmos aws cloudformation stackset delete vpc -s plat-ue2-dev
```

Skip the interactive confirmation prompt:

```shell
atmos aws cloudformation stackset delete vpc -s plat-ue2-dev --auto-approve
```

Delete StackSets for all or affected components in dependency order:

```shell
atmos aws cloudformation stackset delete --all -s plat-ue2-dev
atmos aws cloudformation stackset delete --affected --base origin/main
```

## Flags

- **`--stack`, `-s` (required)**
  Atmos stack.
- **`--auto-approve` (optional)**
  Skip the interactive confirmation prompt. Without it, 
  `stackset delete`
   prompts for confirmation on a TTY before deleting the StackSet.
- **`--all` (optional)**
  Delete StackSets for all 
  `aws/cloudformation`
   components in dependency order.
- **`--affected` (optional)**
  Delete StackSets for affected 
  `aws/cloudformation`
   components and their dependencies.
- **`--include-dependents` (optional)**
  With 
  `--affected`
  , include dependent 
  `aws/cloudformation`
   components.
- **`--tags` (optional)**
  Filter by tags (comma-separated, matches any): 
  `--tags=production,tier-1`
  . Composes with 
  `--all`
  /
  `--affected`
   to narrow the selected set further; cannot be combined with a single component argument.
- **`--labels` (optional)**
  Filter by labels (comma-separated 
  `key=value`
   or 
  `key:value`
   pairs, matches all): 
  `--labels=cost-center=platform,compliance=sox`
  . Composes with 
  `--all`
  /
  `--affected`
  /
  `--tags`
  ; cannot be combined with a single component argument.

## Behavior

`stackset delete` acts directly on the StackSet whose name matches the
component's `stack_name` — it takes no `--target` flag and does not need a
`kind: aws/stackset` provision target declared. The `DeleteStackInstances`
operation is polled every 3 seconds until it reaches a terminal status
(`SUCCEEDED`/`FAILED`/`STOPPED`), and the command times out after 30 minutes
if it hasn't.

:::note
`stackset delete` does not fire `before`/`after` hook events — only
[`apply`](/cli/commands/aws/cloudformation/apply),
[`diff`](/cli/commands/aws/cloudformation/diff), and
[`delete`](/cli/commands/aws/cloudformation/delete) do.
:::
