# TreeInspector

Inspector that maintains an attribute bag.

- Source: [`core/lib/tree.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/tree.ts#L4)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const treeInspector = new cdk.TreeInspector();
```

## Initializer

```ts
new TreeInspector()
```

## Properties

- `attributes`: { [key: string]: any } — Represents the bag of attributes as key-value pairs.

## Methods

- `addAttribute(key: string, value: any): void` — Adds attribute to bag.

  Keys should be added by convention to prevent conflicts
  i.e. L1 constructs will contain attributes with keys prefixed with aws:cdk:cloudformation

  **Parameters**

  - `key` — - key for metadata.
  - `value` — - value of metadata.
