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 { CdkGraph } from '@aws/pdk/cdk-graph'

new CdkGraph(root: Construct, props?: ICdkGraphProps)
Name Type Description
root constructs.Construct No description.
props ICdkGraphProps No description.

rootRequired
  • Type: constructs.Construct

propsOptional

Methods

Name Description
toString 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.

toString
public toString(): string

Returns a string representation of this construct.

report
public report(): void

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
isConstruct Checks if x is a construct.

isConstruct
import { CdkGraph } from '@aws/pdk/cdk-graph'

CdkGraph.isConstruct(x: 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: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
config {[ key: string ]: any} Config.
plugins ICdkGraphPlugin[] List of plugins registered with this instance.
root constructs.Construct No description.
graphContext CdkGraphContext Get the context for the graph instance.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


configRequired
public readonly config: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Config.


pluginsRequired
public readonly plugins: ICdkGraphPlugin[];

List of plugins registered with this instance.


rootRequired
public readonly root: Construct;
  • Type: constructs.Construct

graphContextOptional
public readonly graphContext: CdkGraphContext;

Get the context for the graph instance.

This will be undefined before construct synthesis has initiated.


Constants

Name Type Description
ID string Fixed CdkGraph construct id.
VERSION string Current CdkGraph semantic version.

IDRequired
public readonly ID: string;
  • Type: string

Fixed CdkGraph construct id.


VERSIONRequired
public readonly VERSION: string;
  • Type: string

Current CdkGraph semantic version.


Structs

CdkGraphArtifact

CdkGraph artifact definition.

Initializer

import { CdkGraphArtifact } from '@aws/pdk/cdk-graph'

const cdkGraphArtifact: CdkGraphArtifact = { ... }

Properties

Name Type Description
filename string Filename of the artifact.
filepath string Full path where artifact is stored.
id string The unique type of the artifact.
source string The source of the artifact (such as plugin, or core system, etc).
description string Description of artifact.

filenameRequired
public readonly filename: string;
  • Type: string

Filename of the artifact.


filepathRequired
public readonly filepath: string;
  • Type: string

Full path where artifact is stored.


idRequired
public readonly id: string;
  • Type: string

The unique type of the artifact.


sourceRequired
public readonly source: string;
  • Type: string

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


descriptionOptional
public readonly description: string;
  • Type: string

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 { ConstructInfo } from '@aws/pdk/cdk-graph'

const constructInfo: ConstructInfo = { ... }

Properties

Name Type Description
fqn string No description.
version string No description.

fqnRequired
public readonly fqn: string;
  • Type: string

versionRequired
public readonly version: string;
  • Type: string

FilterValue

Filter value to use.

Initializer

import { FilterValue } from '@aws/pdk/cdk-graph'

const filterValue: FilterValue = { ... }

Properties

Name Type Description
regex string String representation of a regex.
value string Raw value.

regexOptional
public readonly regex: string;
  • Type: string

String representation of a regex.


valueOptional
public readonly value: string;
  • Type: string

Raw value.


ICdkGraphProps

{@link CdkGraph} props.

Initializer

import { ICdkGraphProps } from '@aws/pdk/cdk-graph'

const iCdkGraphProps: ICdkGraphProps = { ... }

Properties

Name Type Description
plugins ICdkGraphPlugin[] List of plugins to extends the graph.

pluginsOptional
public readonly plugins: 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 { IFilter } from '@aws/pdk/cdk-graph'

const iFilter: IFilter = { ... }

Properties

Name Type Description
graph IGraphFilter Graph Filter.
store IGraphStoreFilter Store Filter.

graphOptional
public readonly graph: IGraphFilter;

Graph Filter.


storeOptional
public readonly store: IGraphStoreFilter;

Store Filter.


IGraphFilter

Graph filter.

Initializer

import { IGraphFilter } from '@aws/pdk/cdk-graph'

const iGraphFilter: IGraphFilter = { ... }

Properties

Name Type Description
allNodes boolean Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes.
edge IEdgePredicate Predicate to match edges.
inverse boolean 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.

allNodesOptional
public readonly allNodes: boolean;
  • Type: boolean

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
public readonly edge: IEdgePredicate;

Predicate to match edges.

Edges are evaluated after nodes are filtered.


inverseOptional
public readonly inverse: boolean;
  • Type: boolean
  • 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
public readonly node: INodePredicate;

Predicate to match nodes.


strategyOptional
public readonly 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 { IGraphFilterPlan } from '@aws/pdk/cdk-graph'

const iGraphFilterPlan: IGraphFilterPlan = { ... }

Properties

Name Type Description
allNodes boolean Indicates that all nodes will be filtered, rather than just Resource and CfnResource nodes.
filters 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.

allNodesOptional
public readonly allNodes: boolean;
  • Type: boolean
  • 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
public readonly filters: 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
public readonly focus: IGraphFilterPlanFocusConfig;

Config to focus the graph on specific node.


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

The order to visit nodes and edges during filtering.


presetOptional
public readonly preset: FilterPreset;

Optional preset filter to apply before other filters.


IGraphFilterPlanFocusConfig

Initializer

import { IGraphFilterPlanFocusConfig } from '@aws/pdk/cdk-graph'

const iGraphFilterPlanFocusConfig: IGraphFilterPlanFocusConfig = { ... }

Properties

Name Type Description
filter IFilterFocusCallback The node or resolver to determine the node to focus on.
noHoist boolean Indicates if ancestral containers are preserved (eg: Stages, Stack).

filterRequired
public readonly filter: IFilterFocusCallback;

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


noHoistOptional
public readonly noHoist: boolean;
  • Type: boolean
  • 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 { InferredNodeProps } from '@aws/pdk/cdk-graph'

const inferredNodeProps: InferredNodeProps = { ... }

Properties

Name Type Description
uuid string Universally unique identity.
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Serializable entity attributes.
flags FlagEnum[] Serializable entity flags.
metadata constructs.MetadataEntry[] Serializable entity metadata.
tags {[ key: string ]: string} Serializable entity tags.
dependencies string[] No description.
unresolvedReferences SGUnresolvedReference[] No description.
cfnType string No description.
constructInfo ConstructInfo No description.
logicalId string No description.

uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identity.


attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Serializable entity attributes.

{@link Attributes }


flagsOptional
public readonly flags: FlagEnum[];

Serializable entity flags.

{@link FlagEnum }


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Serializable entity metadata.

{@link Metadata }


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Serializable entity tags.

{@link Tags }


dependenciesRequired
public readonly dependencies: string[];
  • Type: string[]

unresolvedReferencesRequired
public readonly unresolvedReferences: SGUnresolvedReference[];

cfnTypeOptional
public readonly cfnType: string;
  • Type: string

constructInfoOptional
public readonly constructInfo: ConstructInfo;

logicalIdOptional
public readonly logicalId: string;
  • Type: string

PlainObject

Serializable plain object value (JSII supported).

Initializer

import { PlainObject } from '@aws/pdk/cdk-graph'

const plainObject: PlainObject = { ... }

SGEdge

Serializable graph edge entity.

Initializer

import { SGEdge } from '@aws/pdk/cdk-graph'

const sGEdge: SGEdge = { ... }

Properties

Name Type Description
uuid string Universally unique identity.
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Serializable entity attributes.
flags FlagEnum[] Serializable entity flags.
metadata constructs.MetadataEntry[] Serializable entity metadata.
tags {[ key: string ]: string} Serializable entity tags.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
source string UUID of edge source node (tail).
target string UUID of edge target node (head).

uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identity.


attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Serializable entity attributes.

{@link Attributes }


flagsOptional
public readonly flags: FlagEnum[];

Serializable entity flags.

{@link FlagEnum }


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Serializable entity metadata.

{@link Metadata }


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Serializable entity tags.

{@link Tags }


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


sourceRequired
public readonly source: string;
  • Type: string

UUID of edge source node (tail).


targetRequired
public readonly target: string;
  • Type: string

UUID of edge target node (head).


SGEntity

Serializable graph entity.

Initializer

import { SGEntity } from '@aws/pdk/cdk-graph'

const sGEntity: SGEntity = { ... }

Properties

Name Type Description
uuid string Universally unique identity.
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Serializable entity attributes.
flags FlagEnum[] Serializable entity flags.
metadata constructs.MetadataEntry[] Serializable entity metadata.
tags {[ key: string ]: string} Serializable entity tags.

uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identity.


attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Serializable entity attributes.

{@link Attributes }


flagsOptional
public readonly flags: FlagEnum[];

Serializable entity flags.

{@link FlagEnum }


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Serializable entity metadata.

{@link Metadata }


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Serializable entity tags.

{@link Tags }


SGGraphStore

Serializable graph store.

Initializer

import { SGGraphStore } from '@aws/pdk/cdk-graph'

const sGGraphStore: SGGraphStore = { ... }

Properties

Name Type Description
edges SGEdge[] List of edges.
tree SGNode Node tree.
version string Store version.

edgesRequired
public readonly edges: SGEdge[];

List of edges.


treeRequired
public readonly tree: SGNode;

Node tree.


versionRequired
public readonly version: string;
  • Type: string

Store version.


SGNode

Serializable graph node entity.

Initializer

import { SGNode } from '@aws/pdk/cdk-graph'

const sGNode: SGNode = { ... }

Properties

Name Type Description
uuid string Universally unique identity.
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Serializable entity attributes.
flags FlagEnum[] Serializable entity flags.
metadata constructs.MetadataEntry[] Serializable entity metadata.
tags {[ key: string ]: string} Serializable entity tags.
id string Node id within parent (unique only between parent child nodes).
nodeType NodeTypeEnum Node type.
path string Node path.
cfnType string CloudFormation resource type for this node.
children {[ key: string ]: SGNode} Child node record.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
edges string[] List of edge UUIDs where this node is the source.
logicalId string Logical id of the node, which is only unique within containing stack.
parent string UUID of node parent.
stack string UUID of node stack.

uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identity.


attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Serializable entity attributes.

{@link Attributes }


flagsOptional
public readonly flags: FlagEnum[];

Serializable entity flags.

{@link FlagEnum }


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Serializable entity metadata.

{@link Metadata }


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Serializable entity tags.

{@link Tags }


idRequired
public readonly id: string;
  • Type: string

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Node type.


pathRequired
public readonly path: string;
  • Type: string

Node path.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

CloudFormation resource type for this node.


childrenOptional
public readonly children: {[ key: string ]: SGNode};
  • Type: {[ key: string ]: SGNode}

Child node record.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


edgesOptional
public readonly edges: string[];
  • Type: string[]

List of edge UUIDs where this node is the source.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: string;
  • Type: string

UUID of node parent.


stackOptional
public readonly stack: string;
  • Type: string

UUID of node stack.


SGUnresolvedReference

Unresolved reference struct.

During graph computation references are unresolved and stored in this struct.

Initializer

import { SGUnresolvedReference } from '@aws/pdk/cdk-graph'

const sGUnresolvedReference: SGUnresolvedReference = { ... }

Properties

Name Type Description
referenceType ReferenceTypeEnum No description.
source string No description.
target string No description.
value string | number | boolean | PlainObject | string | number | boolean | PlainObject[] No description.

referenceTypeRequired
public readonly referenceType: ReferenceTypeEnum;

sourceRequired
public readonly source: string;
  • Type: string

targetRequired
public readonly target: string;
  • Type: string

valueOptional
public readonly value: string | number | boolean | PlainObject | string | number | boolean | PlainObject[];

Classes

AppNode

AppNode defines a cdk App.

Initializers

import { AppNode } from '@aws/pdk/cdk-graph'

new AppNode(props: IAppNodeProps)
Name Type Description
props IAppNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

Indicates that this node must not have references.


setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

Static Functions

Name Description
isAppNode Indicates if node is a {@link AppNode}.

isAppNode
import { AppNode } from '@aws/pdk/cdk-graph'

AppNode.isAppNode(node: Node)

Indicates if node is a {@link AppNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


Constants

Name Type Description
PATH string Fixed path of the App.
UUID string Fixed UUID for App node.

PATHRequired
public readonly PATH: string;
  • Type: string

Fixed path of the App.


UUIDRequired
public readonly UUID: string;
  • Type: string

Fixed UUID for App node.


AttributeReference

Attribute type reference edge.

Initializers

import { AttributeReference } from '@aws/pdk/cdk-graph'

new AttributeReference(props: IAttributeReferenceProps)
Name Type Description
props IAttributeReferenceProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the edge.
setAttribute Set attribute.
setTag Set tag.
isEquivalent Indicates if this edge is equivalent to another edge.
mutateConsume Merge an equivalent edge's data into this edge and destroy the other edge.
mutateDirection Change the edge direction.
mutateSource Change the edge source.
mutateTarget Change the edge target.
toString Get string representation of this edge.
resolveChain Resolve reference chain.
resolveTargets Resolve targets by following potential edge chain.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

isEquivalent
public isEquivalent(edge: Edge): boolean

Indicates if this edge is equivalent to another edge.

Edges are considered equivalent if they share same type, source, and target.

edgeRequired

mutateConsume
public mutateConsume(edge: Edge): void

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.


mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void

Change the edge direction.

directionRequired

mutateSource
public mutateSource(node: Node): void

Change the edge source.

nodeRequired

mutateTarget
public mutateTarget(node: Node): void

Change the edge target.

nodeRequired

toString
public toString(): string

Get string representation of this edge.

resolveChain
public resolveChain(): any[]

Resolve reference chain.

resolveTargets
public resolveTargets(): Node[]

Resolve targets by following potential edge chain.

{@link EdgeChain }

Static Functions

Name Description
findAllInChain Find all matching edges based on predicate within an EdgeChain.
findInChain Find first edge matching predicate within an EdgeChain.
isRef Indicates if edge is a Ref based {@link Reference} edge.
isReference Indicates if edge is a {@link Reference}.
isAtt Indicates if edge in an Fn::GetAtt {@link Reference}.

findAllInChain
import { AttributeReference } from '@aws/pdk/cdk-graph'

AttributeReference.findAllInChain(chain: any[], predicate: IEdgePredicate)

Find all matching edges based on predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

findInChain
import { AttributeReference } from '@aws/pdk/cdk-graph'

AttributeReference.findInChain(chain: any[], predicate: IEdgePredicate)

Find first edge matching predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

isRef
import { AttributeReference } from '@aws/pdk/cdk-graph'

AttributeReference.isRef(edge: Edge)

Indicates if edge is a Ref based {@link Reference} edge.

edgeRequired

isReference
import { AttributeReference } from '@aws/pdk/cdk-graph'

AttributeReference.isReference(edge: Edge)

Indicates if edge is a {@link Reference}.

edgeRequired

isAtt
import { AttributeReference } from '@aws/pdk/cdk-graph'

AttributeReference.isAtt(edge: Edge)

Indicates if edge in an Fn::GetAtt {@link Reference}.

edgeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if edge allows destructive mutations.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
isClosed boolean Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
isCrossStack boolean Indicates if source and target nodes reside in different root stacks.
isExtraneous boolean 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).
referenceType ReferenceTypeEnum Get type of reference.
value string Get the resolved attribute value.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if edge allows destructive mutations.


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


isClosedRequired
public readonly isClosed: boolean;
  • Type: boolean

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.


isCrossStackRequired
public readonly isCrossStack: boolean;
  • Type: boolean

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


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


referenceTypeRequired
public readonly referenceType: ReferenceTypeEnum;

Get type of reference.


valueRequired
public readonly value: string;
  • Type: string

Get the resolved attribute value.


Constants

Name Type Description
ATT_TYPE string Attribute defining the type of reference.
PREFIX string Edge prefix to denote Fn::GetAtt type reference edge.
ATT_VALUE string Attribute key for resolved value of attribute reference.

ATT_TYPERequired
public readonly ATT_TYPE: string;
  • Type: string

Attribute defining the type of reference.


PREFIXRequired
public readonly PREFIX: string;
  • Type: string

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


ATT_VALUERequired
public readonly ATT_VALUE: string;
  • Type: string

Attribute key for resolved value of attribute reference.


BaseEntity

Base class for all store entities (Node and Edges).

Initializers

import { BaseEntity } from '@aws/pdk/cdk-graph'

new BaseEntity(props: IBaseEntityProps)
Name Type Description
props IBaseEntityProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the entity be removing all references and removing from store.
setAttribute Set attribute.
setTag Set tag.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

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

strictOptional
  • Type: boolean

If strict, then entity must not have any references remaining when attempting to destroy.


setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


CdkGraphContext

CdkGraph context.

Initializers

import { CdkGraphContext } from '@aws/pdk/cdk-graph'

new CdkGraphContext(store: Store, outdir: string)
Name Type Description
store Store No description.
outdir string No description.

storeRequired

outdirRequired
  • Type: string

Methods

Name Description
getArtifact Get CdkGraph artifact by id.
hasArtifactFile Indicates if context has an artifact with filename defined.
logArtifact Logs an artifact entry.
writeArtifact Writes artifact data to outdir and logs the entry.

getArtifact
public getArtifact(id: string): CdkGraphArtifact

Get CdkGraph artifact by id.

idRequired
  • Type: string

hasArtifactFile
public hasArtifactFile(filename: string): boolean

Indicates if context has an artifact with filename defined.

filenameRequired
  • Type: string

logArtifact
public logArtifact(source: CdkGraph | ICdkGraphPlugin, id: string, filepath: string, description?: string): 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: string

Unique id of the artifact.


filepathRequired
  • Type: string

Full path where the artifact is stored.


descriptionOptional
  • Type: string

Description of the artifact.


writeArtifact
public writeArtifact(source: CdkGraph | ICdkGraphPlugin, id: string, filename: string, data: string, description?: string): CdkGraphArtifact

Writes artifact data to outdir and logs the entry.

sourceRequired

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


idRequired
  • Type: string

Unique id of the artifact.


filenameRequired
  • Type: string

Relative name of the file.


dataRequired
  • Type: string

descriptionOptional
  • Type: string

Description of the artifact.


Properties

Name Type Description
artifacts {[ key: string ]: CdkGraphArtifact} Get record of all graph artifacts keyed by artifact id.
graphJson CdkGraphArtifact Get CdkGraph core graph.json artifact.
outdir string No description.
store Store No description.

artifactsRequired
public readonly artifacts: {[ key: string ]: CdkGraphArtifact};

Get record of all graph artifacts keyed by artifact id.


graphJsonRequired
public readonly graphJson: CdkGraphArtifact;

Get CdkGraph core graph.json artifact.


outdirRequired
public readonly outdir: string;
  • Type: string

storeRequired
public readonly store: Store;

CfnResourceNode

CfnResourceNode defines an L1 cdk resource.

Initializers

import { CfnResourceNode } from '@aws/pdk/cdk-graph'

new CfnResourceNode(props: ICfnResourceNodeProps)
Name Type Description
props ICfnResourceNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.
isEquivalentFqn Evaluates if CfnResourceNode fqn is equivalent to ResourceNode fqn.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

isEquivalentFqn
public isEquivalentFqn(resource: ResourceNode): boolean

Evaluates if CfnResourceNode fqn is equivalent to ResourceNode fqn.

Example

`aws-cdk-lib.aws_lambda.Function` => `aws-cdk-lib.aws_lambda.CfnFunction`
resourceRequired

{@link Graph.ResourceNode } to compare.


Static Functions

Name Description
isCfnResourceNode Indicates if a node is a {@link CfnResourceNode}.

isCfnResourceNode
import { CfnResourceNode } from '@aws/pdk/cdk-graph'

CfnResourceNode.isCfnResourceNode(node: Node)

Indicates if a node is a {@link CfnResourceNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
isImport boolean 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
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


isImportRequired
public readonly isImport: boolean;
  • Type: boolean

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


resourceOptional
public readonly resource: ResourceNode;

Reference to the L2 Resource that wraps this L1 CfnResource if it is wrapped.


Constants

Name Type Description
ATT_IMPORT_ARN_TOKEN string Normalized CfnReference attribute.

ATT_IMPORT_ARN_TOKENRequired
public readonly ATT_IMPORT_ARN_TOKEN: string;
  • Type: string

Normalized CfnReference attribute.


Dependency

Dependency edge class defines CloudFormation dependency between resources.

Initializers

import { Dependency } from '@aws/pdk/cdk-graph'

new Dependency(props: ITypedEdgeProps)
Name Type Description
props ITypedEdgeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the edge.
setAttribute Set attribute.
setTag Set tag.
isEquivalent Indicates if this edge is equivalent to another edge.
mutateConsume Merge an equivalent edge's data into this edge and destroy the other edge.
mutateDirection Change the edge direction.
mutateSource Change the edge source.
mutateTarget Change the edge target.
toString Get string representation of this edge.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

isEquivalent
public isEquivalent(edge: Edge): boolean

Indicates if this edge is equivalent to another edge.

Edges are considered equivalent if they share same type, source, and target.

edgeRequired

mutateConsume
public mutateConsume(edge: Edge): void

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.


mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void

Change the edge direction.

directionRequired

mutateSource
public mutateSource(node: Node): void

Change the edge source.

nodeRequired

mutateTarget
public mutateTarget(node: Node): void

Change the edge target.

nodeRequired

toString
public toString(): string

Get string representation of this edge.

Static Functions

Name Description
findAllInChain Find all matching edges based on predicate within an EdgeChain.
findInChain Find first edge matching predicate within an EdgeChain.
isDependency Indicates if given edge is a {@link Dependency} edge.

findAllInChain
import { Dependency } from '@aws/pdk/cdk-graph'

Dependency.findAllInChain(chain: any[], predicate: IEdgePredicate)

Find all matching edges based on predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

findInChain
import { Dependency } from '@aws/pdk/cdk-graph'

Dependency.findInChain(chain: any[], predicate: IEdgePredicate)

Find first edge matching predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

isDependency
import { Dependency } from '@aws/pdk/cdk-graph'

Dependency.isDependency(edge: Edge)

Indicates if given edge is a {@link Dependency} edge.

edgeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if edge allows destructive mutations.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
isClosed boolean Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
isCrossStack boolean Indicates if source and target nodes reside in different root stacks.
isExtraneous boolean 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
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if edge allows destructive mutations.


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


isClosedRequired
public readonly isClosed: boolean;
  • Type: boolean

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.


isCrossStackRequired
public readonly isCrossStack: boolean;
  • Type: boolean

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


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


Constants

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

PREFIXRequired
public readonly PREFIX: string;
  • Type: string

Edge prefix to denote dependency edge.


Edge

Edge class defines a link (relationship) between nodes, as in standard graph theory.

Initializers

import { Edge } from '@aws/pdk/cdk-graph'

new Edge(props: IEdgeProps)
Name Type Description
props IEdgeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the edge.
setAttribute Set attribute.
setTag Set tag.
isEquivalent Indicates if this edge is equivalent to another edge.
mutateConsume Merge an equivalent edge's data into this edge and destroy the other edge.
mutateDirection Change the edge direction.
mutateSource Change the edge source.
mutateTarget Change the edge target.
toString Get string representation of this edge.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

isEquivalent
public isEquivalent(edge: Edge): boolean

Indicates if this edge is equivalent to another edge.

Edges are considered equivalent if they share same type, source, and target.

edgeRequired

mutateConsume
public mutateConsume(edge: Edge): void

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.


mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void

Change the edge direction.

directionRequired

mutateSource
public mutateSource(node: Node): void

Change the edge source.

nodeRequired

mutateTarget
public mutateTarget(node: Node): void

Change the edge target.

nodeRequired

toString
public toString(): string

Get string representation of this edge.

Static Functions

Name Description
findAllInChain Find all matching edges based on predicate within an EdgeChain.
findInChain Find first edge matching predicate within an EdgeChain.

findAllInChain
import { Edge } from '@aws/pdk/cdk-graph'

Edge.findAllInChain(chain: any[], predicate: IEdgePredicate)

Find all matching edges based on predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

findInChain
import { Edge } from '@aws/pdk/cdk-graph'

Edge.findInChain(chain: any[], predicate: IEdgePredicate)

Find first edge matching predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if edge allows destructive mutations.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
isClosed boolean Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
isCrossStack boolean Indicates if source and target nodes reside in different root stacks.
isExtraneous boolean 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
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if edge allows destructive mutations.


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


isClosedRequired
public readonly isClosed: boolean;
  • Type: boolean

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.


isCrossStackRequired
public readonly isCrossStack: boolean;
  • Type: boolean

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


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


Filters

Initializers

import { Filters } from '@aws/pdk/cdk-graph'

new Filters()
Name Type Description

Static Functions

Name Description
collapseCdkOwnedResources Collapses all Cdk Owned containers, which more closely mirrors the application code by removing resources that are automatically created by cdk.
collapseCdkWrappers Collapses all Cdk Resource wrappers that wrap directly wrap a CfnResource.
collapseCustomResources Collapses Custom Resource nodes to a single node.
compact Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges.
excludeCfnType Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes matching specified list of CloudFormation types.
excludeNodeType Prune all {@link Graph.Node}s matching specified list.
includeCfnType Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes except those matching specified list of CloudFormation types.
includeNodeType Prune all {@link Graph.Node}s except those matching specified list.
pruneCustomResources Prune Custom Resource nodes.
pruneEmptyContainers Prune empty containers, which are non-resource default nodes without any children.
pruneExtraneous 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.
verifyFilterable Verify that store is filterable, meaning it allows destructive mutations.

collapseCdkOwnedResources
import { Filters } from '@aws/pdk/cdk-graph'

Filters.collapseCdkOwnedResources()

Collapses all Cdk Owned containers, which more closely mirrors the application code by removing resources that are automatically created by cdk.

collapseCdkWrappers
import { Filters } from '@aws/pdk/cdk-graph'

Filters.collapseCdkWrappers()

Collapses all Cdk Resource wrappers that wrap directly wrap a CfnResource.

Example, s3.Bucket wraps s3.CfnBucket.

collapseCustomResources
import { Filters } from '@aws/pdk/cdk-graph'

Filters.collapseCustomResources()

Collapses Custom Resource nodes to a single node.

compact
import { Filters } from '@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); 1. collapseCdkOwnedResources()(store); 1. collapseCdkWrappers()(store); 1. collapseCustomResources()(store); 1. ~pruneCustomResources()(store);~ 1. pruneEmptyContainers()(store);

excludeCfnType
import { Filters } from '@aws/pdk/cdk-graph'

Filters.excludeCfnType(cfnTypes: FilterValue[])

Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes matching specified list of CloudFormation types.

cfnTypesRequired

excludeNodeType
import { Filters } from '@aws/pdk/cdk-graph'

Filters.excludeNodeType(nodeTypes: FilterValue[])

Prune all {@link Graph.Node}s matching specified list.

This filter targets all nodes (except root) - {@link IGraphFilter.allNodes}

nodeTypesRequired

includeCfnType
import { Filters } from '@aws/pdk/cdk-graph'

Filters.includeCfnType(cfnTypes: FilterValue[])

Prune all {@link Graph.ResourceNode} and {@link Graph.CfnResourceNode} nodes except those matching specified list of CloudFormation types.

cfnTypesRequired

includeNodeType
import { Filters } from '@aws/pdk/cdk-graph'

Filters.includeNodeType(nodeTypes: FilterValue[])

Prune all {@link Graph.Node}s except those matching specified list.

This filter targets all nodes (except root) - {@link IGraphFilter.allNodes}

nodeTypesRequired

pruneCustomResources
import { Filters } from '@aws/pdk/cdk-graph'

Filters.pruneCustomResources()

Prune Custom Resource nodes.

pruneEmptyContainers
import { Filters } from '@aws/pdk/cdk-graph'

Filters.pruneEmptyContainers()

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.

pruneExtraneous
import { Filters } from '@aws/pdk/cdk-graph'

Filters.pruneExtraneous()

Prune extraneous nodes and edges.

uncluster
import { Filters } from '@aws/pdk/cdk-graph'

Filters.uncluster(clusterTypes?: NodeTypeEnum[])

Remove clusters by hoisting their children to the parent of the cluster and collapsing the cluster itself to its parent.

{@link Graph.Node.mutateUncluster }

clusterTypesOptional

verifyFilterable
import { Filters } from '@aws/pdk/cdk-graph'

Filters.verifyFilterable(store: Store)

Verify that store is filterable, meaning it allows destructive mutations.

storeRequired

ImportReference

Import reference defines Fn::ImportValue type reference edge.

Initializers

import { ImportReference } from '@aws/pdk/cdk-graph'

new ImportReference(props: ITypedEdgeProps)
Name Type Description
props ITypedEdgeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the edge.
setAttribute Set attribute.
setTag Set tag.
isEquivalent Indicates if this edge is equivalent to another edge.
mutateConsume Merge an equivalent edge's data into this edge and destroy the other edge.
mutateDirection Change the edge direction.
mutateSource Change the edge source.
mutateTarget Change the edge target.
toString Get string representation of this edge.
resolveChain Resolve reference chain.
resolveTargets Resolve targets by following potential edge chain.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

isEquivalent
public isEquivalent(edge: Edge): boolean

Indicates if this edge is equivalent to another edge.

Edges are considered equivalent if they share same type, source, and target.

edgeRequired

mutateConsume
public mutateConsume(edge: Edge): void

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.


mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void

Change the edge direction.

directionRequired

mutateSource
public mutateSource(node: Node): void

Change the edge source.

nodeRequired

mutateTarget
public mutateTarget(node: Node): void

Change the edge target.

nodeRequired

toString
public toString(): string

Get string representation of this edge.

resolveChain
public resolveChain(): any[]

Resolve reference chain.

resolveTargets
public resolveTargets(): Node[]

Resolve targets by following potential edge chain.

{@link EdgeChain }

Static Functions

Name Description
findAllInChain Find all matching edges based on predicate within an EdgeChain.
findInChain Find first edge matching predicate within an EdgeChain.
isRef Indicates if edge is a Ref based {@link Reference} edge.
isReference Indicates if edge is a {@link Reference}.
isImport Indicates if edge is Fn::ImportValue based {@link Reference}.

findAllInChain
import { ImportReference } from '@aws/pdk/cdk-graph'

ImportReference.findAllInChain(chain: any[], predicate: IEdgePredicate)

Find all matching edges based on predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

findInChain
import { ImportReference } from '@aws/pdk/cdk-graph'

ImportReference.findInChain(chain: any[], predicate: IEdgePredicate)

Find first edge matching predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

isRef
import { ImportReference } from '@aws/pdk/cdk-graph'

ImportReference.isRef(edge: Edge)

Indicates if edge is a Ref based {@link Reference} edge.

edgeRequired

isReference
import { ImportReference } from '@aws/pdk/cdk-graph'

ImportReference.isReference(edge: Edge)

Indicates if edge is a {@link Reference}.

edgeRequired

isImport
import { ImportReference } from '@aws/pdk/cdk-graph'

ImportReference.isImport(edge: Edge)

Indicates if edge is Fn::ImportValue based {@link Reference}.

edgeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if edge allows destructive mutations.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
isClosed boolean Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
isCrossStack boolean Indicates if source and target nodes reside in different root stacks.
isExtraneous boolean 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).
referenceType ReferenceTypeEnum Get type of reference.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if edge allows destructive mutations.


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


isClosedRequired
public readonly isClosed: boolean;
  • Type: boolean

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.


isCrossStackRequired
public readonly isCrossStack: boolean;
  • Type: boolean

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


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


referenceTypeRequired
public readonly referenceType: ReferenceTypeEnum;

Get type of reference.


Constants

Name Type Description
ATT_TYPE string Attribute defining the type of reference.
PREFIX string Edge prefix to denote Fn::ImportValue type reference edge.

ATT_TYPERequired
public readonly ATT_TYPE: string;
  • Type: string

Attribute defining the type of reference.


PREFIXRequired
public readonly PREFIX: string;
  • Type: string

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


NestedStackNode

NestedStackNode defines a cdk NestedStack.

Initializers

import { NestedStackNode } from '@aws/pdk/cdk-graph'

new NestedStackNode(props: INestedStackNodeProps)
Name Type Description
props INestedStackNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.
addOutput Associate {@link OutputNode} with this stack.
addParameter Associate {@link ParameterNode} with this stack.
findOutput Find {@link OutputNode} with logicalId defined by this stack.
findParameter Find {@link ParameterNode} with parameterId defined by this stack.
mutateRemoveOutput Disassociate {@link OutputNode} from this stack.
mutateRemoveParameter Disassociate {@link ParameterNode} from this stack.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

addOutput
public addOutput(node: OutputNode): void

Associate {@link OutputNode} with this stack.

nodeRequired

addParameter
public addParameter(node: ParameterNode): void

Associate {@link ParameterNode} with this stack.

nodeRequired

findOutput
public findOutput(logicalId: string): OutputNode

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

logicalIdRequired
  • Type: string

findParameter
public findParameter(parameterId: string): ParameterNode

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

parameterIdRequired
  • Type: string

mutateRemoveOutput
public mutateRemoveOutput(node: OutputNode): boolean

Disassociate {@link OutputNode} from this stack.

nodeRequired

mutateRemoveParameter
public mutateRemoveParameter(node: ParameterNode): boolean

Disassociate {@link ParameterNode} from this stack.

nodeRequired

Static Functions

Name Description
isStackNode Indicates if node is a {@link StackNode}.
of Gets the {@link StackNode} containing a given resource.
isNestedStackNode Indicates if node is a {@link NestedStackNode}.

isStackNode
import { NestedStackNode } from '@aws/pdk/cdk-graph'

NestedStackNode.isStackNode(node: Node)

Indicates if node is a {@link StackNode}.

nodeRequired

of
import { NestedStackNode } from '@aws/pdk/cdk-graph'

NestedStackNode.of(node: Node)

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

nodeRequired

isNestedStackNode
import { NestedStackNode } from '@aws/pdk/cdk-graph'

NestedStackNode.isNestedStackNode(node: Node)

Indicates if node is a {@link NestedStackNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
exports OutputNode[] Get all exported {@link OutputNode}s defined by this stack.
outputs OutputNode[] Get all {@link OutputNode}s defined by this stack.
parameters ParameterNode[] Get all {@link ParameterNode}s defined by this stack.
stage StageNode Get {@link StageNode} containing this stack.
parentStack StackNode Get parent stack of this nested stack.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


exportsRequired
public readonly exports: OutputNode[];

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


outputsRequired
public readonly outputs: OutputNode[];

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


parametersRequired
public readonly parameters: ParameterNode[];

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


stageOptional
public readonly stage: StageNode;

Get {@link StageNode} containing this stack.


parentStackOptional
public readonly parentStack: 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 { Node } from '@aws/pdk/cdk-graph'

new Node(props: INodeProps)
Name Type Description
props INodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

Indicates that this node must not have references.


setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


OutputNode

OutputNode defines a cdk CfnOutput resources.

Initializers

import { OutputNode } from '@aws/pdk/cdk-graph'

new OutputNode(props: IOutputNodeProps)
Name Type Description
props IOutputNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

Static Functions

Name Description
isOutputNode Indicates if node is an {@link OutputNode}.

isOutputNode
import { OutputNode } from '@aws/pdk/cdk-graph'

OutputNode.isOutputNode(node: Node)

Indicates if node is an {@link OutputNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
isExport boolean Indicates if {@link OutputNode} is exported.
value any Get the value* attribute.
exportName string Get the export name attribute.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


isExportRequired
public readonly isExport: boolean;
  • Type: boolean

Indicates if {@link OutputNode} is exported.


valueRequired
public readonly value: any;
  • Type: any

Get the value* attribute.


exportNameOptional
public readonly exportName: string;
  • Type: string

Get the export name attribute.


Constants

Name Type Description
ATTR_EXPORT_NAME string Attribute key where output export name is stored.
ATTR_VALUE string Attribute key where output value is stored.

ATTR_EXPORT_NAMERequired
public readonly ATTR_EXPORT_NAME: string;
  • Type: string

Attribute key where output export name is stored.


ATTR_VALUERequired
public readonly ATTR_VALUE: string;
  • Type: string

Attribute key where output value is stored.


ParameterNode

ParameterNode defines a CfnParameter node.

Initializers

import { ParameterNode } from '@aws/pdk/cdk-graph'

new ParameterNode(props: IParameterNodeProps)
Name Type Description
props IParameterNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

Static Functions

Name Description
isParameterNode Indicates if node is a {@link ParameterNode}.

isParameterNode
import { ParameterNode } from '@aws/pdk/cdk-graph'

ParameterNode.isParameterNode(node: Node)

Indicates if node is a {@link ParameterNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
isStackReference boolean Indicates if parameter is a reference to a stack.
parameterType any Get the parameter type attribute.
value any Get the value attribute.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


isStackReferenceRequired
public readonly isStackReference: boolean;
  • Type: boolean

Indicates if parameter is a reference to a stack.


parameterTypeRequired
public readonly parameterType: any;
  • Type: any

Get the parameter type attribute.


valueRequired
public readonly value: any;
  • Type: any

Get the value attribute.


Constants

Name Type Description
ATTR_TYPE string Attribute key where parameter type is stored.
ATTR_VALUE string Attribute key where parameter value is store.

ATTR_TYPERequired
public readonly ATTR_TYPE: string;
  • Type: string

Attribute key where parameter type is stored.


ATTR_VALUERequired
public readonly ATTR_VALUE: string;
  • Type: string

Attribute key where parameter value is store.


Reference

Reference edge class defines a directed relationship between nodes.

Initializers

import { Reference } from '@aws/pdk/cdk-graph'

new Reference(props: IReferenceProps)
Name Type Description
props IReferenceProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroy the edge.
setAttribute Set attribute.
setTag Set tag.
isEquivalent Indicates if this edge is equivalent to another edge.
mutateConsume Merge an equivalent edge's data into this edge and destroy the other edge.
mutateDirection Change the edge direction.
mutateSource Change the edge source.
mutateTarget Change the edge target.
toString Get string representation of this edge.
resolveChain Resolve reference chain.
resolveTargets Resolve targets by following potential edge chain.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroy the edge.

Remove all references and remove from store.

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

isEquivalent
public isEquivalent(edge: Edge): boolean

Indicates if this edge is equivalent to another edge.

Edges are considered equivalent if they share same type, source, and target.

edgeRequired

mutateConsume
public mutateConsume(edge: Edge): void

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.


mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void

Change the edge direction.

directionRequired

mutateSource
public mutateSource(node: Node): void

Change the edge source.

nodeRequired

mutateTarget
public mutateTarget(node: Node): void

Change the edge target.

nodeRequired

toString
public toString(): string

Get string representation of this edge.

resolveChain
public resolveChain(): any[]

Resolve reference chain.

resolveTargets
public resolveTargets(): Node[]

Resolve targets by following potential edge chain.

{@link EdgeChain }

Static Functions

Name Description
findAllInChain Find all matching edges based on predicate within an EdgeChain.
findInChain Find first edge matching predicate within an EdgeChain.
isRef Indicates if edge is a Ref based {@link Reference} edge.
isReference Indicates if edge is a {@link Reference}.

findAllInChain
import { Reference } from '@aws/pdk/cdk-graph'

Reference.findAllInChain(chain: any[], predicate: IEdgePredicate)

Find all matching edges based on predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

findInChain
import { Reference } from '@aws/pdk/cdk-graph'

Reference.findInChain(chain: any[], predicate: IEdgePredicate)

Find first edge matching predicate within an EdgeChain.

chainRequired
  • Type: any[]

predicateRequired

isRef
import { Reference } from '@aws/pdk/cdk-graph'

Reference.isRef(edge: Edge)

Indicates if edge is a Ref based {@link Reference} edge.

edgeRequired

isReference
import { Reference } from '@aws/pdk/cdk-graph'

Reference.isReference(edge: Edge)

Indicates if edge is a {@link Reference}.

edgeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if edge allows destructive mutations.
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.
isClosed boolean Indicates if the Edge's source and target are the same, or were the same when it was created (prior to mutations).
isCrossStack boolean Indicates if source and target nodes reside in different root stacks.
isExtraneous boolean 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).
referenceType ReferenceTypeEnum Get type of reference.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if edge allows destructive mutations.


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


isClosedRequired
public readonly isClosed: boolean;
  • Type: boolean

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.


isCrossStackRequired
public readonly isCrossStack: boolean;
  • Type: boolean

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


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if edge is extraneous which is determined by explicitly having EXTRANEOUS flag added and/or being a closed loop (source===target).


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


referenceTypeRequired
public readonly referenceType: ReferenceTypeEnum;

Get type of reference.


Constants

Name Type Description
ATT_TYPE string Attribute defining the type of reference.
PREFIX string Edge prefix to denote Ref type reference edge.

ATT_TYPERequired
public readonly ATT_TYPE: string;
  • Type: string

Attribute defining the type of reference.


PREFIXRequired
public readonly PREFIX: string;
  • Type: string

Edge prefix to denote Ref type reference edge.


ResourceNode

ResourceNode class defines a L2 cdk resource construct.

Initializers

import { ResourceNode } from '@aws/pdk/cdk-graph'

new ResourceNode(props: IResourceNodeProps)
Name Type Description
props IResourceNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.
mutateCfnResource Modifies the L1 resource wrapped by this L2 resource.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

Indicates that this node must not have references.


setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

mutateCfnResource
public mutateCfnResource(cfnResource?: CfnResourceNode): void

Modifies the L1 resource wrapped by this L2 resource.

cfnResourceOptional

Static Functions

Name Description
isResourceNode Indicates if node is a {@link ResourceNode}.

isResourceNode
import { ResourceNode } from '@aws/pdk/cdk-graph'

ResourceNode.isResourceNode(node: Node)

Indicates if node is a {@link ResourceNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Get the cfn properties from the L1 resource that this L2 resource wraps.
cfnType string Get the CloudFormation resource type for this L2 resource or for the L1 resource is wraps.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
isCdkOwned boolean Indicates if this resource is owned by cdk (defined in cdk library).
isWrapper boolean Indicates if Resource wraps a single CfnResource.
cfnResource CfnResourceNode Get the default/primary CfnResource that this Resource wraps.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Get the cfn properties from the L1 resource that this L2 resource wraps.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this L2 resource or for the L1 resource is wraps.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


isCdkOwnedRequired
public readonly isCdkOwned: boolean;
  • Type: boolean

Indicates if this resource is owned by cdk (defined in cdk library).


isWrapperRequired
public readonly isWrapper: boolean;
  • Type: boolean

Indicates if Resource wraps a single CfnResource.


cfnResourceOptional
public readonly cfnResource: CfnResourceNode;

Get the default/primary CfnResource that this Resource wraps.


Constants

Name Type Description
ATT_WRAPPED_CFN_PROPS string Attribute key for cfn properties.
ATT_WRAPPED_CFN_TYPE string Attribute key for cfn resource type.

ATT_WRAPPED_CFN_PROPSRequired
public readonly ATT_WRAPPED_CFN_PROPS: string;
  • Type: string

Attribute key for cfn properties.


ATT_WRAPPED_CFN_TYPERequired
public readonly ATT_WRAPPED_CFN_TYPE: string;
  • Type: string

Attribute key for cfn resource type.


RootNode

RootNode represents the root of the store tree.

Initializers

import { RootNode } from '@aws/pdk/cdk-graph'

new RootNode(store: Store)
Name Type Description
store Store Reference to the store.

storeRequired

Reference to the store.


Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor > {@link RootNode} does not support this mutation.
mutateCollapseToParent Collapses this node into it's parent node > {@link RootNode} does not support this mutation.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(_strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

{@link RootNode} does not support this mutation

_strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate. The root not is excluded from list

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

{@link RootNode} does not support this mutation

mutateCollapseTo
public mutateCollapseTo(_ancestor: Node): Node

Collapses this node into an ancestor > {@link RootNode} does not support this mutation.

_ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node > {@link RootNode} does not support this mutation.

mutateHoist
public mutateHoist(_newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

{@link RootNode} does not support this mutation

_newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

Static Functions

Name Description
isRootNode Indicates if node is a {@link RootNode}.

isRootNode
import { RootNode } from '@aws/pdk/cdk-graph'

RootNode.isRootNode(node: Node)

Indicates if node is a {@link RootNode}.

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


Constants

Name Type Description
PATH string Fixed path of root.
UUID string Fixed UUID of root.

PATHRequired
public readonly PATH: string;
  • Type: string

Fixed path of root.


UUIDRequired
public readonly UUID: string;
  • Type: string

Fixed UUID of root.


StackNode

StackNode defines a cdk Stack.

Initializers

import { StackNode } from '@aws/pdk/cdk-graph'

new StackNode(props: IStackNodeProps)
Name Type Description
props IStackNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.
addOutput Associate {@link OutputNode} with this stack.
addParameter Associate {@link ParameterNode} with this stack.
findOutput Find {@link OutputNode} with logicalId defined by this stack.
findParameter Find {@link ParameterNode} with parameterId defined by this stack.
mutateRemoveOutput Disassociate {@link OutputNode} from this stack.
mutateRemoveParameter Disassociate {@link ParameterNode} from this stack.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

addOutput
public addOutput(node: OutputNode): void

Associate {@link OutputNode} with this stack.

nodeRequired

addParameter
public addParameter(node: ParameterNode): void

Associate {@link ParameterNode} with this stack.

nodeRequired

findOutput
public findOutput(logicalId: string): OutputNode

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

logicalIdRequired
  • Type: string

findParameter
public findParameter(parameterId: string): ParameterNode

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

parameterIdRequired
  • Type: string

mutateRemoveOutput
public mutateRemoveOutput(node: OutputNode): boolean

Disassociate {@link OutputNode} from this stack.

nodeRequired

mutateRemoveParameter
public mutateRemoveParameter(node: ParameterNode): boolean

Disassociate {@link ParameterNode} from this stack.

nodeRequired

Static Functions

Name Description
isStackNode Indicates if node is a {@link StackNode}.
of Gets the {@link StackNode} containing a given resource.

isStackNode
import { StackNode } from '@aws/pdk/cdk-graph'

StackNode.isStackNode(node: Node)

Indicates if node is a {@link StackNode}.

nodeRequired

of
import { StackNode } from '@aws/pdk/cdk-graph'

StackNode.of(node: Node)

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

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
exports OutputNode[] Get all exported {@link OutputNode}s defined by this stack.
outputs OutputNode[] Get all {@link OutputNode}s defined by this stack.
parameters ParameterNode[] Get all {@link ParameterNode}s defined by this stack.
stage StageNode Get {@link StageNode} containing this stack.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


exportsRequired
public readonly exports: OutputNode[];

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


outputsRequired
public readonly outputs: OutputNode[];

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


parametersRequired
public readonly parameters: ParameterNode[];

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


stageOptional
public readonly stage: StageNode;

Get {@link StageNode} containing this stack.


StageNode

StageNode defines a cdk Stage.

Initializers

import { StageNode } from '@aws/pdk/cdk-graph'

new StageNode(props: ITypedNodeProps)
Name Type Description
props ITypedNodeProps No description.

propsRequired

Methods

Name Description
addAttribute Add attribute.
addFlag Add flag.
addMetadata Add metadata entry.
addTag Add tag.
applyData Applies data (attributes, metadata, tags, flag) to entity.
findMetadata Retrieves all metadata entries of a given type.
getAttribute Get attribute by key.
getTag Get tag by key.
hasAttribute Indicates if entity has a given attribute defined, and optionally with a specific value.
hasFlag Indicates if entity has a given flag.
hasMetadata Indicates if entity has matching metadata entry.
hasTag Indicates if entity has tag, optionally verifying tag value.
mutateDestroy Destroys this node by removing all references and removing this node from the store.
setAttribute Set attribute.
setTag Set tag.
addChild Add child node.
addLink Add link to another node.
addReverseLink Add link from another node.
doesDependOn Indicates if this node depends on another node.
doesReference Indicates if this node references another node.
find Recursively find the nearest sub-node matching predicate.
findAll Return this construct and all of its sub-nodes in the given order.
findAllLinks Return all direct links of this node and that of all sub-nodes.
findAncestor Find nearest ancestor of this node matching given predicate.
findChild Find child with given id.
findLink Find link of this node based on predicate.
findLinks Find all links of this node based on predicate.
getCfnProp Get specific CloudFormation property.
getChild Get child node with given id.
getLinkChains Resolve all link chains.
getNearestAncestor Gets the nearest common ancestor shared between this node and another node.
isAncestor Indicates if a specific node is an ancestor of this node.
isChild Indicates if specific node is a child of this node.
mutateCollapse Collapses all sub-nodes of this node into this node.
mutateCollapseTo Collapses this node into an ancestor.
mutateCollapseToParent Collapses this node into it's parent node.
mutateHoist Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
mutateMove Move this node into a new parent node.
mutateRemoveChild Remove a child node from this node.
mutateRemoveLink Remove a link from this node.
mutateRemoveReverseLink Remove a link to this node.
mutateUncluster Hoist all children to parent and collapse node to parent.
toString Get string representation of this node.
addStack Associate a {@link StackNode} with this stage.
mutateRemoveStack Disassociate {@link StackNode} from this stage.

addAttribute
public addAttribute(key: string, value: any): void

Add attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

addFlag
public addFlag(flag: FlagEnum): void

Add flag.

flagRequired

addMetadata
public addMetadata(metadataType: string, data: any): void

Add metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

addTag
public addTag(key: string, value: string): void

Add tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

applyData
public applyData(data: IBaseEntityDataProps, overwrite?: boolean, applyFlags?: boolean): void

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: boolean

applyFlagsOptional
  • Type: boolean

Indicates if data is overwritten - Indicates if flags should be applied.


findMetadata
public findMetadata(metadataType: string): MetadataEntry[]

Retrieves all metadata entries of a given type.

metadataTypeRequired
  • Type: string

getAttribute
public getAttribute(key: string): any

Get attribute by key.

keyRequired
  • Type: string

getTag
public getTag(key: string): string

Get tag by key.

keyRequired
  • Type: string

hasAttribute
public hasAttribute(key: string, value?: any): boolean

Indicates if entity has a given attribute defined, and optionally with a specific value.

keyRequired
  • Type: string

valueOptional
  • Type: any

hasFlag
public hasFlag(flag: FlagEnum): boolean

Indicates if entity has a given flag.

flagRequired

hasMetadata
public hasMetadata(metadataType: string, data: any): boolean

Indicates if entity has matching metadata entry.

metadataTypeRequired
  • Type: string

dataRequired
  • Type: any

hasTag
public hasTag(key: string, value?: string): boolean

Indicates if entity has tag, optionally verifying tag value.

keyRequired
  • Type: string

valueOptional
  • Type: string

mutateDestroy
public mutateDestroy(strict?: boolean): void

Destroys this node by removing all references and removing this node from the store.

strictOptional
  • Type: boolean

Indicates that this node must not have references.


setAttribute
public setAttribute(key: string, value: any): void

Set attribute.

This will overwrite existing attribute.

keyRequired
  • Type: string

valueRequired
  • Type: any

setTag
public setTag(key: string, value: string): void

Set tag.

Will overwrite existing tag.

keyRequired
  • Type: string

valueRequired
  • Type: string

addChild
public addChild(node: Node): void

Add child node.

nodeRequired

public addLink(edge: Edge): void

Add link to another node.

edgeRequired

public addReverseLink(edge: Edge): void

Add link from another node.

edgeRequired

doesDependOn
public doesDependOn(node: Node): boolean

Indicates if this node depends on another node.

nodeRequired

doesReference
public doesReference(node: Node): boolean

Indicates if this node references another node.

nodeRequired

find
public find(predicate: INodePredicate): Node

Recursively find the nearest sub-node matching predicate.

predicateRequired

findAll
public findAll(options?: IFindNodeOptions): Node[]

Return this construct and all of its sub-nodes in the given order.

Optionally filter nodes based on predicate.

optionsOptional

public findAllLinks(options?: IFindEdgeOptions): Edge[]

Return all direct links of this node and that of all sub-nodes.

Optionally filter links based on predicate.

optionsOptional

findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node

Find nearest ancestor of this node matching given predicate.

predicateRequired

Predicate to match ancestor.


maxOptional
  • Type: number

findChild
public findChild(id: string): Node

Find child with given id.

Similar to find but does not throw error if no child found.

idRequired
  • Type: string

public findLink(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


public findLinks(predicate: IEdgePredicate, reverse?: boolean, follow?: boolean, direct?: boolean): 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: boolean

Indicates if links are search in reverse order.


followOptional
  • Type: boolean

Indicates if link chain is followed.


directOptional
  • Type: boolean

Indicates that only direct links should be searched.


getCfnProp
public getCfnProp(key: string): string | number | boolean | PlainObject | string | number | boolean | PlainObject[]

Get specific CloudFormation property.

keyRequired
  • Type: string

getChild
public getChild(id: string): Node

Get child node with given id.

idRequired
  • Type: string

getLinkChains
public getLinkChains(reverse?: boolean): any[][]

Resolve all link chains.

{@link EdgeChain }

reverseOptional
  • Type: boolean

getNearestAncestor
public getNearestAncestor(node: Node): Node

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

nodeRequired

isAncestor
public isAncestor(ancestor: Node): boolean

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

ancestorRequired

isChild
public isChild(node: Node): boolean

Indicates if specific node is a child of this node.

nodeRequired

mutateCollapse
public mutateCollapse(): void

Collapses all sub-nodes of this node into this node.

mutateCollapseTo
public mutateCollapseTo(ancestor: Node): Node

Collapses this node into an ancestor.

ancestorRequired

mutateCollapseToParent
public mutateCollapseToParent(): Node

Collapses this node into it's parent node.

mutateHoist
public mutateHoist(newParent: Node): void

Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.

newParentRequired

mutateMove
public mutateMove(newParent: Node): void

Move this node into a new parent node.

newParentRequired

The parent to move this node to.


mutateRemoveChild
public mutateRemoveChild(node: Node): boolean

Remove a child node from this node.

nodeRequired

public mutateRemoveLink(link: Edge): boolean

Remove a link from this node.

linkRequired

public mutateRemoveReverseLink(link: Edge): boolean

Remove a link to this node.

linkRequired

mutateUncluster
public mutateUncluster(): void

Hoist all children to parent and collapse node to parent.

toString
public toString(): string

Get string representation of this node.

addStack
public addStack(stack: StackNode): void

Associate a {@link StackNode} with this stage.

stackRequired

mutateRemoveStack
public mutateRemoveStack(stack: StackNode): boolean

Disassociate {@link StackNode} from this stage.

stackRequired

Static Functions

Name Description
isStageNode Indicates if node is a {@link StageNode}.
of Gets the {@link StageNode} containing a given resource.

isStageNode
import { StageNode } from '@aws/pdk/cdk-graph'

StageNode.isStageNode(node: Node)

Indicates if node is a {@link StageNode}.

nodeRequired

of
import { StageNode } from '@aws/pdk/cdk-graph'

StageNode.of(node: Node)

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

nodeRequired

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Get readonly record of all attributes.
flags FlagEnum[] Get readonly list of all flags.
isDestroyed boolean Indicates if the entity has been destroyed (eg: removed from store).
isMutated boolean Indicates if the entity has had destructive mutations applied.
metadata constructs.MetadataEntry[] Get readonly list of all metadata entries.
store Store Reference to the store.
tags {[ key: string ]: string} Get readonly record of all tags.
uuid string Universally unique identifier.
allowDestructiveMutations boolean Indicates if this node allows destructive mutations.
children Node[] Get all direct child nodes.
dependedOnBy Node[] Get list of Nodes that depend on this node.
dependencies Node[] Get list of Nodes that this node depends on.
dependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the source.
depth number Indicates the depth of the node relative to root (0).
id string Node id, which is only unique within parent scope.
isAsset boolean Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn boolean Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
isCluster boolean Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource boolean Indicates if node is a Custom Resource.
isExtraneous boolean Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.
isGraphContainer boolean Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf boolean Indicates if this node is a leaf node, which means it does not have children.
isTopLevel boolean Indicates if node is direct child of the graph root node.
links Edge[] Gets all links (edges) in which this node is the source.
nodeType NodeTypeEnum Type of node.
path string Path of the node.
referencedBy Node[] Get list of Nodes that reference this node.
referenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the source.
references Node[] Get list of Nodes that this node references.
reverseDependencyLinks Dependency[] Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks Edge[] Gets all links (edges) in which this node is the target.
reverseReferenceLinks Reference[] Gets list of {@link Reference} links (edges) where this node is the target.
scopes Node[] Gets descending ordered list of ancestors from the root.
siblings Node[] Get list of siblings of this node.
cfnProps PlainObject Gets CloudFormation properties for this node.
cfnType string Get the CloudFormation resource type for this node.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
constructInfoFqn string Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
rootStack StackNode Get root stack.
stack StackNode Stack the node is contained in.
stacks StackNode[] Gets all stacks contained by this stage.

attributesRequired
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Get readonly record of all attributes.


flagsRequired
public readonly flags: FlagEnum[];

Get readonly list of all flags.


isDestroyedRequired
public readonly isDestroyed: boolean;
  • Type: boolean

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


isMutatedRequired
public readonly isMutated: boolean;
  • Type: boolean

Indicates if the entity has had destructive mutations applied.


metadataRequired
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Get readonly list of all metadata entries.


storeRequired
public readonly store: Store;

Reference to the store.


tagsRequired
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Get readonly record of all tags.


uuidRequired
public readonly uuid: string;
  • Type: string

Universally unique identifier.


allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if this node allows destructive mutations.

{@link Store.allowDestructiveMutations }


childrenRequired
public readonly children: Node[];

Get all direct child nodes.


dependedOnByRequired
public readonly dependedOnBy: Node[];

Get list of Nodes that depend on this node.

{@link Node.reverseDependencyLinks }


dependenciesRequired
public readonly dependencies: Node[];

Get list of Nodes that this node depends on.

{@link Node.dependencyLinks }


dependencyLinksRequired
public readonly dependencyLinks: Dependency[];

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


depthRequired
public readonly depth: number;
  • Type: number

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


idRequired
public readonly id: string;
  • Type: string

Node id, which is only unique within parent scope.


isAssetRequired
public readonly isAsset: boolean;
  • Type: boolean

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


isCfnFqnRequired
public readonly isCfnFqn: boolean;
  • Type: boolean

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

{@link FlagEnum.CFN_FQN }


isClusterRequired
public readonly isCluster: boolean;
  • Type: boolean

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


isCustomResourceRequired
public readonly isCustomResource: boolean;
  • Type: boolean

Indicates if node is a Custom Resource.


isExtraneousRequired
public readonly isExtraneous: boolean;
  • Type: boolean

Indicates if this node is considered a {@link FlagEnum.EXTRANEOUS} node or determined to be extraneous: - Clusters that contain no children.


isGraphContainerRequired
public readonly isGraphContainer: boolean;
  • Type: boolean

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


isLeafRequired
public readonly isLeaf: boolean;
  • Type: boolean

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


isTopLevelRequired
public readonly isTopLevel: boolean;
  • Type: boolean

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


linksRequired
public readonly links: Edge[];

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


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


referencedByRequired
public readonly referencedBy: Node[];

Get list of Nodes that reference this node.

{@link Node.reverseReferenceLinks }


referenceLinksRequired
public readonly referenceLinks: Reference[];

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


referencesRequired
public readonly references: Node[];

Get list of Nodes that this node references.

{@link Node.referenceLinks }


reverseDependencyLinksRequired
public readonly reverseDependencyLinks: Dependency[];

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


reverseLinksRequired
public readonly reverseLinks: Edge[];

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


reverseReferenceLinksRequired
public readonly reverseReferenceLinks: Reference[];

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


scopesRequired
public readonly scopes: Node[];

Gets descending ordered list of ancestors from the root.


siblingsRequired
public readonly siblings: Node[];

Get list of siblings of this node.


cfnPropsOptional
public readonly cfnProps: PlainObject;

Gets CloudFormation properties for this node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Get the CloudFormation resource type for this node.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


constructInfoFqnOptional
public readonly constructInfoFqn: string;
  • Type: string

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.

Only the root node should not have parent.


rootStackOptional
public readonly rootStack: StackNode;

Get root stack.


stackOptional
public readonly stack: StackNode;

Stack the node is contained in.


stacksRequired
public readonly stacks: StackNode[];

Gets all stacks contained by this stage.


Store

Store class provides the in-memory database-like interface for managing all entities in the graph.

Initializers

import { Store } from '@aws/pdk/cdk-graph'

new Store(allowDestructiveMutations?: boolean)
Name Type Description
allowDestructiveMutations boolean No description.

allowDestructiveMutationsOptional
  • Type: boolean

Methods

Name Description
addEdge Add edge to the store.
addNode Add node to the store.
addStack Add stack node to the store.
addStage Add stage to the store.
clone Clone the store to allow destructive mutations.
computeLogicalUniversalId Compute universal logicalId based on parent stack and construct logicalId (<stack>:<logicalId>).
findNodeByImportArn Attempts to lookup the {@link Node} associated with a given import arn token.
findNodeByLogicalId Find node within given stack with given logicalId.
findNodeByLogicalUniversalId Find node by universal logicalId (<stack>:<logicalId>).
getEdge Get stored edge by UUID.
getNode Get stored node by UUID.
getStack Get stored stack node by UUID.
getStage Get stored stage node by UUID.
mutateRemoveEdge Remove edge from the store.
mutateRemoveNode Remove node from the store.
recordImportArn Records arn tokens from imported resources (eg: s3.Bucket.fromBucketArn()) that are used for resolving references.
recordLogicalId Record a universal logicalId to node mapping in the store.
serialize Serialize the store.
verifyDestructiveMutationAllowed Verifies that the store allows destructive mutations.

addEdge
public addEdge(edge: Edge): void

Add edge to the store.

edgeRequired

addNode
public addNode(node: Node): void

Add node to the store.

nodeRequired

addStack
public addStack(stack: StackNode): void

Add stack node to the store.

stackRequired

addStage
public addStage(stage: StageNode): void

Add stage to the store.

stageRequired

clone
public clone(allowDestructiveMutations?: boolean): Store

Clone the store to allow destructive mutations.

allowDestructiveMutationsOptional
  • Type: boolean

Indicates if destructive mutations are allowed;

defaults to true


computeLogicalUniversalId
public computeLogicalUniversalId(stack: StackNode, logicalId: string): string

Compute universal logicalId based on parent stack and construct logicalId (<stack>:<logicalId>).

Construct logicalIds are only unique within their containing stack, so to use logicalId* lookups universally (like resolving references) we need a universal key.

stackRequired

logicalIdRequired
  • Type: string

findNodeByImportArn
public findNodeByImportArn(value: any): Node

Attempts to lookup the {@link Node} associated with a given import arn token.

valueRequired
  • Type: any

Import arn value, which is either object to tokenize or already tokenized string.


findNodeByLogicalId
public findNodeByLogicalId(stack: StackNode, logicalId: string): Node

Find node within given stack with given logicalId.

stackRequired

logicalIdRequired
  • Type: string

findNodeByLogicalUniversalId
public findNodeByLogicalUniversalId(uid: string): Node

Find node by universal logicalId (<stack>:<logicalId>).

uidRequired
  • Type: string

getEdge
public getEdge(uuid: string): Edge

Get stored edge by UUID.

uuidRequired
  • Type: string

getNode
public getNode(uuid: string): Node

Get stored node by UUID.

uuidRequired
  • Type: string

getStack
public getStack(uuid: string): StackNode

Get stored stack node by UUID.

uuidRequired
  • Type: string

getStage
public getStage(uuid: string): StageNode

Get stored stage node by UUID.

uuidRequired
  • Type: string

mutateRemoveEdge
public mutateRemoveEdge(edge: Edge): boolean

Remove edge from the store.

edgeRequired

mutateRemoveNode
public mutateRemoveNode(node: Node): boolean

Remove node from the store.

nodeRequired

recordImportArn
public recordImportArn(arnToken: string, resource: Node): void

Records arn tokens from imported resources (eg: s3.Bucket.fromBucketArn()) that are used for resolving references.

arnTokenRequired
  • Type: string

resourceRequired

recordLogicalId
public recordLogicalId(stack: StackNode, logicalId: string, resource: Node): void

Record a universal logicalId to node mapping in the store.

stackRequired

logicalIdRequired
  • Type: string

resourceRequired

serialize
public serialize(): SGGraphStore

Serialize the store.

verifyDestructiveMutationAllowed
public verifyDestructiveMutationAllowed(): void

Verifies that the store allows destructive mutations.

Static Functions

Name Description
fromSerializedStore Builds store from serialized store data.

fromSerializedStore
import { Store } from '@aws/pdk/cdk-graph'

Store.fromSerializedStore(serializedStore: SGGraphStore)

Builds store from serialized store data.

serializedStoreRequired

Properties

Name Type Description
allowDestructiveMutations boolean Indicates if the store allows destructive mutations.
counts IStoreCounts Get record of all store counters.
edges Edge[] Gets all stored edges.
nodes Node[] Gets all stored nodes.
root RootNode Root node in the store.
rootStacks StackNode[] Gets all stored root stack nodes.
stacks StackNode[] Gets all stored stack nodes.
stages StageNode[] Gets all stored stage nodes.
version string Current SemVer version of the store.

allowDestructiveMutationsRequired
public readonly allowDestructiveMutations: boolean;
  • Type: boolean

Indicates if the store allows destructive mutations.

Destructive mutations are only allowed on clones of the store to prevent plugins and filters from mutating the store for downstream plugins.

All mutate* methods are only allowed on stores that allow destructive mutations.

This behavior may change in the future if the need arises for plugins to pass mutated stores to downstream plugins. But it will be done cautiously with ensuring the intent of downstream plugin is to receive the mutated store.


countsRequired
public readonly counts: IStoreCounts;

Get record of all store counters.


edgesRequired
public readonly edges: Edge[];

Gets all stored edges.


nodesRequired
public readonly nodes: Node[];

Gets all stored nodes.


rootRequired
public readonly root: RootNode;

Root node in the store.

The root node is not the computed root, but the graph root which is auto-generated and can not be mutated.


rootStacksRequired
public readonly rootStacks: StackNode[];

Gets all stored root stack nodes.


stacksRequired
public readonly stacks: StackNode[];

Gets all stored stack nodes.


stagesRequired
public readonly stages: StageNode[];

Gets all stored stage nodes.


versionRequired
public readonly version: string;
  • Type: string

Current SemVer version of the store.


Protocols

IAppNodeProps

{@link AppNode} props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


IAttributeReferenceProps

Attribute type reference props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
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).
value string | number | boolean | PlainObject | string | number | boolean | PlainObject[] Resolved attribute value.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


valueRequired
public readonly value: string | number | boolean | PlainObject | string | number | boolean | PlainObject[];

Resolved attribute value.


IBaseEntityDataProps

Base interface for all store entities data props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


IBaseEntityProps

Base interface for all store entities props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


ICdkGraphPlugin

CdkGraph Plugin interface.

Properties

Name Type Description
id string Unique identifier for this plugin.
version string Plugin version.
dependencies string[] List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).
bind IGraphPluginBindCallback Binds the plugin to the CdkGraph instance.
inspect IGraphVisitorCallback Node visitor callback for construct tree traversal.
report IGraphReportCallback Generate asynchronous reports based on the graph.
synthesize IGraphSynthesizeCallback Called during CDK synthesize to generate synchronous artifacts based on the in-memory graph passed to the plugin.

idRequired
public readonly id: string;
  • Type: string

Unique identifier for this plugin.


versionRequired
public readonly version: string;
  • Type: string

Plugin version.


dependenciesOptional
public readonly dependencies: string[];
  • Type: string[]

List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).


bindRequired
public readonly bind: IGraphPluginBindCallback;

Binds the plugin to the CdkGraph instance.

Enables plugins to receive base configs.


inspectOptional
public readonly inspect: IGraphVisitorCallback;

Node visitor callback for construct tree traversal.

This follows IAspect.visit pattern, but the order of visitor traversal in managed by the CdkGraph.


reportOptional
public readonly report: IGraphReportCallback;

Generate asynchronous reports based on the graph.

This is not automatically called when synthesizing CDK. Developer must explicitly add await graphInstance.report() to the CDK bin or invoke this outside of the CDK synth. In either case, the plugin receives the in-memory graph interface when invoked, as the CdkGraph will deserialize the graph prior to invoking the plugin report.


synthesizeOptional
public readonly synthesize: IGraphSynthesizeCallback;

Called during CDK synthesize to generate synchronous artifacts based on the in-memory graph passed to the plugin.

This is called in fifo order of plugins.


ICfnResourceNodeProps

CfnResourceNode props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
importArnToken string No description.
nodeType NodeTypeEnum No description.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


importArnTokenOptional
public readonly importArnToken: string;
  • Type: string

nodeTypeOptional
public readonly nodeType: NodeTypeEnum;

IEdgePredicate

Predicate to match edge.

Methods

Name Description
filter No description.

filter
public filter(edge: Edge): boolean
edgeRequired

IEdgeProps

Edge props interface.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
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).
direction EdgeDirectionEnum Indicates the direction in which the edge is directed.
edgeType EdgeTypeEnum Type of edge.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


directionRequired
public readonly direction: EdgeDirectionEnum;

Indicates the direction in which the edge is directed.


edgeTypeRequired
public readonly edgeType: EdgeTypeEnum;

Type of edge.


IFilterFocusCallback

Determines focus node of filter plan.

Methods

Name Description
filter No description.

filter
public filter(store: Store): Node
storeRequired

IFindEdgeOptions

Options for edge based search operations.

Properties

Name Type Description
order constructs.ConstructOrder The order of traversal during search path.
predicate IEdgePredicate The predicate to match edges(s).
reverse boolean Indicates reverse order.

orderOptional
public readonly order: ConstructOrder;
  • Type: constructs.ConstructOrder

The order of traversal during search path.


predicateOptional
public readonly predicate: IEdgePredicate;

The predicate to match edges(s).


reverseOptional
public readonly reverse: boolean;
  • Type: boolean

Indicates reverse order.


IFindNodeOptions

Options for node based search operations.

Properties

Name Type Description
order constructs.ConstructOrder The order of traversal during search path.
predicate INodePredicate The predicate to match node(s).

orderOptional
public readonly order: ConstructOrder;
  • Type: constructs.ConstructOrder

The order of traversal during search path.


predicateOptional
public readonly predicate: INodePredicate;

The predicate to match node(s).


IGraphPluginBindCallback

Callback signature for graph Plugin.bind operation.

IGraphReportCallback

Callback signature for graph Plugin.report operation.

IGraphStoreFilter

Store filter callback interface used to perform filtering operations directly against the store, as opposed to using {@link IGraphFilter} definitions.

Methods

Name Description
filter No description.

filter
public filter(store: Store): void
storeRequired

IGraphSynthesizeCallback

Callback signature for graph Plugin.synthesize operation.

IGraphVisitorCallback

Callback signature for graph Plugin.inspect operation.

INestedStackNodeProps

{@link NestedStackNode} props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
nodeType NodeTypeEnum Type of node.
parentStack StackNode Parent stack.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


nodeTypeOptional
public readonly nodeType: NodeTypeEnum;

Type of node.


parentStackRequired
public readonly parentStack: StackNode;

Parent stack.


INodePredicate

Predicate to match node.

Methods

Name Description
filter No description.

filter
public filter(node: Node): boolean
nodeRequired

INodeProps

Node props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
nodeType NodeTypeEnum Type of node.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


nodeTypeRequired
public readonly nodeType: NodeTypeEnum;

Type of node.


IOutputNodeProps

OutputNode props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
value any Resolved output value.
description string Description.
exportName string Export name.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


valueRequired
public readonly value: any;
  • Type: any

Resolved output value.


descriptionOptional
public readonly description: string;
  • Type: string

Description.


exportNameOptional
public readonly exportName: string;
  • Type: string

Export name.


IParameterNodeProps

{@link ParameterNode} props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
parameterType string Parameter type.
value any Resolved value.
description string Description.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


parameterTypeRequired
public readonly parameterType: string;
  • Type: string

Parameter type.


valueRequired
public readonly value: any;
  • Type: any

Resolved value.


descriptionOptional
public readonly description: string;
  • Type: string

Description.


IReferenceProps

Reference edge props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
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).
referenceType ReferenceTypeEnum Type of reference.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


referenceTypeOptional
public readonly referenceType: ReferenceTypeEnum;

Type of reference.


IResourceNodeProps

ResourceNode props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
cdkOwned boolean Indicates if this resource is owned by cdk (defined in cdk library).
nodeType NodeTypeEnum Type of node.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


cdkOwnedRequired
public readonly cdkOwned: boolean;
  • Type: boolean

Indicates if this resource is owned by cdk (defined in cdk library).


nodeTypeOptional
public readonly nodeType: NodeTypeEnum;

Type of node.


ISerializableEdge

Interface for serializable graph edge entity.

ISerializableEntity

Interface for serializable graph entities.

ISerializableGraphStore

Interface for serializable graph store.

Methods

Name Description
serialize No description.

serialize
public serialize(): SGGraphStore

ISerializableNode

Interface for serializable graph node entity.

IStackNodeProps

{@link StackNode} props.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.
nodeType NodeTypeEnum Type of node.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


nodeTypeOptional
public readonly nodeType: NodeTypeEnum;

Type of node.


IStoreCounts

Interface for store counts.

Properties

Name Type Description
cfnResources {[ key: string ]: number} Returns {@link ICounterRecord} containing total number of each cfnResourceType.
edges number Counts total number of edges in the store.
edgeTypes {[ key: string ]: number} Returns {@link ICounterRecord} containing total number of each edge type ({@link EdgeTypeEnum}).
nodes number Counts total number of nodes in the store.
nodeTypes {[ key: string ]: number} Returns {@link ICounterRecord} containing total number of each node type ({@link NodeTypeEnum}).
stacks number Counts total number of stacks in the store.
stages number Counts total number of stages in the store.

cfnResourcesRequired
public readonly cfnResources: {[ key: string ]: number};
  • Type: {[ key: string ]: number}

Returns {@link ICounterRecord} containing total number of each cfnResourceType.


edgesRequired
public readonly edges: number;
  • Type: number

Counts total number of edges in the store.


edgeTypesRequired
public readonly edgeTypes: {[ key: string ]: number};
  • Type: {[ key: string ]: number}

Returns {@link ICounterRecord} containing total number of each edge type ({@link EdgeTypeEnum}).


nodesRequired
public readonly nodes: number;
  • Type: number

Counts total number of nodes in the store.


nodeTypesRequired
public readonly nodeTypes: {[ key: string ]: number};
  • Type: {[ key: string ]: number}

Returns {@link ICounterRecord} containing total number of each node type ({@link NodeTypeEnum}).


stacksRequired
public readonly stacks: number;
  • Type: number

Counts total number of stacks in the store.


stagesRequired
public readonly stages: number;
  • Type: number

Counts total number of stages in the store.


ITypedEdgeProps

Base edge props agnostic to edge type.

Used for extending per edge class with type specifics.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
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).

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


sourceRequired
public readonly source: Node;

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


targetRequired
public readonly target: Node;

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


ITypedNodeProps

Base node props agnostic to node type.

Used for extending per node class with type specifics.

Properties

Name Type Description
attributes {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} Attributes.
flags FlagEnum[] Flags.
metadata constructs.MetadataEntry[] Metadata entries.
tags {[ key: string ]: string} Tags.
store Store Store.
uuid string UUID.
id string Node id, which is unique within parent scope.
path string Path of the node.
cfnType string Type of CloudFormation resource.
constructInfo ConstructInfo Synthesized construct information defining jii resolution data.
logicalId string Logical id of the node, which is only unique within containing stack.
parent Node Parent node.
stack StackNode Stack the node is contained.

attributesOptional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
  • Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}

Attributes.


flagsOptional
public readonly flags: FlagEnum[];

Flags.


metadataOptional
public readonly metadata: MetadataEntry[];
  • Type: constructs.MetadataEntry[]

Metadata entries.


tagsOptional
public readonly tags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Tags.


storeRequired
public readonly store: Store;

Store.


uuidRequired
public readonly uuid: string;
  • Type: string

UUID.


idRequired
public readonly id: string;
  • Type: string

Node id, which is unique within parent scope.


pathRequired
public readonly path: string;
  • Type: string

Path of the node.


cfnTypeOptional
public readonly cfnType: string;
  • Type: string

Type of CloudFormation resource.


constructInfoOptional
public readonly constructInfo: ConstructInfo;

Synthesized construct information defining jii resolution data.


logicalIdOptional
public readonly logicalId: string;
  • Type: string

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


parentOptional
public readonly parent: Node;

Parent node.


stackOptional
public readonly stack: StackNode;

Stack the node is contained.


Enums

CdkConstructIds

Common cdk construct ids.

Members

Name Description
DEFAULT No description.
RESOURCE No description.
EXPORTS No description.

DEFAULT

RESOURCE

EXPORTS

CdkGraphArtifacts

CdkGraph core artifacts.

Members

Name Description
GRAPH_METADATA No description.
GRAPH No description.

GRAPH_METADATA

GRAPH

CfnAttributesEnum

Common cfn attribute keys.

Members

Name Description
TYPE No description.
PROPS No description.

TYPE

PROPS

ConstructInfoFqnEnum

Commonly used cdk construct info fqn (jsii fully-qualified ids).

Members

Name Description
APP No description.
PDKAPP_MONO No description.
PDKAPP No description.
STAGE No description.
STACK No description.
NESTED_STACK No description.
CFN_STACK No description.
CFN_OUTPUT No description.
CFN_PARAMETER No description.
CUSTOM_RESOURCE No description.
AWS_CUSTOM_RESOURCE No description.
CUSTOM_RESOURCE_PROVIDER No description.
CUSTOM_RESOURCE_PROVIDER_2 No description.
LAMBDA No description.
CFN_LAMBDA No description.
LAMBDA_LAYER_VERSION No description.
CFN_LAMBDA_LAYER_VERSION No description.
LAMBDA_ALIAS No description.
CFN_LAMBDA_ALIAS No description.
LAMBDA_BASE No description.
LAMBDA_SINGLETON No description.
LAMBDA_LAYER_AWSCLI No description.
CFN_LAMBDA_PERMISSIONS No description.
ASSET_STAGING No description.
S3_ASSET No description.
ECR_TARBALL_ASSET No description.
EC2_INSTANCE No description.
CFN_EC2_INSTANCE No description.
SECURITY_GROUP No description.
CFN_SECURITY_GROUP No description.
VPC No description.
CFN_VPC No description.
PRIVATE_SUBNET No description.
CFN_PRIVATE_SUBNET No description.
PUBLIC_SUBNET No description.
CFN_PUBLIC_SUBNET No description.
IAM_ROLE No description.

APP

PDKAPP_MONO

PDKAPP

STAGE

STACK

NESTED_STACK

CFN_STACK

CFN_OUTPUT

CFN_PARAMETER

CUSTOM_RESOURCE

AWS_CUSTOM_RESOURCE

CUSTOM_RESOURCE_PROVIDER

CUSTOM_RESOURCE_PROVIDER_2

LAMBDA

CFN_LAMBDA

LAMBDA_LAYER_VERSION

CFN_LAMBDA_LAYER_VERSION

LAMBDA_ALIAS

CFN_LAMBDA_ALIAS

LAMBDA_BASE

LAMBDA_SINGLETON

LAMBDA_LAYER_AWSCLI

CFN_LAMBDA_PERMISSIONS

ASSET_STAGING

S3_ASSET

ECR_TARBALL_ASSET

EC2_INSTANCE

CFN_EC2_INSTANCE

SECURITY_GROUP

CFN_SECURITY_GROUP

VPC

CFN_VPC

PRIVATE_SUBNET

CFN_PRIVATE_SUBNET

PUBLIC_SUBNET

CFN_PUBLIC_SUBNET

IAM_ROLE

EdgeDirectionEnum

EdgeDirection specifies in which direction the edge is directed or if it is undirected.

Members

Name Description
NONE Indicates that edge is undirected;
FORWARD Indicates the edge is directed from the source to the target.
BACK Indicates the edge is directed from the target to the source.
BOTH Indicates the edge is bi-directional.

NONE

Indicates that edge is undirected;

meaning there is no directional relationship between the source and target.


FORWARD

Indicates the edge is directed from the source to the target.


BACK

Indicates the edge is directed from the target to the source.


BOTH

Indicates the edge is bi-directional.


EdgeTypeEnum

Edge types handles by the graph.

Members

Name Description
CUSTOM Custom edge.
REFERENCE Reference edge (Ref, Fn::GetAtt, Fn::ImportValue).
DEPENDENCY CloudFormation dependency edge.

CUSTOM

Custom edge.


REFERENCE

Reference edge (Ref, Fn::GetAtt, Fn::ImportValue).


DEPENDENCY

CloudFormation dependency edge.


FilterPreset

Filter presets.

Members

Name Description
COMPACT Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges.
NON_EXTRANEOUS Collapses extraneous nodes to parent and prunes extraneous edges.
NONE No filtering is performed which will output verbose graph.

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.


NON_EXTRANEOUS

Collapses extraneous nodes to parent and prunes extraneous edges.


NONE

No filtering is performed which will output verbose graph.


FilterStrategy

Filter strategy to apply to filter matches.

Members

Name Description
PRUNE Remove filtered entity and all its edges.
COLLAPSE Collapse all child entities of filtered entity into filtered entity;
COLLAPSE_TO_PARENT Collapse all filtered entities into their parent entity;

PRUNE

Remove filtered entity and all its edges.


COLLAPSE

Collapse all child entities of filtered entity into filtered entity;

and hoist all edges.


COLLAPSE_TO_PARENT

Collapse all filtered entities into their parent entity;

and hoist its edges to parent.


FlagEnum

Graph flags.

Members

Name Description
CLUSTER Indicates that node is a cluster (container) and treated like an emphasized subgraph.
GRAPH_CONTAINER Indicates that node is non-resource container (Root, App) and used for structural purpose in the graph only.
EXTRANEOUS Indicates that the entity is extraneous and considered collapsible to parent without impact of intent.
ASSET Indicates node is considered a CDK Asset (Lambda Code, Docker Image, etc).
CDK_OWNED Indicates that node was created by CDK.
CFN_FQN Indicates node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct.
CLOSED_EDGE Indicates that edge is closed;
MUTATED Indicates that entity was mutated;
IMPORT Indicates that resource is imported into CDK (eg: lambda.Function.fromFunctionName(), s3.Bucket.fromBucketArn()).
CUSTOM_RESOURCE Indicates if node is a CustomResource.
AWS_CUSTOM_RESOURCE Indicates if node is an AwsCustomResource, which is a custom resource that simply calls the AWS SDK API via singleton provider.
AWS_API_CALL_LAMBDA Indicates if lambda function resource is a singleton AWS API call lambda for AwsCustomResources.

CLUSTER

Indicates that node is a cluster (container) and treated like an emphasized subgraph.


GRAPH_CONTAINER

Indicates that node is non-resource container (Root, App) and used for structural purpose in the graph only.


EXTRANEOUS

Indicates that the entity is extraneous and considered collapsible to parent without impact of intent.


ASSET

Indicates node is considered a CDK Asset (Lambda Code, Docker Image, etc).


CDK_OWNED

Indicates that node was created by CDK.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Resource.html#static-iswbrownedwbrresourceconstruct


CFN_FQN

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


CLOSED_EDGE

Indicates that edge is closed;

meaning source === target. This flag only gets applied on creation of edge, not during mutations to maintain initial intent.


MUTATED

Indicates that entity was mutated;

meaning a mutation was performed to change originally computed graph value.


IMPORT

Indicates that resource is imported into CDK (eg: lambda.Function.fromFunctionName(), s3.Bucket.fromBucketArn()).


CUSTOM_RESOURCE

Indicates if node is a CustomResource.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html


AWS_CUSTOM_RESOURCE

Indicates if node is an AwsCustomResource, which is a custom resource that simply calls the AWS SDK API via singleton provider.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.AwsCustomResource.html


AWS_API_CALL_LAMBDA

Indicates if lambda function resource is a singleton AWS API call lambda for AwsCustomResources.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.AwsCustomResource.html


MetadataTypeEnum

Common cdk metadata types.

Members

Name Description
LOGICAL_ID No description.

LOGICAL_ID

NodeTypeEnum

Node types handled by the graph.

Members

Name Description
DEFAULT Default node type - used for all nodes that don't have explicit type defined.
CFN_RESOURCE L1 cfn resource node.
RESOURCE L2 cdk resource node.
CUSTOM_RESOURCE Cdk customer resource node.
ROOT Graph root node.
APP Cdk App node.
STAGE Cdk Stage node.
STACK Cdk Stack node.
NESTED_STACK Cdk NestedStack node.
OUTPUT CfnOutput node.
PARAMETER CfnParameter node.
ASSET Cdk asset node.

DEFAULT

Default node type - used for all nodes that don't have explicit type defined.


CFN_RESOURCE

L1 cfn resource node.


RESOURCE

L2 cdk resource node.


CUSTOM_RESOURCE

Cdk customer resource node.


ROOT

Graph root node.


APP

Cdk App node.


STAGE

Cdk Stage node.


STACK

Cdk Stack node.


NESTED_STACK

Cdk NestedStack node.


OUTPUT

CfnOutput node.


PARAMETER

CfnParameter node.


ASSET

Cdk asset node.


ReferenceTypeEnum

Reference edge types.

Members

Name Description
REF CloudFormation Ref reference.
ATTRIBUTE CloudFormation Fn::GetAtt reference.
IMPORT CloudFormation Fn::ImportValue reference.
IMPORT_ARN CloudFormation Fn::Join reference of imported resourced (eg: s3.Bucket.fromBucketArn()).

REF

CloudFormation Ref reference.


ATTRIBUTE

CloudFormation Fn::GetAtt reference.


IMPORT

CloudFormation Fn::ImportValue reference.


IMPORT_ARN

CloudFormation Fn::Join reference of imported resourced (eg: s3.Bucket.fromBucketArn()).



Last update: 2024-05-08