# atmos aws cloudformation tree

Render the deployed stack's nested-stack dependency tree: walk the stack's
resources, recursing into every `AWS::CloudFormation::Stack` resource, up to
10 levels deep.

> ⚠️ Experimental

## Usage

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

```shell
atmos aws cloudformation tree vpc -s plat-ue2-dev
```

Render trees for all or affected components in dependency order:

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

## Flags

- **`--stack`, `-s` (required)**
  Atmos stack.
- **`--all` (optional)**
  Render trees for all 
  `aws/cloudformation`
   components in dependency order.
- **`--affected` (optional)**
  Render trees 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.

## Output

```
vpc-plat-ue2-dev
├─ vpc-plat-ue2-dev-NatGatewayStack-AB12CD34
└─ vpc-plat-ue2-dev-SubnetsStack-EF56GH78
```

A nested stack whose `AWS::CloudFormation::Stack` resource is still
`CREATE_IN_PROGRESS` (and so has no physical resource ID yet) is not shown —
`tree` recurses only into nested stacks that have actually been created.

:::note
`tree` 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.
:::
