Skip to content

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.

rootRequired
  • Type: constructs.Construct

pluginsOptional

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.

xRequired
  • 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.

nodeRequired
node: Node
  • Type: constructs.Node

The tree node.


configRequired
config: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

Config.


pluginsRequired
plugins: typing.List[ICdkGraphPlugin]

List of plugins registered with this instance.


rootRequired
root: Construct
  • Type: constructs.Construct

graph_contextOptional
graph_context: 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.

IDRequired
ID: str
  • Type: str

Fixed CdkGraph construct id.


VERSIONRequired
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.

filenameRequired
filename: str
  • Type: str

Filename of the artifact.


filepathRequired
filepath: str
  • Type: str

Full path where artifact is stored.


idRequired
id: str
  • Type: str

The unique type of the artifact.


sourceRequired
source: str
  • Type: str

The source of the artifact (such as plugin, or core system, etc).


descriptionOptional
description: str
  • Type: str

Description of artifact.


ConstructInfo

Source information on a construct (class fqn and version).

https://github.com/aws/aws-cdk/blob/cea1039e3664fdfa89c6f00cdaeb1a0185a12678/packages/%40aws-cdk/core/lib/private/runtime-info.ts#L22

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.

fqnRequired
fqn: str
  • Type: str

versionRequired
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.

regexOptional
regex: str
  • Type: str

String representation of a regex.


valueOptional
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.

pluginsOptional
plugins: 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.

graphOptional
graph: IGraphFilter

Graph Filter.


storeOptional
store: 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_nodesOptional
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}


edgeOptional
edge: IEdgePredicate

Predicate to match edges.

Edges are evaluated after nodes are filtered.


inverseOptional
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.


nodeOptional
node: INodePredicate

Predicate to match nodes.


strategyOptional
strategy: FilterStrategy

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_nodesOptional
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.


filtersOptional
filters: 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.

focusOptional
focus: IGraphFilterPlanFocusConfig

Config to focus the graph on specific node.


orderOptional
order: ConstructOrder
  • Type: constructs.ConstructOrder
  • Default: {ConstructOrder.PREORDER}

The order to visit nodes and edges during filtering.


presetOptional
preset: 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).

filterRequired
filter: IFilterFocusCallback

The node or resolver to determine the node to focus on.


no_hoistOptional
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.

uuidRequired
uuid: str
  • Type: str

Universally unique identity.


attributesOptional
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.

{@link Attributes }


flagsOptional
flags: typing.List[FlagEnum]

Serializable entity flags.

{@link FlagEnum }


metadataOptional
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Serializable entity metadata.

{@link Metadata }


tagsOptional
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Serializable entity tags.

{@link Tags }


dependenciesRequired
dependencies: typing.List[str]
  • Type: typing.List[str]

unresolved_referencesRequired
unresolved_references: typing.List[SGUnresolvedReference]

cfn_typeOptional
cfn_type: str
  • Type: str

construct_infoOptional
construct_info: ConstructInfo

logical_idOptional
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).

uuidRequired
uuid: str
  • Type: str

Universally unique identity.


attributesOptional
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.

{@link Attributes }


flagsOptional
flags: typing.List[FlagEnum]

Serializable entity flags.

{@link FlagEnum }


metadataOptional
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Serializable entity metadata.

{@link Metadata }


tagsOptional
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Serializable entity tags.

{@link Tags }


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


sourceRequired
source: str
  • Type: str

UUID of edge source node (tail).


targetRequired
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.

uuidRequired
uuid: str
  • Type: str

Universally unique identity.


attributesOptional
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.

{@link Attributes }


flagsOptional
flags: typing.List[FlagEnum]

Serializable entity flags.

{@link FlagEnum }


metadataOptional
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Serializable entity metadata.

{@link Metadata }


tagsOptional
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Serializable entity tags.

{@link 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.

edgesRequired
edges: typing.List[SGEdge]

List of edges.


treeRequired
tree: SGNode

Node tree.


versionRequired
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.

uuidRequired
uuid: str
  • Type: str

Universally unique identity.


attributesOptional
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.

{@link Attributes }


flagsOptional
flags: typing.List[FlagEnum]

Serializable entity flags.

{@link FlagEnum }


metadataOptional
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Serializable entity metadata.

{@link Metadata }


tagsOptional
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Serializable entity tags.

{@link Tags }


idRequired
id: str
  • Type: str

Node id within parent (unique only between parent child nodes).


node_typeRequired
node_type: NodeTypeEnum

Node type.


pathRequired
path: str
  • Type: str

Node path.


cfn_typeOptional
cfn_type: str
  • Type: str

CloudFormation resource type for this node.


childrenOptional
children: typing.Mapping[SGNode]
  • Type: typing.Mapping[SGNode]

Child node record.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


edgesOptional
edges: typing.List[str]
  • Type: typing.List[str]

List of edge UUIDs where this node is the source.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: str
  • Type: str

UUID of node parent.


stackOptional
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_typeRequired
reference_type: ReferenceTypeEnum

sourceRequired
source: str
  • Type: str

targetRequired
target: str
  • Type: str

valueOptional
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • 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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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}.

nodeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: 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.

PATHRequired
PATH: str
  • Type: str

Fixed path of the App.


UUIDRequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  _strict: bool = None
) -> None

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

edgeRequired

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.

edgeRequired

The edge to consume.


mutate_direction
def mutate_direction(
  direction: EdgeDirectionEnum
) -> None

Change the edge direction.

directionRequired

mutate_source
def mutate_source(
  node: Node
) -> None

Change the edge source.

nodeRequired

mutate_target
def mutate_target(
  node: Node
) -> None

Change the edge target.

nodeRequired

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.

{@link EdgeChain }

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

edgeRequired

is_reference
import aws.pdk.cdk_graph

aws.pdk.cdk_graph.AttributeReference.is_reference(
  edge: Edge
)

Indicates if edge is a {@link Reference}.

edgeRequired

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}.

edgeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if edge allows destructive mutations.


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


is_closedRequired
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_stackRequired
is_cross_stack: bool
  • Type: bool

Indicates if source and target nodes reside in different root stacks.


is_extraneousRequired
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).


sourceRequired
source: Node

Edge source is the node that defines the edge (tail).


targetRequired
target: Node

Edge target is the node being referenced by the source (head).


reference_typeRequired
reference_type: ReferenceTypeEnum

Get type of reference.


valueRequired
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_TYPERequired
ATT_TYPE: str
  • Type: str

Attribute defining the type of reference.


PREFIXRequired
PREFIX: str
  • Type: str

Edge prefix to denote Fn::GetAtt type reference edge.


ATT_VALUERequired
ATT_VALUE: str
  • Type: str

Attribute key for resolved value of attribute reference.


BaseEntity

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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  strict: bool = None
) -> None

Destroy the entity be removing all references and removing from store.

strictOptional
  • 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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
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.

storeRequired

outdirRequired
  • 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.

idRequired
  • Type: str

has_artifact_file
def has_artifact_file(
  filename: str
) -> bool

Indicates if context has an artifact with filename defined.

filenameRequired
  • 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.

sourceRequired

The source of the artifact, such as the name of plugin.


idRequired
  • Type: str

Unique id of the artifact.


filepathRequired
  • Type: str

Full path where the artifact is stored.


descriptionOptional
  • 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.

sourceRequired

The source of the artifact, such as the name of plugin.


idRequired
  • Type: str

Unique id of the artifact.


filenameRequired
  • Type: str

Relative name of the file.


dataRequired
  • Type: str

descriptionOptional
  • 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.

artifactsRequired
artifacts: typing.Mapping[CdkGraphArtifact]

Get record of all graph artifacts keyed by artifact id.


graph_jsonRequired
graph_json: CdkGraphArtifact

Get CdkGraph core graph.json artifact.


outdirRequired
outdir: str
  • Type: str

storeRequired
store: 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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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"
resourceRequired

{@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}.

nodeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: StackNode

Stack the node is contained in.


is_importRequired
is_import: bool
  • Type: bool

Indicates if this CfnResource is imported (eg: s3.Bucket.fromBucketArn).


resourceOptional
resource: 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_TOKENRequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  _strict: bool = None
) -> None

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

edgeRequired

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.

edgeRequired

The edge to consume.


mutate_direction
def mutate_direction(
  direction: EdgeDirectionEnum
) -> None

Change the edge direction.

directionRequired

mutate_source
def mutate_source(
  node: Node
) -> None

Change the edge source.

nodeRequired

mutate_target
def mutate_target(
  node: Node
) -> None

Change the edge target.

nodeRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

edgeRequired

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).

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if edge allows destructive mutations.


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


is_closedRequired
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_stackRequired
is_cross_stack: bool
  • Type: bool

Indicates if source and target nodes reside in different root stacks.


is_extraneousRequired
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).


sourceRequired
source: Node

Edge source is the node that defines the edge (tail).


targetRequired
target: Node

Edge target is the node being referenced by the source (head).


Constants

Name Type Description
PREFIX str Edge prefix to denote dependency edge.

PREFIXRequired
PREFIX: str
  • Type: str

Edge prefix to denote dependency edge.


Edge

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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  _strict: bool = None
) -> None

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

edgeRequired

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.

edgeRequired

The edge to consume.


mutate_direction
def mutate_direction(
  direction: EdgeDirectionEnum
) -> None

Change the edge direction.

directionRequired

mutate_source
def mutate_source(
  node: Node
) -> None

Change the edge source.

nodeRequired

mutate_target
def mutate_target(
  node: Node
) -> None

Change the edge target.

nodeRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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).

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if edge allows destructive mutations.


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


is_closedRequired
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_stackRequired
is_cross_stack: bool
  • Type: bool

Indicates if source and target nodes reside in different root stacks.


is_extraneousRequired
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).


sourceRequired
source: Node

Edge source is the node that defines the edge (tail).


targetRequired
target: 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.

  1. pruneExtraneous()(store);
  2. collapseCdkOwnedResources()(store);
  3. collapseCdkWrappers()(store);
  4. collapseCustomResources()(store);
  5. ~pruneCustomResources()(store);~
  6. 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_typesRequired

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_typesRequired

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_typesRequired

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_typesRequired

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.

{@link Graph.Node.mutateUncluster }

cluster_typesOptional

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.

storeRequired

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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  _strict: bool = None
) -> None

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

edgeRequired

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.

edgeRequired

The edge to consume.


mutate_direction
def mutate_direction(
  direction: EdgeDirectionEnum
) -> None

Change the edge direction.

directionRequired

mutate_source
def mutate_source(
  node: Node
) -> None

Change the edge source.

nodeRequired

mutate_target
def mutate_target(
  node: Node
) -> None

Change the edge target.

nodeRequired

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.

{@link EdgeChain }

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

edgeRequired

is_reference
import aws.pdk.cdk_graph

aws.pdk.cdk_graph.ImportReference.is_reference(
  edge: Edge
)

Indicates if edge is a {@link Reference}.

edgeRequired

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}.

edgeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if edge allows destructive mutations.


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


is_closedRequired
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_stackRequired
is_cross_stack: bool
  • Type: bool

Indicates if source and target nodes reside in different root stacks.


is_extraneousRequired
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).


sourceRequired
source: Node

Edge source is the node that defines the edge (tail).


targetRequired
target: Node

Edge target is the node being referenced by the source (head).


reference_typeRequired
reference_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_TYPERequired
ATT_TYPE: str
  • Type: str

Attribute defining the type of reference.


PREFIXRequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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.

nodeRequired

add_parameter
def add_parameter(
  node: ParameterNode
) -> None

Associate {@link ParameterNode} with this stack.

nodeRequired

find_output
def find_output(
  logical_id: str
) -> OutputNode

Find {@link OutputNode} with logicalId defined by this stack.

logical_idRequired
  • Type: str

find_parameter
def find_parameter(
  parameter_id: str
) -> ParameterNode

Find {@link ParameterNode} with parameterId defined by this stack.

parameter_idRequired
  • Type: str

mutate_remove_output
def mutate_remove_output(
  node: OutputNode
) -> bool

Disassociate {@link OutputNode} from this stack.

nodeRequired

mutate_remove_parameter
def mutate_remove_parameter(
  node: ParameterNode
) -> bool

Disassociate {@link ParameterNode} from this stack.

nodeRequired

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}.

nodeRequired

of
import aws.pdk.cdk_graph

aws.pdk.cdk_graph.NestedStackNode.of(
  node: Node
)

Gets the {@link StackNode} containing a given resource.

nodeRequired

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}.

nodeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: StackNode

Stack the node is contained in.


exportsRequired
exports: typing.List[OutputNode]

Get all exported {@link OutputNode}s defined by this stack.


outputsRequired
outputs: typing.List[OutputNode]

Get all {@link OutputNode}s defined by this stack.


parametersRequired
parameters: typing.List[ParameterNode]

Get all {@link ParameterNode}s defined by this stack.


stageOptional
stage: StageNode

Get {@link StageNode} containing this stack.


parent_stackOptional
parent_stack: StackNode

Get parent stack of this nested stack.


Node

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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • 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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: 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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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}.

nodeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: StackNode

Stack the node is contained in.


is_exportRequired
is_export: bool
  • Type: bool

Indicates if {@link OutputNode} is exported.


valueRequired
value: typing.Any
  • Type: typing.Any

Get the value* attribute.


export_nameOptional
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_NAMERequired
ATTR_EXPORT_NAME: str
  • Type: str

Attribute key where output export name is stored.


ATTR_VALUERequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired

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_parentRequired

mutate_move
def mutate_move(
  new_parent: Node
) -> None

Move this node into a new parent node.

new_parentRequired

The parent to move this node to.


mutate_remove_child
def mutate_remove_child(
  node: Node
) -> bool

Remove a child node from this node.

nodeRequired

def mutate_remove_link(
  link: Edge
) -> bool

Remove a link from this node.

linkRequired

def mutate_remove_reverse_link(
  link: Edge
) -> bool

Remove a link to this node.

linkRequired

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}.

nodeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
children: typing.List[Node]
  • Type: typing.List[Node]

Get all direct child nodes.


depended_on_byRequired
depended_on_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
dependencies: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependency_linksRequired
dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the source.


depthRequired
depth: typing.Union[int, float]
  • Type: typing.Union[int, float]

Indicates the depth of the node relative to root (0).


idRequired
id: str
  • Type: str

Node id, which is only unique within parent scope.


is_assetRequired
is_asset: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.ASSET}.


is_cfn_fqnRequired
is_cfn_fqn: bool
  • Type: bool

Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.

{@link FlagEnum.CFN_FQN }


is_clusterRequired
is_cluster: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.CLUSTER}.


is_custom_resourceRequired
is_custom_resource: bool
  • Type: bool

Indicates if node is a Custom Resource.


is_extraneousRequired
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_containerRequired
is_graph_container: bool
  • Type: bool

Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.


is_leafRequired
is_leaf: bool
  • Type: bool

Indicates if this node is a leaf node, which means it does not have children.


is_top_levelRequired
is_top_level: bool
  • Type: bool

Indicates if node is direct child of the graph root node.


linksRequired
links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the source.


node_typeRequired
node_type: NodeTypeEnum

Type of node.


pathRequired
path: str
  • Type: str

Path of the node.


referenced_byRequired
referenced_by: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


reference_linksRequired
reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the source.


referencesRequired
references: typing.List[Node]
  • Type: typing.List[Node]

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverse_dependency_linksRequired
reverse_dependency_links: typing.List[Dependency]

Gets list of {@link Dependency} links (edges) where this node is the target.


reverse_linksRequired
reverse_links: typing.List[Edge]
  • Type: typing.List[Edge]

Gets all links (edges) in which this node is the target.


reverse_reference_linksRequired
reverse_reference_links: typing.List[Reference]

Gets list of {@link Reference} links (edges) where this node is the target.


scopesRequired
scopes: typing.List[Node]
  • Type: typing.List[Node]

Gets descending ordered list of ancestors from the root.


siblingsRequired
siblings: typing.List[Node]
  • Type: typing.List[Node]

Get list of siblings of this node.


cfn_propsOptional
cfn_props: PlainObject

Gets CloudFormation properties for this node.


cfn_typeOptional
cfn_type: str
  • Type: str

Get the CloudFormation resource type for this node.


construct_infoOptional
construct_info: ConstructInfo

Synthesized construct information defining jii resolution data.


construct_info_fqnOptional
construct_info_fqn: str
  • Type: str

Synthesized construct information defining jii resolution data.


logical_idOptional
logical_id: str
  • Type: str

Logical id of the node, which is only unique within containing stack.


parentOptional
parent: Node

Parent node.

Only the root node should not have parent.


root_stackOptional
root_stack: StackNode

Get root stack.


stackOptional
stack: StackNode

Stack the node is contained in.


is_stack_referenceRequired
is_stack_reference: bool
  • Type: bool

Indicates if parameter is a reference to a stack.


parameter_typeRequired
parameter_type: typing.Any
  • Type: typing.Any

Get the parameter type attribute.


valueRequired
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_TYPERequired
ATTR_TYPE: str
  • Type: str

Attribute key where parameter type is stored.


ATTR_VALUERequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • Type: str

mutate_destroy
def mutate_destroy(
  _strict: bool = None
) -> None

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: bool

set_attribute
def set_attribute(
  key: str,
  value: typing.Any
) -> None

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • 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.

edgeRequired

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.

edgeRequired

The edge to consume.


mutate_direction
def mutate_direction(
  direction: EdgeDirectionEnum
) -> None

Change the edge direction.

directionRequired

mutate_source
def mutate_source(
  node: Node
) -> None

Change the edge source.

nodeRequired

mutate_target
def mutate_target(
  node: Node
) -> None

Change the edge target.

nodeRequired

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.

{@link EdgeChain }

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

chainRequired
  • Type: typing.List[typing.Any]

predicateRequired

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.

edgeRequired

is_reference
import aws.pdk.cdk_graph

aws.pdk.cdk_graph.Reference.is_reference(
  edge: Edge
)

Indicates if edge is a {@link Reference}.

edgeRequired

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.

attributesRequired
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.


flagsRequired
flags: typing.List[FlagEnum]

Get readonly list of all flags.


is_destroyedRequired
is_destroyed: bool
  • Type: bool

Indicates if the entity has been destroyed (eg: removed from store).


is_mutatedRequired
is_mutated: bool
  • Type: bool

Indicates if the entity has had destructive mutations applied.


metadataRequired
metadata: typing.List[MetadataEntry]
  • Type: typing.List[constructs.MetadataEntry]

Get readonly list of all metadata entries.


storeRequired
store: Store

Reference to the store.


tagsRequired
tags: typing.Mapping[str]
  • Type: typing.Mapping[str]

Get readonly record of all tags.


uuidRequired
uuid: str
  • Type: str

Universally unique identifier.


allow_destructive_mutationsRequired
allow_destructive_mutations: bool
  • Type: bool

Indicates if edge allows destructive mutations.


directionRequired
direction: EdgeDirectionEnum

Indicates the direction in which the edge is directed.


edge_typeRequired
edge_type: EdgeTypeEnum

Type of edge.


is_closedRequired
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_stackRequired
is_cross_stack: bool
  • Type: bool

Indicates if source and target nodes reside in different root stacks.


is_extraneousRequired
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).


sourceRequired
source: Node

Edge source is the node that defines the edge (tail).


targetRequired
target: Node

Edge target is the node being referenced by the source (head).


reference_typeRequired
reference_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_TYPERequired
ATT_TYPE: str
  • Type: str

Attribute defining the type of reference.


PREFIXRequired
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.

propsRequired

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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

add_flag
def add_flag(
  flag: FlagEnum
) -> None

Add flag.

flagRequired

add_metadata
def add_metadata(
  metadata_type: str,
  data: typing.Any
) -> None

Add metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

add_tag
def add_tag(
  key: str,
  value: str
) -> None

Add tag.

keyRequired
  • Type: str

valueRequired
  • 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.

dataRequired

The data to apply.


overwriteOptional
  • Type: bool

apply_flagsOptional
  • 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_typeRequired
  • Type: str

get_attribute
def get_attribute(
  key: str
) -> typing.Any

Get attribute by key.

keyRequired
  • Type: str

get_tag
def get_tag(
  key: str
) -> str

Get tag by key.

keyRequired
  • 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.

keyRequired
  • Type: str

valueOptional
  • Type: typing.Any

has_flag
def has_flag(
  flag: FlagEnum
) -> bool

Indicates if entity has a given flag.

flagRequired

has_metadata
def has_metadata(
  metadata_type: str,
  data: typing.Any
) -> bool

Indicates if entity has matching metadata entry.

metadata_typeRequired
  • Type: str

dataRequired
  • Type: typing.Any

has_tag
def has_tag(
  key: str,
  value: str = None
) -> bool

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: str

valueOptional
  • 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.

strictOptional
  • 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.

keyRequired
  • Type: str

valueRequired
  • Type: typing.Any

set_tag
def set_tag(
  key: str,
  value: str
) -> None

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: str

valueRequired
  • Type: str

add_child
def add_child(
  node: Node
) -> None

Add child node.

nodeRequired

def add_link(
  edge: Edge
) -> None

Add link to another node.

edgeRequired

def add_reverse_link(
  edge: Edge
) -> None

Add link from another node.

edgeRequired

does_depend_on
def does_depend_on(
  node: Node
) -> bool

Indicates if this node depends on another node.

nodeRequired

does_reference
def does_reference(
  node: Node
) -> bool

Indicates if this node references another node.

nodeRequired

find
def find(
  predicate: INodePredicate
) -> Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

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.

optionsOptional

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.

optionsOptional

find_ancestor
def find_ancestor(
  predicate: INodePredicate,
  max: typing.Union[int, float] = None
) -> Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • 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.

idRequired
  • Type: str

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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • Type: bool

Indicates that only direct links should be searched.


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.

predicateRequired

Edge predicate function to match edge.


reverseOptional
  • Type: bool

Indicates if links are search in reverse order.


followOptional
  • Type: bool

Indicates if link chain is followed.


directOptional
  • 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.

keyRequired
  • Type: str

get_child
def get_child(
  id: str
) -> Node

Get child node with given id.

idRequired
  • Type: str

def get_link_chains(
  reverse: bool = None
) -> typing.List[typing.List[typing.Any]]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: bool

get_nearest_ancestor
def get_nearest_ancestor(
  node: Node
) -> Node

Gets the nearest common ancestor shared between this node and another node.

nodeRequired

is_ancestor
def is_ancestor(
  ancestor: Node
) -> bool

Indicates if a specific node is an ancestor of this node.

ancestorRequired

is_child
def is_child(
  node: Node
) -> bool

Indicates if specific node is a child of this node.

nodeRequired

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.

ancestorRequired