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