API Reference
Constructs
CdkGraph
CdkGraph construct is the cdk-graph framework controller that is responsible for computing the graph, storing serialized graph, and instrumenting plugins per the plugin contract.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CdkGraph(
root: Construct,
plugins: typing.List[ICdkGraphPlugin] = None
)
Name | Type | Description |
---|---|---|
root |
constructs.Construct |
No description. |
plugins |
typing.List[ICdkGraphPlugin] |
List of plugins to extends the graph. |
root
Required
- Type: constructs.Construct
plugins
Optional
- Type: typing.List[ICdkGraphPlugin]
List of plugins to extends the graph.
Plugins are invoked at each phases in fifo order.
Methods
Name | Description |
---|---|
to_string |
Returns a string representation of this construct. |
report |
Asynchronous report generation. This operation enables running expensive and non-synchronous report generation by plugins post synthesis. |
to_string
def to_string() -> str
Returns a string representation of this construct.
report
def report() -> None
Asynchronous report generation. This operation enables running expensive and non-synchronous report generation by plugins post synthesis.
If a given plugin requires performing asynchronous operations or is general expensive, it should
utilize report
rather than synthesize
.
Static Functions
Name | Description |
---|---|
is_construct |
Checks if x is a construct. |
is_construct
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CdkGraph.is_construct(
x: typing.Any
)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: typing.Any
Any object.
Properties
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
config |
typing.Mapping[typing.Any] |
Config. |
plugins |
typing.List[ICdkGraphPlugin] |
List of plugins registered with this instance. |
root |
constructs.Construct |
No description. |
graph_context |
CdkGraphContext |
Get the context for the graph instance. |
node
Required
node: Node
- Type: constructs.Node
The tree node.
config
Required
config: typing.Mapping[typing.Any]
- Type: typing.Mapping[typing.Any]
Config.
plugins
Required
plugins: typing.List[ICdkGraphPlugin]
- Type: typing.List[ICdkGraphPlugin]
List of plugins registered with this instance.
root
Required
root: Construct
- Type: constructs.Construct
graph_context
Optional
graph_context: CdkGraphContext
- Type: CdkGraphContext
Get the context for the graph instance.
This will be undefined
before construct synthesis has initiated.
Constants
Name | Type | Description |
---|---|---|
ID |
str |
Fixed CdkGraph construct id. |
VERSION |
str |
Current CdkGraph semantic version. |
ID
Required
ID: str
- Type: str
Fixed CdkGraph construct id.
VERSION
Required
VERSION: str
- Type: str
Current CdkGraph semantic version.
Structs
CdkGraphArtifact
CdkGraph artifact definition.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CdkGraphArtifact(
filename: str,
filepath: str,
id: str,
source: str,
description: str = None
)
Properties
Name | Type | Description |
---|---|---|
filename |
str |
Filename of the artifact. |
filepath |
str |
Full path where artifact is stored. |
id |
str |
The unique type of the artifact. |
source |
str |
The source of the artifact (such as plugin, or core system, etc). |
description |
str |
Description of artifact. |
filename
Required
filename: str
- Type: str
Filename of the artifact.
filepath
Required
filepath: str
- Type: str
Full path where artifact is stored.
id
Required
id: str
- Type: str
The unique type of the artifact.
source
Required
source: str
- Type: str
The source of the artifact (such as plugin, or core system, etc).
description
Optional
description: str
- Type: str
Description of artifact.
ConstructInfo
Source information on a construct (class fqn and version).
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ConstructInfo(
fqn: str,
version: str
)
Properties
Name | Type | Description |
---|---|---|
fqn |
str |
No description. |
version |
str |
No description. |
fqn
Required
fqn: str
- Type: str
version
Required
version: str
- Type: str
FilterValue
Filter value to use.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.FilterValue(
regex: str = None,
value: str = None
)
Properties
Name | Type | Description |
---|---|---|
regex |
str |
String representation of a regex. |
value |
str |
Raw value. |
regex
Optional
regex: str
- Type: str
String representation of a regex.
value
Optional
value: str
- Type: str
Raw value.
ICdkGraphProps
{@link CdkGraph} props.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ICdkGraphProps(
plugins: typing.List[ICdkGraphPlugin] = None
)
Properties
Name | Type | Description |
---|---|---|
plugins |
typing.List[ICdkGraphPlugin] |
List of plugins to extends the graph. |
plugins
Optional
plugins: typing.List[ICdkGraphPlugin]
- Type: typing.List[ICdkGraphPlugin]
List of plugins to extends the graph.
Plugins are invoked at each phases in fifo order.
IFilter
A filter than can be applied to the graph.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.IFilter(
graph: IGraphFilter = None,
store: IGraphStoreFilter = None
)
Properties
Name | Type | Description |
---|---|---|
graph |
IGraphFilter |
Graph Filter. |
store |
IGraphStoreFilter |
Store Filter. |
graph
Optional
graph: IGraphFilter
- Type: IGraphFilter
Graph Filter.
store
Optional
store: IGraphStoreFilter
- Type: IGraphStoreFilter
Store Filter.
IGraphFilter
Graph filter.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.IGraphFilter(
all_nodes: bool = None,
edge: IEdgePredicate = None,
inverse: bool = None,
node: INodePredicate = None,
strategy: FilterStrategy = None
)
Properties
Name | Type | Description |
---|---|---|
all_nodes |
bool |
Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes. |
edge |
IEdgePredicate |
Predicate to match edges. |
inverse |
bool |
Indicates that matches will be filtered, as opposed to non-matches. |
node |
INodePredicate |
Predicate to match nodes. |
strategy |
FilterStrategy |
Filter strategy to apply to matching nodes. |
all_nodes
Optional
all_nodes: bool
- Type: bool
Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes.
By enabling this, all Stages, Stacks, and structural construct boundaries will be filtered as well. In general, most users intent is to operate against resources and desire to preserve structural groupings, which is common in most Cfn/Cdk based filtering where inputs are "include" lists.
Defaults to value of containing {@link IGraphFilterPlan.allNodes}
edge
Optional
edge: IEdgePredicate
- Type: IEdgePredicate
Predicate to match edges.
Edges are evaluated after nodes are filtered.
inverse
Optional
inverse: bool
- Type: bool
- Default: false - Preserve matches, and filter out non-matches.
Indicates that matches will be filtered, as opposed to non-matches.
The default follows common Javascript Array.filter precedence of preserving matches during filtering, while pruning non-matches.
node
Optional
node: INodePredicate
- Type: INodePredicate
Predicate to match nodes.
strategy
Optional
strategy: FilterStrategy
- Type: FilterStrategy
- Default: {FilterStrategy.PRUNE}
Filter strategy to apply to matching nodes.
Edges do not have a strategy, they are always pruned.
IGraphFilterPlan
Graph filter plan.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.IGraphFilterPlan(
all_nodes: bool = None,
filters: typing.List[IFilter] = None,
focus: IGraphFilterPlanFocusConfig = None,
order: ConstructOrder = None,
preset: FilterPreset = None
)
Properties
Name | Type | Description |
---|---|---|
all_nodes |
bool |
Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes. |
filters |
typing.List[IFilter] |
Ordered list of {@link IGraphFilter} and {@link IGraphStoreFilter} filters to apply to the store. |
focus |
IGraphFilterPlanFocusConfig |
Config to focus the graph on specific node. |
order |
constructs.ConstructOrder |
The order to visit nodes and edges during filtering. |
preset |
FilterPreset |
Optional preset filter to apply before other filters. |
all_nodes
Optional
all_nodes: bool
- Type: bool
- Default: false By default only Resource and CfnResource nodes are filtered.
Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes.
By enabling this, all Stages, Stacks, and structural construct boundaries will be filtered as well. In general, most users intent is to operate against resources and desire to preserve structural groupings, which is common in most Cfn/Cdk based filtering where inputs are "include" lists.
filters
Optional
filters: typing.List[IFilter]
- Type: typing.List[IFilter]
Ordered list of {@link IGraphFilter} and {@link IGraphStoreFilter} filters to apply to the store.
- Filters are applied after the preset filtering is applied if present.
- Filters are applied sequentially against all nodes, as opposed to IAspect.visitor pattern which are sequentially applied per node.
focus
Optional
focus: IGraphFilterPlanFocusConfig
Config to focus the graph on specific node.
order
Optional
order: ConstructOrder
- Type: constructs.ConstructOrder
- Default: {ConstructOrder.PREORDER}
The order to visit nodes and edges during filtering.
preset
Optional
preset: FilterPreset
- Type: FilterPreset
Optional preset filter to apply before other filters.
IGraphFilterPlanFocusConfig
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.IGraphFilterPlanFocusConfig(
filter: IFilterFocusCallback,
no_hoist: bool = None
)
Properties
Name | Type | Description |
---|---|---|
filter |
IFilterFocusCallback |
The node or resolver to determine the node to focus on. |
no_hoist |
bool |
Indicates if ancestral containers are preserved (eg: Stages, Stack). |
filter
Required
filter: IFilterFocusCallback
- Type: IFilterFocusCallback
The node or resolver to determine the node to focus on.
no_hoist
Optional
no_hoist: bool
- Type: bool
- Default: true
Indicates if ancestral containers are preserved (eg: Stages, Stack).
If false
, the "focused node" will be hoisted to the graph root and all ancestors will be pruned.
If true
, the "focused" will be left in-place, while all siblings and non-scope ancestors will be pruned.
InferredNodeProps
Inferred node props.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.InferredNodeProps(
uuid: str,
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] = None,
flags: typing.List[FlagEnum] = None,
metadata: typing.List[MetadataEntry] = None,
tags: typing.Mapping[str] = None,
dependencies: typing.List[str],
unresolved_references: typing.List[SGUnresolvedReference],
cfn_type: str = None,
construct_info: ConstructInfo = None,
logical_id: str = None
)
Properties
Name | Type | Description |
---|---|---|
uuid |
str |
Universally unique identity. |
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Serializable entity attributes. |
flags |
typing.List[FlagEnum] |
Serializable entity flags. |
metadata |
typing.List[constructs.MetadataEntry] |
Serializable entity metadata. |
tags |
typing.Mapping[str] |
Serializable entity tags. |
dependencies |
typing.List[str] |
No description. |
unresolved_references |
typing.List[SGUnresolvedReference] |
No description. |
cfn_type |
str |
No description. |
construct_info |
ConstructInfo |
No description. |
logical_id |
str |
No description. |
uuid
Required
uuid: str
- Type: str
Universally unique identity.
attributes
Optional
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Serializable entity attributes.
flags
Optional
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Serializable entity flags.
metadata
Optional
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Serializable entity metadata.
tags
Optional
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Serializable entity tags.
dependencies
Required
dependencies: typing.List[str]
- Type: typing.List[str]
unresolved_references
Required
unresolved_references: typing.List[SGUnresolvedReference]
- Type: typing.List[SGUnresolvedReference]
cfn_type
Optional
cfn_type: str
- Type: str
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
logical_id
Optional
logical_id: str
- Type: str
PlainObject
Serializable plain object value (JSII supported).
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.PlainObject()
SGEdge
Serializable graph edge entity.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.SGEdge(
uuid: str,
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] = None,
flags: typing.List[FlagEnum] = None,
metadata: typing.List[MetadataEntry] = None,
tags: typing.Mapping[str] = None,
direction: EdgeDirectionEnum,
edge_type: EdgeTypeEnum,
source: str,
target: str
)
Properties
Name | Type | Description |
---|---|---|
uuid |
str |
Universally unique identity. |
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Serializable entity attributes. |
flags |
typing.List[FlagEnum] |
Serializable entity flags. |
metadata |
typing.List[constructs.MetadataEntry] |
Serializable entity metadata. |
tags |
typing.Mapping[str] |
Serializable entity tags. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
source |
str |
UUID of edge source node (tail). |
target |
str |
UUID of edge target node (head). |
uuid
Required
uuid: str
- Type: str
Universally unique identity.
attributes
Optional
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Serializable entity attributes.
flags
Optional
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Serializable entity flags.
metadata
Optional
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Serializable entity metadata.
tags
Optional
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Serializable entity tags.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
source
Required
source: str
- Type: str
UUID of edge source node (tail).
target
Required
target: str
- Type: str
UUID of edge target node (head).
SGEntity
Serializable graph entity.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.SGEntity(
uuid: str,
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] = None,
flags: typing.List[FlagEnum] = None,
metadata: typing.List[MetadataEntry] = None,
tags: typing.Mapping[str] = None
)
Properties
Name | Type | Description |
---|---|---|
uuid |
str |
Universally unique identity. |
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Serializable entity attributes. |
flags |
typing.List[FlagEnum] |
Serializable entity flags. |
metadata |
typing.List[constructs.MetadataEntry] |
Serializable entity metadata. |
tags |
typing.Mapping[str] |
Serializable entity tags. |
uuid
Required
uuid: str
- Type: str
Universally unique identity.
attributes
Optional
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Serializable entity attributes.
flags
Optional
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Serializable entity flags.
metadata
Optional
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Serializable entity metadata.
tags
Optional
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Serializable entity tags.
SGGraphStore
Serializable graph store.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.SGGraphStore(
edges: typing.List[SGEdge],
tree: SGNode,
version: str
)
Properties
Name | Type | Description |
---|---|---|
edges |
typing.List[SGEdge] |
List of edges. |
tree |
SGNode |
Node tree. |
version |
str |
Store version. |
edges
Required
edges: typing.List[SGEdge]
- Type: typing.List[SGEdge]
List of edges.
tree
Required
tree: SGNode
- Type: SGNode
Node tree.
version
Required
version: str
- Type: str
Store version.
SGNode
Serializable graph node entity.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.SGNode(
uuid: str,
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] = None,
flags: typing.List[FlagEnum] = None,
metadata: typing.List[MetadataEntry] = None,
tags: typing.Mapping[str] = None,
id: str,
node_type: NodeTypeEnum,
path: str,
cfn_type: str = None,
children: typing.Mapping[SGNode] = None,
construct_info: ConstructInfo = None,
edges: typing.List[str] = None,
logical_id: str = None,
parent: str = None,
stack: str = None
)
Properties
Name | Type | Description |
---|---|---|
uuid |
str |
Universally unique identity. |
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Serializable entity attributes. |
flags |
typing.List[FlagEnum] |
Serializable entity flags. |
metadata |
typing.List[constructs.MetadataEntry] |
Serializable entity metadata. |
tags |
typing.Mapping[str] |
Serializable entity tags. |
id |
str |
Node id within parent (unique only between parent child nodes). |
node_type |
NodeTypeEnum |
Node type. |
path |
str |
Node path. |
cfn_type |
str |
CloudFormation resource type for this node. |
children |
typing.Mapping[SGNode] |
Child node record. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
edges |
typing.List[str] |
List of edge UUIDs where this node is the source. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
str |
UUID of node parent. |
stack |
str |
UUID of node stack. |
uuid
Required
uuid: str
- Type: str
Universally unique identity.
attributes
Optional
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Serializable entity attributes.
flags
Optional
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Serializable entity flags.
metadata
Optional
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Serializable entity metadata.
tags
Optional
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Serializable entity tags.
id
Required
id: str
- Type: str
Node id within parent (unique only between parent child nodes).
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Node type.
path
Required
path: str
- Type: str
Node path.
cfn_type
Optional
cfn_type: str
- Type: str
CloudFormation resource type for this node.
children
Optional
children: typing.Mapping[SGNode]
- Type: typing.Mapping[SGNode]
Child node record.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
edges
Optional
edges: typing.List[str]
- Type: typing.List[str]
List of edge UUIDs where this node is the source.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: str
- Type: str
UUID of node parent.
stack
Optional
stack: str
- Type: str
UUID of node stack.
SGUnresolvedReference
Unresolved reference struct.
During graph computation references are unresolved and stored in this struct.
Initializer
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.SGUnresolvedReference(
reference_type: ReferenceTypeEnum,
source: str,
target: str,
value: typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]] = None
)
Properties
Name | Type | Description |
---|---|---|
reference_type |
ReferenceTypeEnum |
No description. |
source |
str |
No description. |
target |
str |
No description. |
value |
typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]] |
No description. |
reference_type
Required
reference_type: ReferenceTypeEnum
- Type: ReferenceTypeEnum
source
Required
source: str
- Type: str
target
Required
target: str
- Type: str
value
Optional
value: typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
- Type: typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Classes
AppNode
AppNode defines a cdk App.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AppNode(
props: IAppNodeProps
)
Name | Type | Description |
---|---|---|
props |
IAppNodeProps |
No description. |
props
Required
- Type: IAppNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
Indicates that this node must not have references.
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
Static Functions
Name | Description |
---|---|
is_app_node |
Indicates if node is a {@link AppNode}. |
is_app_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AppNode.is_app_node(
node: Node
)
Indicates if node is a {@link AppNode}.
node
Required
- Type: Node
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
Constants
Name | Type | Description |
---|---|---|
PATH |
str |
Fixed path of the App. |
UUID |
str |
Fixed UUID for App node. |
PATH
Required
PATH: str
- Type: str
Fixed path of the App.
UUID
Required
UUID: str
- Type: str
Fixed UUID for App node.
AttributeReference
Attribute type reference edge.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference(
props: IAttributeReferenceProps
)
Name | Type | Description |
---|---|---|
props |
IAttributeReferenceProps |
No description. |
props
Required
- Type: IAttributeReferenceProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the edge. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
is_equivalent |
Indicates if this edge is equivalent to another edge. |
mutate_consume |
Merge an equivalent edge's data into this edge and destroy the other edge. |
mutate_direction |
Change the edge direction. |
mutate_source |
Change the edge source. |
mutate_target |
Change the edge target. |
to_string |
Get string representation of this edge. |
resolve_chain |
Resolve reference chain. |
resolve_targets |
Resolve targets by following potential edge chain. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
_strict: bool = None
) -> None
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
is_equivalent
def is_equivalent(
edge: Edge
) -> bool
Indicates if this edge is equivalent to another edge.
Edges are considered equivalent if they share same type, source, and target.
edge
Required
- Type: Edge
mutate_consume
def mutate_consume(
edge: Edge
) -> None
Merge an equivalent edge's data into this edge and destroy the other edge.
Used during filtering operations to consolidate equivalent edges.
edge
Required
- Type: Edge
The edge to consume.
mutate_direction
def mutate_direction(
direction: EdgeDirectionEnum
) -> None
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutate_source
def mutate_source(
node: Node
) -> None
Change the edge source.
node
Required
- Type: Node
mutate_target
def mutate_target(
node: Node
) -> None
Change the edge target.
node
Required
- Type: Node
to_string
def to_string() -> str
Get string representation of this edge.
resolve_chain
def resolve_chain() -> typing.List[typing.Any]
Resolve reference chain.
resolve_targets
def resolve_targets() -> typing.List[Node]
Resolve targets by following potential edge chain.
Static Functions
Name | Description |
---|---|
find_all_in_chain |
Find all matching edges based on predicate within an EdgeChain. |
find_in_chain |
Find first edge matching predicate within an EdgeChain. |
is_ref |
Indicates if edge is a Ref based {@link Reference} edge. |
is_reference |
Indicates if edge is a {@link Reference}. |
is_att |
Indicates if edge in an Fn::GetAtt {@link Reference}. |
find_all_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference.find_all_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
find_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference.find_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
is_ref
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference.is_ref(
edge: Edge
)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
is_reference
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference.is_reference(
edge: Edge
)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
is_att
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.AttributeReference.is_att(
edge: Edge
)
Indicates if edge in an Fn::GetAtt {@link Reference}.
edge
Required
- Type: Edge
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if edge allows destructive mutations. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
is_closed |
bool |
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations). |
is_cross_stack |
bool |
Indicates if source and target nodes reside in different root stacks. |
is_extraneous |
bool |
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target). |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
reference_type |
ReferenceTypeEnum |
Get type of reference. |
value |
str |
Get the resolved attribute value. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if edge allows destructive mutations.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
is_closed
Required
is_closed: bool
- Type: bool
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
To check whether it was originally closed, use hasFlag(FlagEnum.CLOSED_EDGE)
instead.
is_cross_stack
Required
is_cross_stack: bool
- Type: bool
Indicates if source and target nodes reside in different root stacks.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).
source
Required
source: Node
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
target: Node
- Type: Node
Edge target is the node being referenced by the source (head).
reference_type
Required
reference_type: ReferenceTypeEnum
- Type: ReferenceTypeEnum
Get type of reference.
value
Required
value: str
- Type: str
Get the resolved attribute value.
Constants
Name | Type | Description |
---|---|---|
ATT_TYPE |
str |
Attribute defining the type of reference. |
PREFIX |
str |
Edge prefix to denote Fn::GetAtt type reference edge. |
ATT_VALUE |
str |
Attribute key for resolved value of attribute reference. |
ATT_TYPE
Required
ATT_TYPE: str
- Type: str
Attribute defining the type of reference.
PREFIX
Required
PREFIX: str
- Type: str
Edge prefix to denote Fn::GetAtt type reference edge.
ATT_VALUE
Required
ATT_VALUE: str
- Type: str
Attribute key for resolved value of attribute reference.
BaseEntity
- Implements: ISerializableEntity
Base class for all store entities (Node and Edges).
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.BaseEntity(
props: IBaseEntityProps
)
Name | Type | Description |
---|---|---|
props |
IBaseEntityProps |
No description. |
props
Required
- Type: IBaseEntityProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the entity be removing all references and removing from store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroy the entity be removing all references and removing from store.
strict
Optional
- Type: bool
If strict
, then entity must not have any references remaining when attempting to destroy.
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
CdkGraphContext
CdkGraph context.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CdkGraphContext(
store: Store,
outdir: str
)
Name | Type | Description |
---|---|---|
store |
Store |
No description. |
outdir |
str |
No description. |
store
Required
- Type: Store
outdir
Required
- Type: str
Methods
Name | Description |
---|---|
get_artifact |
Get CdkGraph artifact by id. |
has_artifact_file |
Indicates if context has an artifact with filename defined. |
log_artifact |
Logs an artifact entry. |
write_artifact |
Writes artifact data to outdir and logs the entry. |
get_artifact
def get_artifact(
id: str
) -> CdkGraphArtifact
Get CdkGraph artifact by id.
id
Required
- Type: str
has_artifact_file
def has_artifact_file(
filename: str
) -> bool
Indicates if context has an artifact with filename defined.
filename
Required
- Type: str
log_artifact
def log_artifact(
source: typing.Union[CdkGraph, ICdkGraphPlugin],
id: str,
filepath: str,
description: str = None
) -> CdkGraphArtifact
Logs an artifact entry.
In general this should not be called directly, as writeArtifact
should be utilized
to perform writing and logging artifacts. However some plugins utilize other tools that generate the artifacts,
in which case the plugin would call this method to log the entry.
source
Required
- Type: typing.Union[CdkGraph, ICdkGraphPlugin]
The source of the artifact, such as the name of plugin.
id
Required
- Type: str
Unique id of the artifact.
filepath
Required
- Type: str
Full path where the artifact is stored.
description
Optional
- Type: str
Description of the artifact.
write_artifact
def write_artifact(
source: typing.Union[CdkGraph, ICdkGraphPlugin],
id: str,
filename: str,
data: str,
description: str = None
) -> CdkGraphArtifact
Writes artifact data to outdir and logs the entry.
source
Required
- Type: typing.Union[CdkGraph, ICdkGraphPlugin]
The source of the artifact, such as the name of plugin.
id
Required
- Type: str
Unique id of the artifact.
filename
Required
- Type: str
Relative name of the file.
data
Required
- Type: str
description
Optional
- Type: str
Description of the artifact.
Properties
Name | Type | Description |
---|---|---|
artifacts |
typing.Mapping[CdkGraphArtifact] |
Get record of all graph artifacts keyed by artifact id. |
graph_json |
CdkGraphArtifact |
Get CdkGraph core graph.json artifact. |
outdir |
str |
No description. |
store |
Store |
No description. |
artifacts
Required
artifacts: typing.Mapping[CdkGraphArtifact]
- Type: typing.Mapping[CdkGraphArtifact]
Get record of all graph artifacts keyed by artifact id.
graph_json
Required
graph_json: CdkGraphArtifact
- Type: CdkGraphArtifact
Get CdkGraph core graph.json
artifact.
outdir
Required
outdir: str
- Type: str
store
Required
store: Store
- Type: Store
CfnResourceNode
CfnResourceNode defines an L1 cdk resource.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CfnResourceNode(
props: ICfnResourceNodeProps
)
Name | Type | Description |
---|---|---|
props |
ICfnResourceNodeProps |
No description. |
props
Required
- Type: ICfnResourceNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
is_equivalent_fqn |
Evaluates if CfnResourceNode fqn is equivalent to ResourceNode fqn. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
is_equivalent_fqn
def is_equivalent_fqn(
resource: ResourceNode
) -> bool
Evaluates if CfnResourceNode fqn is equivalent to ResourceNode fqn.
Example
# Example automatically generated from non-compiling source. May contain errors.
"aws-cdk-lib.aws_lambda.Function""aws-cdk-lib.aws_lambda.CfnFunction"
resource
Required
- Type: ResourceNode
{@link Graph.ResourceNode } to compare.
Static Functions
Name | Description |
---|---|
is_cfn_resource_node |
Indicates if a node is a {@link CfnResourceNode}. |
is_cfn_resource_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.CfnResourceNode.is_cfn_resource_node(
node: Node
)
Indicates if a node is a {@link CfnResourceNode}.
node
Required
- Type: Node
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
is_import |
bool |
Indicates if this CfnResource is imported (eg: s3.Bucket.fromBucketArn ). |
resource |
ResourceNode |
Reference to the L2 Resource that wraps this L1 CfnResource if it is wrapped. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
is_import
Required
is_import: bool
- Type: bool
Indicates if this CfnResource is imported (eg: s3.Bucket.fromBucketArn
).
resource
Optional
resource: ResourceNode
- Type: ResourceNode
Reference to the L2 Resource that wraps this L1 CfnResource if it is wrapped.
Constants
Name | Type | Description |
---|---|---|
ATT_IMPORT_ARN_TOKEN |
str |
Normalized CfnReference attribute. |
ATT_IMPORT_ARN_TOKEN
Required
ATT_IMPORT_ARN_TOKEN: str
- Type: str
Normalized CfnReference attribute.
Dependency
Dependency edge class defines CloudFormation dependency between resources.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Dependency(
props: ITypedEdgeProps
)
Name | Type | Description |
---|---|---|
props |
ITypedEdgeProps |
No description. |
props
Required
- Type: ITypedEdgeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the edge. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
is_equivalent |
Indicates if this edge is equivalent to another edge. |
mutate_consume |
Merge an equivalent edge's data into this edge and destroy the other edge. |
mutate_direction |
Change the edge direction. |
mutate_source |
Change the edge source. |
mutate_target |
Change the edge target. |
to_string |
Get string representation of this edge. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
_strict: bool = None
) -> None
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
is_equivalent
def is_equivalent(
edge: Edge
) -> bool
Indicates if this edge is equivalent to another edge.
Edges are considered equivalent if they share same type, source, and target.
edge
Required
- Type: Edge
mutate_consume
def mutate_consume(
edge: Edge
) -> None
Merge an equivalent edge's data into this edge and destroy the other edge.
Used during filtering operations to consolidate equivalent edges.
edge
Required
- Type: Edge
The edge to consume.
mutate_direction
def mutate_direction(
direction: EdgeDirectionEnum
) -> None
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutate_source
def mutate_source(
node: Node
) -> None
Change the edge source.
node
Required
- Type: Node
mutate_target
def mutate_target(
node: Node
) -> None
Change the edge target.
node
Required
- Type: Node
to_string
def to_string() -> str
Get string representation of this edge.
Static Functions
Name | Description |
---|---|
find_all_in_chain |
Find all matching edges based on predicate within an EdgeChain. |
find_in_chain |
Find first edge matching predicate within an EdgeChain. |
is_dependency |
Indicates if given edge is a {@link Dependency} edge. |
find_all_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Dependency.find_all_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
find_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Dependency.find_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
is_dependency
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Dependency.is_dependency(
edge: Edge
)
Indicates if given edge is a {@link Dependency} edge.
edge
Required
- Type: Edge
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if edge allows destructive mutations. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
is_closed |
bool |
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations). |
is_cross_stack |
bool |
Indicates if source and target nodes reside in different root stacks. |
is_extraneous |
bool |
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target). |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if edge allows destructive mutations.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
is_closed
Required
is_closed: bool
- Type: bool
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
To check whether it was originally closed, use hasFlag(FlagEnum.CLOSED_EDGE)
instead.
is_cross_stack
Required
is_cross_stack: bool
- Type: bool
Indicates if source and target nodes reside in different root stacks.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).
source
Required
source: Node
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
target: Node
- Type: Node
Edge target is the node being referenced by the source (head).
Constants
Name | Type | Description |
---|---|---|
PREFIX |
str |
Edge prefix to denote dependency edge. |
PREFIX
Required
PREFIX: str
- Type: str
Edge prefix to denote dependency edge.
Edge
- Implements: ISerializableEdge
Edge class defines a link (relationship) between nodes, as in standard graph theory.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Edge(
props: IEdgeProps
)
Name | Type | Description |
---|---|---|
props |
IEdgeProps |
No description. |
props
Required
- Type: IEdgeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the edge. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
is_equivalent |
Indicates if this edge is equivalent to another edge. |
mutate_consume |
Merge an equivalent edge's data into this edge and destroy the other edge. |
mutate_direction |
Change the edge direction. |
mutate_source |
Change the edge source. |
mutate_target |
Change the edge target. |
to_string |
Get string representation of this edge. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
_strict: bool = None
) -> None
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
is_equivalent
def is_equivalent(
edge: Edge
) -> bool
Indicates if this edge is equivalent to another edge.
Edges are considered equivalent if they share same type, source, and target.
edge
Required
- Type: Edge
mutate_consume
def mutate_consume(
edge: Edge
) -> None
Merge an equivalent edge's data into this edge and destroy the other edge.
Used during filtering operations to consolidate equivalent edges.
edge
Required
- Type: Edge
The edge to consume.
mutate_direction
def mutate_direction(
direction: EdgeDirectionEnum
) -> None
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutate_source
def mutate_source(
node: Node
) -> None
Change the edge source.
node
Required
- Type: Node
mutate_target
def mutate_target(
node: Node
) -> None
Change the edge target.
node
Required
- Type: Node
to_string
def to_string() -> str
Get string representation of this edge.
Static Functions
Name | Description |
---|---|
find_all_in_chain |
Find all matching edges based on predicate within an EdgeChain. |
find_in_chain |
Find first edge matching predicate within an EdgeChain. |
find_all_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Edge.find_all_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
find_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Edge.find_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if edge allows destructive mutations. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
is_closed |
bool |
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations). |
is_cross_stack |
bool |
Indicates if source and target nodes reside in different root stacks. |
is_extraneous |
bool |
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target). |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if edge allows destructive mutations.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
is_closed
Required
is_closed: bool
- Type: bool
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
To check whether it was originally closed, use hasFlag(FlagEnum.CLOSED_EDGE)
instead.
is_cross_stack
Required
is_cross_stack: bool
- Type: bool
Indicates if source and target nodes reside in different root stacks.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).
source
Required
source: Node
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
target: Node
- Type: Node
Edge target is the node being referenced by the source (head).
Filters
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters()
Name | Type | Description |
---|---|---|
Static Functions
Name | Description |
---|---|
collapse_cdk_owned_resources |
Collapses all Cdk Owned containers, which more closely mirrors the application code by removing resources that are automatically created by cdk. |
collapse_cdk_wrappers |
Collapses all Cdk Resource wrappers that wrap directly wrap a CfnResource. |
collapse_custom_resources |
Collapses Custom Resource nodes to a single node. |
compact |
Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges. |
exclude_cfn_type |
Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes matching specified list of CloudFormation types. |
exclude_node_type |
Prune all {@link Graph.Node}s matching specified list. |
include_cfn_type |
Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes except those matching specified list of CloudFormation types. |
include_node_type |
Prune all {@link Graph.Node}s except those matching specified list. |
prune_custom_resources |
Prune Custom Resource nodes. |
prune_empty_containers |
Prune empty containers, which are non-resource default nodes without any children. |
prune_extraneous |
Prune extraneous nodes and edges. |
uncluster |
Remove clusters by hoisting their children to the parent of the cluster and collapsing the cluster itself to its parent. |
verify_filterable |
Verify that store is filterable, meaning it allows destructive mutations. |
collapse_cdk_owned_resources
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.collapse_cdk_owned_resources()
Collapses all Cdk Owned containers, which more closely mirrors the application code by removing resources that are automatically created by cdk.
collapse_cdk_wrappers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.collapse_cdk_wrappers()
Collapses all Cdk Resource wrappers that wrap directly wrap a CfnResource.
Example, s3.Bucket wraps s3.CfnBucket.
collapse_custom_resources
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.collapse_custom_resources()
Collapses Custom Resource nodes to a single node.
compact
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.compact()
Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges.
This most closely represents the developers code for the current application and reduces the noise one expects.
Invokes: 1.
- pruneExtraneous()(store);
- collapseCdkOwnedResources()(store);
- collapseCdkWrappers()(store);
- collapseCustomResources()(store);
- ~pruneCustomResources()(store);~
- pruneEmptyContainers()(store);
exclude_cfn_type
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.exclude_cfn_type(
cfn_types: typing.List[FilterValue]
)
Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes matching specified list of CloudFormation types.
cfn_types
Required
- Type: typing.List[FilterValue]
exclude_node_type
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.exclude_node_type(
node_types: typing.List[FilterValue]
)
Prune all {@link Graph.Node}s matching specified list.
This filter targets all nodes (except root) - {@link IGraphFilter.allNodes}
node_types
Required
- Type: typing.List[FilterValue]
include_cfn_type
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.include_cfn_type(
cfn_types: typing.List[FilterValue]
)
Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes except those matching specified list of CloudFormation types.
cfn_types
Required
- Type: typing.List[FilterValue]
include_node_type
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.include_node_type(
node_types: typing.List[FilterValue]
)
Prune all {@link Graph.Node}s except those matching specified list.
This filter targets all nodes (except root) - {@link IGraphFilter.allNodes}
node_types
Required
- Type: typing.List[FilterValue]
prune_custom_resources
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.prune_custom_resources()
Prune Custom Resource nodes.
prune_empty_containers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.prune_empty_containers()
Prune empty containers, which are non-resource default nodes without any children.
Generally L3 constructs in which all children have already been pruned, which would be useful as containers, but without children are considered extraneous.
prune_extraneous
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.prune_extraneous()
Prune extraneous nodes and edges.
uncluster
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.uncluster(
cluster_types: typing.List[NodeTypeEnum] = None
)
Remove clusters by hoisting their children to the parent of the cluster and collapsing the cluster itself to its parent.
cluster_types
Optional
- Type: typing.List[NodeTypeEnum]
verify_filterable
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Filters.verify_filterable(
store: Store
)
Verify that store is filterable, meaning it allows destructive mutations.
store
Required
- Type: Store
ImportReference
Import reference defines Fn::ImportValue type reference edge.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference(
props: ITypedEdgeProps
)
Name | Type | Description |
---|---|---|
props |
ITypedEdgeProps |
No description. |
props
Required
- Type: ITypedEdgeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the edge. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
is_equivalent |
Indicates if this edge is equivalent to another edge. |
mutate_consume |
Merge an equivalent edge's data into this edge and destroy the other edge. |
mutate_direction |
Change the edge direction. |
mutate_source |
Change the edge source. |
mutate_target |
Change the edge target. |
to_string |
Get string representation of this edge. |
resolve_chain |
Resolve reference chain. |
resolve_targets |
Resolve targets by following potential edge chain. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
_strict: bool = None
) -> None
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
is_equivalent
def is_equivalent(
edge: Edge
) -> bool
Indicates if this edge is equivalent to another edge.
Edges are considered equivalent if they share same type, source, and target.
edge
Required
- Type: Edge
mutate_consume
def mutate_consume(
edge: Edge
) -> None
Merge an equivalent edge's data into this edge and destroy the other edge.
Used during filtering operations to consolidate equivalent edges.
edge
Required
- Type: Edge
The edge to consume.
mutate_direction
def mutate_direction(
direction: EdgeDirectionEnum
) -> None
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutate_source
def mutate_source(
node: Node
) -> None
Change the edge source.
node
Required
- Type: Node
mutate_target
def mutate_target(
node: Node
) -> None
Change the edge target.
node
Required
- Type: Node
to_string
def to_string() -> str
Get string representation of this edge.
resolve_chain
def resolve_chain() -> typing.List[typing.Any]
Resolve reference chain.
resolve_targets
def resolve_targets() -> typing.List[Node]
Resolve targets by following potential edge chain.
Static Functions
Name | Description |
---|---|
find_all_in_chain |
Find all matching edges based on predicate within an EdgeChain. |
find_in_chain |
Find first edge matching predicate within an EdgeChain. |
is_ref |
Indicates if edge is a Ref based {@link Reference} edge. |
is_reference |
Indicates if edge is a {@link Reference}. |
is_import |
Indicates if edge is Fn::ImportValue based {@link Reference}. |
find_all_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference.find_all_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
find_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference.find_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
is_ref
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference.is_ref(
edge: Edge
)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
is_reference
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference.is_reference(
edge: Edge
)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
is_import
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ImportReference.is_import(
edge: Edge
)
Indicates if edge is Fn::ImportValue based {@link Reference}.
edge
Required
- Type: Edge
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if edge allows destructive mutations. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
is_closed |
bool |
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations). |
is_cross_stack |
bool |
Indicates if source and target nodes reside in different root stacks. |
is_extraneous |
bool |
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target). |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
reference_type |
ReferenceTypeEnum |
Get type of reference. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if edge allows destructive mutations.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
is_closed
Required
is_closed: bool
- Type: bool
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
To check whether it was originally closed, use hasFlag(FlagEnum.CLOSED_EDGE)
instead.
is_cross_stack
Required
is_cross_stack: bool
- Type: bool
Indicates if source and target nodes reside in different root stacks.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).
source
Required
source: Node
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
target: Node
- Type: Node
Edge target is the node being referenced by the source (head).
reference_type
Required
reference_type: ReferenceTypeEnum
- Type: ReferenceTypeEnum
Get type of reference.
Constants
Name | Type | Description |
---|---|---|
ATT_TYPE |
str |
Attribute defining the type of reference. |
PREFIX |
str |
Edge prefix to denote Fn::ImportValue type reference edge. |
ATT_TYPE
Required
ATT_TYPE: str
- Type: str
Attribute defining the type of reference.
PREFIX
Required
PREFIX: str
- Type: str
Edge prefix to denote Fn::ImportValue type reference edge.
NestedStackNode
NestedStackNode defines a cdk NestedStack.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.NestedStackNode(
props: INestedStackNodeProps
)
Name | Type | Description |
---|---|---|
props |
INestedStackNodeProps |
No description. |
props
Required
- Type: INestedStackNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
add_output |
Associate {@link OutputNode} with this stack. |
add_parameter |
Associate {@link ParameterNode} with this stack. |
find_output |
Find {@link OutputNode} with logicalId defined by this stack. |
find_parameter |
Find {@link ParameterNode} with parameterId defined by this stack. |
mutate_remove_output |
Disassociate {@link OutputNode} from this stack. |
mutate_remove_parameter |
Disassociate {@link ParameterNode} from this stack. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
add_output
def add_output(
node: OutputNode
) -> None
Associate {@link OutputNode} with this stack.
node
Required
- Type: OutputNode
add_parameter
def add_parameter(
node: ParameterNode
) -> None
Associate {@link ParameterNode} with this stack.
node
Required
- Type: ParameterNode
find_output
def find_output(
logical_id: str
) -> OutputNode
Find {@link OutputNode} with logicalId defined by this stack.
logical_id
Required
- Type: str
find_parameter
def find_parameter(
parameter_id: str
) -> ParameterNode
Find {@link ParameterNode} with parameterId defined by this stack.
parameter_id
Required
- Type: str
mutate_remove_output
def mutate_remove_output(
node: OutputNode
) -> bool
Disassociate {@link OutputNode} from this stack.
node
Required
- Type: OutputNode
mutate_remove_parameter
def mutate_remove_parameter(
node: ParameterNode
) -> bool
Disassociate {@link ParameterNode} from this stack.
node
Required
- Type: ParameterNode
Static Functions
Name | Description |
---|---|
is_stack_node |
Indicates if node is a {@link StackNode}. |
of |
Gets the {@link StackNode} containing a given resource. |
is_nested_stack_node |
Indicates if node is a {@link NestedStackNode}. |
is_stack_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.NestedStackNode.is_stack_node(
node: Node
)
Indicates if node is a {@link StackNode}.
node
Required
- Type: Node
of
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.NestedStackNode.of(
node: Node
)
Gets the {@link StackNode} containing a given resource.
node
Required
- Type: Node
is_nested_stack_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.NestedStackNode.is_nested_stack_node(
node: Node
)
Indicates if node is a {@link NestedStackNode}.
node
Required
- Type: Node
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
exports |
typing.List[OutputNode] |
Get all exported {@link OutputNode}s defined by this stack. |
outputs |
typing.List[OutputNode] |
Get all {@link OutputNode}s defined by this stack. |
parameters |
typing.List[ParameterNode] |
Get all {@link ParameterNode}s defined by this stack. |
stage |
StageNode |
Get {@link StageNode} containing this stack. |
parent_stack |
StackNode |
Get parent stack of this nested stack. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
exports
Required
exports: typing.List[OutputNode]
- Type: typing.List[OutputNode]
Get all exported {@link OutputNode}s defined by this stack.
outputs
Required
outputs: typing.List[OutputNode]
- Type: typing.List[OutputNode]
Get all {@link OutputNode}s defined by this stack.
parameters
Required
parameters: typing.List[ParameterNode]
- Type: typing.List[ParameterNode]
Get all {@link ParameterNode}s defined by this stack.
stage
Optional
stage: StageNode
- Type: StageNode
Get {@link StageNode} containing this stack.
parent_stack
Optional
parent_stack: StackNode
- Type: StackNode
Get parent stack of this nested stack.
Node
- Implements: ISerializableNode
Node class is the base definition of node entities in the graph, as in standard graph theory.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Node(
props: INodeProps
)
Name | Type | Description |
---|---|---|
props |
INodeProps |
No description. |
props
Required
- Type: INodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
Indicates that this node must not have references.
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
OutputNode
OutputNode defines a cdk CfnOutput resources.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.OutputNode(
props: IOutputNodeProps
)
Name | Type | Description |
---|---|---|
props |
IOutputNodeProps |
No description. |
props
Required
- Type: IOutputNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
Static Functions
Name | Description |
---|---|
is_output_node |
Indicates if node is an {@link OutputNode}. |
is_output_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.OutputNode.is_output_node(
node: Node
)
Indicates if node is an {@link OutputNode}.
node
Required
- Type: Node
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
is_export |
bool |
Indicates if {@link OutputNode} is exported. |
value |
typing.Any |
Get the value* attribute. |
export_name |
str |
Get the export name attribute. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
is_export
Required
is_export: bool
- Type: bool
Indicates if {@link OutputNode} is exported.
value
Required
value: typing.Any
- Type: typing.Any
Get the value* attribute.
export_name
Optional
export_name: str
- Type: str
Get the export name attribute.
Constants
Name | Type | Description |
---|---|---|
ATTR_EXPORT_NAME |
str |
Attribute key where output export name is stored. |
ATTR_VALUE |
str |
Attribute key where output value is stored. |
ATTR_EXPORT_NAME
Required
ATTR_EXPORT_NAME: str
- Type: str
Attribute key where output export name is stored.
ATTR_VALUE
Required
ATTR_VALUE: str
- Type: str
Attribute key where output value is stored.
ParameterNode
ParameterNode defines a CfnParameter node.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ParameterNode(
props: IParameterNodeProps
)
Name | Type | Description |
---|---|---|
props |
IParameterNodeProps |
No description. |
props
Required
- Type: IParameterNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.
ancestor
Required
- Type: Node
mutate_collapse_to_parent
def mutate_collapse_to_parent() -> Node
Collapses this node into it's parent node.
mutate_hoist
def mutate_hoist(
new_parent: Node
) -> None
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
new_parent
Required
- Type: Node
mutate_move
def mutate_move(
new_parent: Node
) -> None
Move this node into a new parent node.
new_parent
Required
- Type: Node
The parent to move this node to.
mutate_remove_child
def mutate_remove_child(
node: Node
) -> bool
Remove a child node from this node.
node
Required
- Type: Node
mutate_remove_link
def mutate_remove_link(
link: Edge
) -> bool
Remove a link from this node.
link
Required
- Type: Edge
mutate_remove_reverse_link
def mutate_remove_reverse_link(
link: Edge
) -> bool
Remove a link to this node.
link
Required
- Type: Edge
mutate_uncluster
def mutate_uncluster() -> None
Hoist all children to parent and collapse node to parent.
to_string
def to_string() -> str
Get string representation of this node.
Static Functions
Name | Description |
---|---|
is_parameter_node |
Indicates if node is a {@link ParameterNode}. |
is_parameter_node
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ParameterNode.is_parameter_node(
node: Node
)
Indicates if node is a {@link ParameterNode}.
node
Required
- Type: Node
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if this node allows destructive mutations. |
children |
typing.List[Node] |
Get all direct child nodes. |
depended_on_by |
typing.List[Node] |
Get list of Nodes that depend on this node. |
dependencies |
typing.List[Node] |
Get list of Nodes that this node depends on. |
dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the source. |
depth |
typing.Union[int, float] |
Indicates the depth of the node relative to root (0). |
id |
str |
Node id, which is only unique within parent scope. |
is_asset |
bool |
Indicates if this node is considered a {@link FlagEnum.ASSET}. |
is_cfn_fqn |
bool |
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
is_cluster |
bool |
Indicates if this node is considered a {@link FlagEnum.CLUSTER}. |
is_custom_resource |
bool |
Indicates if node is a Custom Resource. |
is_extraneous |
bool |
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children. |
is_graph_container |
bool |
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}. |
is_leaf |
bool |
Indicates if this node is a leaf node, which means it does not have children. |
is_top_level |
bool |
Indicates if node is direct child of the graph root node. |
links |
typing.List[Edge] |
Gets all links (edges) in which this node is the source. |
node_type |
NodeTypeEnum |
Type of node. |
path |
str |
Path of the node. |
referenced_by |
typing.List[Node] |
Get list of Nodes that reference this node. |
reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the source. |
references |
typing.List[Node] |
Get list of Nodes that this node references. |
reverse_dependency_links |
typing.List[Dependency] |
Gets list of {@link Dependency} links (edges) where this node is the target. |
reverse_links |
typing.List[Edge] |
Gets all links (edges) in which this node is the target. |
reverse_reference_links |
typing.List[Reference] |
Gets list of {@link Reference} links (edges) where this node is the target. |
scopes |
typing.List[Node] |
Gets descending ordered list of ancestors from the root. |
siblings |
typing.List[Node] |
Get list of siblings of this node. |
cfn_props |
PlainObject |
Gets CloudFormation properties for this node. |
cfn_type |
str |
Get the CloudFormation resource type for this node. |
construct_info |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
construct_info_fqn |
str |
Synthesized construct information defining jii resolution data. |
logical_id |
str |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
root_stack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
is_stack_reference |
bool |
Indicates if parameter is a reference to a stack. |
parameter_type |
typing.Any |
Get the parameter type attribute. |
value |
typing.Any |
Get the value attribute. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if this node allows destructive mutations.
children
Required
children: typing.List[Node]
- Type: typing.List[Node]
Get all direct child nodes.
depended_on_by
Required
depended_on_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that depend on this node.
dependencies
Required
dependencies: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node depends on.
dependency_links
Required
dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
depth: typing.Union[int, float]
- Type: typing.Union[int, float]
Indicates the depth of the node relative to root (0).
id
Required
id: str
- Type: str
Node id, which is only unique within parent scope.
is_asset
Required
is_asset: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.ASSET}.
is_cfn_fqn
Required
is_cfn_fqn: bool
- Type: bool
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
is_cluster
Required
is_cluster: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
is_custom_resource
Required
is_custom_resource: bool
- Type: bool
Indicates if node is a Custom Resource.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
is_graph_container
Required
is_graph_container: bool
- Type: bool
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
is_leaf
Required
is_leaf: bool
- Type: bool
Indicates if this node is a leaf node, which means it does not have children.
is_top_level
Required
is_top_level: bool
- Type: bool
Indicates if node is direct child of the graph root node.
links
Required
links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the source.
node_type
Required
node_type: NodeTypeEnum
- Type: NodeTypeEnum
Type of node.
path
Required
path: str
- Type: str
Path of the node.
referenced_by
Required
referenced_by: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that reference this node.
reference_links
Required
reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
references: typing.List[Node]
- Type: typing.List[Node]
Get list of Nodes that this node references.
reverse_dependency_links
Required
reverse_dependency_links: typing.List[Dependency]
- Type: typing.List[Dependency]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverse_links
Required
reverse_links: typing.List[Edge]
- Type: typing.List[Edge]
Gets all links (edges) in which this node is the target.
reverse_reference_links
Required
reverse_reference_links: typing.List[Reference]
- Type: typing.List[Reference]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
scopes: typing.List[Node]
- Type: typing.List[Node]
Gets descending ordered list of ancestors from the root.
siblings
Required
siblings: typing.List[Node]
- Type: typing.List[Node]
Get list of siblings of this node.
cfn_props
Optional
cfn_props: PlainObject
- Type: PlainObject
Gets CloudFormation properties for this node.
cfn_type
Optional
cfn_type: str
- Type: str
Get the CloudFormation resource type for this node.
construct_info
Optional
construct_info: ConstructInfo
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
construct_info_fqn
Optional
construct_info_fqn: str
- Type: str
Synthesized construct information defining jii resolution data.
logical_id
Optional
logical_id: str
- Type: str
Logical id of the node, which is only unique within containing stack.
parent
Optional
parent: Node
- Type: Node
Parent node.
Only the root node should not have parent.
root_stack
Optional
root_stack: StackNode
- Type: StackNode
Get root stack.
stack
Optional
stack: StackNode
- Type: StackNode
Stack the node is contained in.
is_stack_reference
Required
is_stack_reference: bool
- Type: bool
Indicates if parameter is a reference to a stack.
parameter_type
Required
parameter_type: typing.Any
- Type: typing.Any
Get the parameter type attribute.
value
Required
value: typing.Any
- Type: typing.Any
Get the value attribute.
Constants
Name | Type | Description |
---|---|---|
ATTR_TYPE |
str |
Attribute key where parameter type is stored. |
ATTR_VALUE |
str |
Attribute key where parameter value is store. |
ATTR_TYPE
Required
ATTR_TYPE: str
- Type: str
Attribute key where parameter type is stored.
ATTR_VALUE
Required
ATTR_VALUE: str
- Type: str
Attribute key where parameter value is store.
Reference
Reference edge class defines a directed relationship between nodes.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Reference(
props: IReferenceProps
)
Name | Type | Description |
---|---|---|
props |
IReferenceProps |
No description. |
props
Required
- Type: IReferenceProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroy the edge. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
is_equivalent |
Indicates if this edge is equivalent to another edge. |
mutate_consume |
Merge an equivalent edge's data into this edge and destroy the other edge. |
mutate_direction |
Change the edge direction. |
mutate_source |
Change the edge source. |
mutate_target |
Change the edge target. |
to_string |
Get string representation of this edge. |
resolve_chain |
Resolve reference chain. |
resolve_targets |
Resolve targets by following potential edge chain. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
_strict: bool = None
) -> None
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: bool
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
is_equivalent
def is_equivalent(
edge: Edge
) -> bool
Indicates if this edge is equivalent to another edge.
Edges are considered equivalent if they share same type, source, and target.
edge
Required
- Type: Edge
mutate_consume
def mutate_consume(
edge: Edge
) -> None
Merge an equivalent edge's data into this edge and destroy the other edge.
Used during filtering operations to consolidate equivalent edges.
edge
Required
- Type: Edge
The edge to consume.
mutate_direction
def mutate_direction(
direction: EdgeDirectionEnum
) -> None
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutate_source
def mutate_source(
node: Node
) -> None
Change the edge source.
node
Required
- Type: Node
mutate_target
def mutate_target(
node: Node
) -> None
Change the edge target.
node
Required
- Type: Node
to_string
def to_string() -> str
Get string representation of this edge.
resolve_chain
def resolve_chain() -> typing.List[typing.Any]
Resolve reference chain.
resolve_targets
def resolve_targets() -> typing.List[Node]
Resolve targets by following potential edge chain.
Static Functions
Name | Description |
---|---|
find_all_in_chain |
Find all matching edges based on predicate within an EdgeChain. |
find_in_chain |
Find first edge matching predicate within an EdgeChain. |
is_ref |
Indicates if edge is a Ref based {@link Reference} edge. |
is_reference |
Indicates if edge is a {@link Reference}. |
find_all_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Reference.find_all_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
find_in_chain
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Reference.find_in_chain(
chain: typing.List[typing.Any],
predicate: IEdgePredicate
)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: typing.List[typing.Any]
predicate
Required
- Type: IEdgePredicate
is_ref
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Reference.is_ref(
edge: Edge
)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
is_reference
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.Reference.is_reference(
edge: Edge
)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
Properties
Name | Type | Description |
---|---|---|
attributes |
typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]] |
Get readonly record of all attributes. |
flags |
typing.List[FlagEnum] |
Get readonly list of all flags. |
is_destroyed |
bool |
Indicates if the entity has been destroyed (eg: removed from store). |
is_mutated |
bool |
Indicates if the entity has had destructive mutations applied. |
metadata |
typing.List[constructs.MetadataEntry] |
Get readonly list of all metadata entries. |
store |
Store |
Reference to the store. |
tags |
typing.Mapping[str] |
Get readonly record of all tags. |
uuid |
str |
Universally unique identifier. |
allow_destructive_mutations |
bool |
Indicates if edge allows destructive mutations. |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edge_type |
EdgeTypeEnum |
Type of edge. |
is_closed |
bool |
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations). |
is_cross_stack |
bool |
Indicates if source and target nodes reside in different root stacks. |
is_extraneous |
bool |
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target). |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
reference_type |
ReferenceTypeEnum |
Get type of reference. |
attributes
Required
attributes: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
- Type: typing.Mapping[typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]]
Get readonly record of all attributes.
flags
Required
flags: typing.List[FlagEnum]
- Type: typing.List[FlagEnum]
Get readonly list of all flags.
is_destroyed
Required
is_destroyed: bool
- Type: bool
Indicates if the entity has been destroyed (eg: removed from store).
is_mutated
Required
is_mutated: bool
- Type: bool
Indicates if the entity has had destructive mutations applied.
metadata
Required
metadata: typing.List[MetadataEntry]
- Type: typing.List[constructs.MetadataEntry]
Get readonly list of all metadata entries.
store
Required
store: Store
- Type: Store
Reference to the store.
tags
Required
tags: typing.Mapping[str]
- Type: typing.Mapping[str]
Get readonly record of all tags.
uuid
Required
uuid: str
- Type: str
Universally unique identifier.
allow_destructive_mutations
Required
allow_destructive_mutations: bool
- Type: bool
Indicates if edge allows destructive mutations.
direction
Required
direction: EdgeDirectionEnum
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edge_type
Required
edge_type: EdgeTypeEnum
- Type: EdgeTypeEnum
Type of edge.
is_closed
Required
is_closed: bool
- Type: bool
Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
To check whether it was originally closed, use hasFlag(FlagEnum.CLOSED_EDGE)
instead.
is_cross_stack
Required
is_cross_stack: bool
- Type: bool
Indicates if source and target nodes reside in different root stacks.
is_extraneous
Required
is_extraneous: bool
- Type: bool
Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).
source
Required
source: Node
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
target: Node
- Type: Node
Edge target is the node being referenced by the source (head).
reference_type
Required
reference_type: ReferenceTypeEnum
- Type: ReferenceTypeEnum
Get type of reference.
Constants
Name | Type | Description |
---|---|---|
ATT_TYPE |
str |
Attribute defining the type of reference. |
PREFIX |
str |
Edge prefix to denote Ref type reference edge. |
ATT_TYPE
Required
ATT_TYPE: str
- Type: str
Attribute defining the type of reference.
PREFIX
Required
PREFIX: str
- Type: str
Edge prefix to denote Ref type reference edge.
ResourceNode
ResourceNode class defines a L2 cdk resource construct.
Initializers
import aws.pdk.cdk_graph
aws.pdk.cdk_graph.ResourceNode(
props: IResourceNodeProps
)
Name | Type | Description |
---|---|---|
props |
IResourceNodeProps |
No description. |
props
Required
- Type: IResourceNodeProps
Methods
Name | Description |
---|---|
add_attribute |
Add attribute. |
add_flag |
Add flag. |
add_metadata |
Add metadata entry. |
add_tag |
Add tag. |
apply_data |
Applies data (attributes, metadata, tags, flag) to entity. |
find_metadata |
Retrieves all metadata entries of a given type. |
get_attribute |
Get attribute by key. |
get_tag |
Get tag by key. |
has_attribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
has_flag |
Indicates if entity has a given flag. |
has_metadata |
Indicates if entity has matching metadata entry. |
has_tag |
Indicates if entity has tag, optionally verifying tag value. |
mutate_destroy |
Destroys this node by removing all references and removing this node from the store. |
set_attribute |
Set attribute. |
set_tag |
Set tag. |
add_child |
Add child node. |
add_link |
Add link to another node. |
add_reverse_link |
Add link from another node. |
does_depend_on |
Indicates if this node depends on another node. |
does_reference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
find_all |
Return this construct and all of its sub-nodes in the given order. |
find_all_links |
Return all direct links of this node and that of all sub-nodes. |
find_ancestor |
Find nearest ancestor of this node matching given predicate. |
find_child |
Find child with given id. |
find_link |
Find link of this node based on predicate. |
find_links |
Find all links of this node based on predicate. |
get_cfn_prop |
Get specific CloudFormation property. |
get_child |
Get child node with given id. |
get_link_chains |
Resolve all link chains. |
get_nearest_ancestor |
Gets the nearest common ancestor shared between this node and another node. |
is_ancestor |
Indicates if a specific node is an ancestor of this node. |
is_child |
Indicates if specific node is a child of this node. |
mutate_collapse |
Collapses all sub-nodes of this node into this node. |
mutate_collapse_to |
Collapses this node into an ancestor. |
mutate_collapse_to_parent |
Collapses this node into it's parent node. |
mutate_hoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutate_move |
Move this node into a new parent node. |
mutate_remove_child |
Remove a child node from this node. |
mutate_remove_link |
Remove a link from this node. |
mutate_remove_reverse_link |
Remove a link to this node. |
mutate_uncluster |
Hoist all children to parent and collapse node to parent. |
to_string |
Get string representation of this node. |
mutate_cfn_resource |
Modifies the L1 resource wrapped by this L2 resource. |
add_attribute
def add_attribute(
key: str,
value: typing.Any
) -> None
Add attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
add_flag
def add_flag(
flag: FlagEnum
) -> None
Add flag.
flag
Required
- Type: FlagEnum
add_metadata
def add_metadata(
metadata_type: str,
data: typing.Any
) -> None
Add metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
add_tag
def add_tag(
key: str,
value: str
) -> None
Add tag.
key
Required
- Type: str
value
Required
- Type: str
apply_data
def apply_data(
data: IBaseEntityDataProps,
overwrite: bool = None,
apply_flags: bool = None
) -> None
Applies data (attributes, metadata, tags, flag) to entity.
Generally used only for mutations such as collapse and consume to retain data.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: bool
apply_flags
Optional
- Type: bool
Indicates if data is overwritten - Indicates if flags should be applied.
find_metadata
def find_metadata(
metadata_type: str
) -> typing.List[MetadataEntry]
Retrieves all metadata entries of a given type.
metadata_type
Required
- Type: str
get_attribute
def get_attribute(
key: str
) -> typing.Any
Get attribute by key.
key
Required
- Type: str
get_tag
def get_tag(
key: str
) -> str
Get tag by key.
key
Required
- Type: str
has_attribute
def has_attribute(
key: str,
value: typing.Any = None
) -> bool
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: str
value
Optional
- Type: typing.Any
has_flag
def has_flag(
flag: FlagEnum
) -> bool
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
has_metadata
def has_metadata(
metadata_type: str,
data: typing.Any
) -> bool
Indicates if entity has matching metadata entry.
metadata_type
Required
- Type: str
data
Required
- Type: typing.Any
has_tag
def has_tag(
key: str,
value: str = None
) -> bool
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: str
value
Optional
- Type: str
mutate_destroy
def mutate_destroy(
strict: bool = None
) -> None
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: bool
Indicates that this node must not have references.
set_attribute
def set_attribute(
key: str,
value: typing.Any
) -> None
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: str
value
Required
- Type: typing.Any
set_tag
def set_tag(
key: str,
value: str
) -> None
Set tag.
Will overwrite existing tag.
key
Required
- Type: str
value
Required
- Type: str
add_child
def add_child(
node: Node
) -> None
Add child node.
node
Required
- Type: Node
add_link
def add_link(
edge: Edge
) -> None
Add link to another node.
edge
Required
- Type: Edge
add_reverse_link
def add_reverse_link(
edge: Edge
) -> None
Add link from another node.
edge
Required
- Type: Edge
does_depend_on
def does_depend_on(
node: Node
) -> bool
Indicates if this node depends on another node.
node
Required
- Type: Node
does_reference
def does_reference(
node: Node
) -> bool
Indicates if this node references another node.
node
Required
- Type: Node
find
def find(
predicate: INodePredicate
) -> Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
find_all
def find_all(
options: IFindNodeOptions = None
) -> typing.List[Node]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate.
options
Optional
- Type: IFindNodeOptions
find_all_links
def find_all_links(
options: IFindEdgeOptions = None
) -> typing.List[Edge]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
find_ancestor
def find_ancestor(
predicate: INodePredicate,
max: typing.Union[int, float] = None
) -> Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- Type: typing.Union[int, float]
find_child
def find_child(
id: str
) -> Node
Find child with given id.
Similar to find
but does not throw error if no child found.
id
Required
- Type: str
find_link
def find_link(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> Edge
Find link of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct link of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
find_links
def find_links(
predicate: IEdgePredicate,
reverse: bool = None,
follow: bool = None,
direct: bool = None
) -> typing.List[Edge]
Find all links of this node based on predicate.
By default this will follow link chains to evaluate the predicate against and return the matching direct links of this node.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: bool
Indicates if links are search in reverse order.
follow
Optional
- Type: bool
Indicates if link chain is followed.
direct
Optional
- Type: bool
Indicates that only direct links should be searched.
get_cfn_prop
def get_cfn_prop(
key: str
) -> typing.Union[str, typing.Union[int, float], bool, PlainObject, typing.List[typing.Union[str, typing.Union[int, float], bool, PlainObject]]]
Get specific CloudFormation property.
key
Required
- Type: str
get_child
def get_child(
id: str
) -> Node
Get child node with given id.
id
Required
- Type: str
get_link_chains
def get_link_chains(
reverse: bool = None
) -> typing.List[typing.List[typing.Any]]
Resolve all link chains.
reverse
Optional
- Type: bool
get_nearest_ancestor
def get_nearest_ancestor(
node: Node
) -> Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
is_ancestor
def is_ancestor(
ancestor: Node
) -> bool
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
is_child
def is_child(
node: Node
) -> bool
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutate_collapse
def mutate_collapse() -> None
Collapses all sub-nodes of this node into this node.
mutate_collapse_to
def mutate_collapse_to(
ancestor: Node
) -> Node
Collapses this node into an ancestor.