TreeInspector Class
Inspector that maintains an attribute bag.
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();
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
tree_inspector = cdk.TreeInspector()
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
TreeInspector treeInspector = new TreeInspector();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var treeInspector = new TreeInspector();
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
treeInspector := cdk.NewTreeInspector()
Initializer
ts
new TreeInspector()
python
TreeInspector()
java
new TreeInspector()
csharp
new TreeInspector()
go
NewTreeInspector()
Properties
attributes{ [key: string]: any }attributestyping.Mapping[str, Any]attributesMap<String, Object>AttributesIDictionary<string, object>Attributes*map[string]interface{}required#Represents the bag of attributes as key-value pairs.
Methods
addAttribute(key: string, value: any): voiddef add_attribute(self, key: str, value: Any) -> Nonepublic void addAttribute(String key, Object value)public void AddAttribute(string key, object value)func AddAttribute(Key *string, Value interface{})#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
2 parameters
Parameters
keykeykeykeyKey— - key for metadata.valuevaluevaluevalueValue— - value of metadata.