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. |
root
Required
- Type: constructs.Construct
props
Optional
- Type: ICdkGraphProps
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.
x
Required
- 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. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
config
Required
public readonly config: {[ key: string ]: any};
- Type: {[ key: string ]: any}
Config.
plugins
Required
public readonly plugins: ICdkGraphPlugin[];
- Type: ICdkGraphPlugin[]
List of plugins registered with this instance.
root
Required
public readonly root: Construct;
- Type: constructs.Construct
graphContext
Optional
public readonly graphContext: CdkGraphContext;
- Type: 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. |
ID
Required
public readonly ID: string;
- Type: string
Fixed CdkGraph construct id.
VERSION
Required
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. |
filename
Required
public readonly filename: string;
- Type: string
Filename of the artifact.
filepath
Required
public readonly filepath: string;
- Type: string
Full path where artifact is stored.
id
Required
public readonly id: string;
- Type: string
The unique type of the artifact.
source
Required
public readonly source: string;
- Type: string
The source of the artifact (such as plugin, or core system, etc).
description
Optional
public readonly description: string;
- Type: string
Description of artifact.
ConstructInfo
Source information on a construct (class fqn and version).
Initializer
import { ConstructInfo } from '@aws/pdk/cdk-graph'
const constructInfo: ConstructInfo = { ... }
Properties
Name | Type | Description |
---|---|---|
fqn |
string |
No description. |
version |
string |
No description. |
fqn
Required
public readonly fqn: string;
- Type: string
version
Required
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. |
regex
Optional
public readonly regex: string;
- Type: string
String representation of a regex.
value
Optional
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. |
plugins
Optional
public readonly plugins: ICdkGraphPlugin[];
- Type: 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. |
graph
Optional
public readonly graph: IGraphFilter;
- Type: IGraphFilter
Graph Filter.
store
Optional
public readonly store: IGraphStoreFilter;
- Type: 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. |
allNodes
Optional
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}
edge
Optional
public readonly edge: IEdgePredicate;
- Type: IEdgePredicate
Predicate to match edges.
Edges are evaluated after nodes are filtered.
inverse
Optional
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.
node
Optional
public readonly node: INodePredicate;
- Type: INodePredicate
Predicate to match nodes.
strategy
Optional
public readonly strategy: FilterStrategy;
- Type: FilterStrategy
- Default: {FilterStrategy.PRUNE}
Filter strategy to apply to matching nodes.
Edges do not have a strategy, they are always pruned.
IGraphFilterPlan
Graph filter plan.
Initializer
import { 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. |
allNodes
Optional
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.
filters
Optional
public readonly filters: IFilter[];
- Type: IFilter[]
Ordered list of {@link IGraphFilter} and {@link IGraphStoreFilter} filters to apply to the store.
Filters are applied after the preset filtering is applied if present. - Filters are applied sequentially against all nodes, as opposed to IAspect.visitor pattern which are sequentially applied per node.
focus
Optional
public readonly focus: IGraphFilterPlanFocusConfig;
Config to focus the graph on specific node.
order
Optional
public readonly order: ConstructOrder;
- Type: constructs.ConstructOrder
- Default: {ConstructOrder.PREORDER}
The order to visit nodes and edges during filtering.
preset
Optional
public readonly preset: FilterPreset;
- Type: 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). |
filter
Required
public readonly filter: IFilterFocusCallback;
- Type: IFilterFocusCallback
The node or resolver to determine the node to focus on.
noHoist
Optional
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. |
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identity.
attributes
Optional
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.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Serializable entity flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Serializable entity metadata.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Serializable entity tags.
dependencies
Required
public readonly dependencies: string[];
- Type: string[]
unresolvedReferences
Required
public readonly unresolvedReferences: SGUnresolvedReference[];
- Type: SGUnresolvedReference[]
cfnType
Optional
public readonly cfnType: string;
- Type: string
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
logicalId
Optional
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). |
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identity.
attributes
Optional
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.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Serializable entity flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Serializable entity metadata.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Serializable entity tags.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
source
Required
public readonly source: string;
- Type: string
UUID of edge source node (tail).
target
Required
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. |
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identity.
attributes
Optional
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.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Serializable entity flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Serializable entity metadata.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Serializable entity 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. |
edges
Required
public readonly edges: SGEdge[];
- Type: SGEdge[]
List of edges.
tree
Required
public readonly tree: SGNode;
- Type: SGNode
Node tree.
version
Required
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. |
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identity.
attributes
Optional
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.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Serializable entity flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Serializable entity metadata.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Serializable entity tags.
id
Required
public readonly id: string;
- Type: string
Node id within parent (unique only between parent child nodes).
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Node type.
path
Required
public readonly path: string;
- Type: string
Node path.
cfnType
Optional
public readonly cfnType: string;
- Type: string
CloudFormation resource type for this node.
children
Optional
public readonly children: {[ key: string ]: SGNode};
- Type: {[ key: string ]: SGNode}
Child node record.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
edges
Optional
public readonly edges: string[];
- Type: string[]
List of edge UUIDs where this node is the source.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: string;
- Type: string
UUID of node parent.
stack
Optional
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. |
referenceType
Required
public readonly referenceType: ReferenceTypeEnum;
- Type: ReferenceTypeEnum
source
Required
public readonly source: string;
- Type: string
target
Required
public readonly target: string;
- Type: string
value
Optional
public readonly value: string | number | boolean | PlainObject | string | number | boolean | PlainObject[];
- Type: 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. |
props
Required
- Type: IAppNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- 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.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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}.
node
Required
- Type: 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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: 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. |
PATH
Required
public readonly PATH: string;
- Type: string
Fixed path of the App.
UUID
Required
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. |
props
Required
- Type: IAttributeReferenceProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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.
edge
Required
- Type: Edge
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.
edge
Required
- Type: Edge
The edge to consume.
mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutateSource
public mutateSource(node: Node): void
Change the edge source.
node
Required
- Type: Node
mutateTarget
public mutateTarget(node: Node): void
Change the edge target.
node
Required
- Type: Node
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.
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.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
findInChain
import { AttributeReference } from '@aws/pdk/cdk-graph'
AttributeReference.findInChain(chain: any[], predicate: IEdgePredicate)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
isRef
import { AttributeReference } from '@aws/pdk/cdk-graph'
AttributeReference.isRef(edge: Edge)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
isReference
import { AttributeReference } from '@aws/pdk/cdk-graph'
AttributeReference.isReference(edge: Edge)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
isAtt
import { AttributeReference } from '@aws/pdk/cdk-graph'
AttributeReference.isAtt(edge: Edge)
Indicates if edge in an Fn::GetAtt {@link Reference}.
edge
Required
- Type: Edge
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if edge allows destructive mutations.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
isClosed
Required
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.
isCrossStack
Required
public readonly isCrossStack: boolean;
- Type: boolean
Indicates if source and target nodes reside in different root stacks.
isExtraneous
Required
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).
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
referenceType
Required
public readonly referenceType: ReferenceTypeEnum;
- Type: ReferenceTypeEnum
Get type of reference.
value
Required
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_TYPE
Required
public readonly ATT_TYPE: string;
- Type: string
Attribute defining the type of reference.
PREFIX
Required
public readonly PREFIX: string;
- Type: string
Edge prefix to denote Fn::GetAtt type reference edge.
ATT_VALUE
Required
public readonly ATT_VALUE: string;
- Type: string
Attribute key for resolved value of attribute reference.
BaseEntity
- Implements: ISerializableEntity
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. |
props
Required
- Type: IBaseEntityProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroy the entity be removing all references and removing from store.
strict
Optional
- 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.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
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. |
store
Required
- Type: Store
outdir
Required
- 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.
id
Required
- Type: string
hasArtifactFile
public hasArtifactFile(filename: string): boolean
Indicates if context has an artifact with filename defined.
filename
Required
- 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.
source
Required
- Type: CdkGraph | ICdkGraphPlugin
The source of the artifact, such as the name of plugin.
id
Required
- Type: string
Unique id of the artifact.
filepath
Required
- Type: string
Full path where the artifact is stored.
description
Optional
- 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.
source
Required
- Type: CdkGraph | ICdkGraphPlugin
The source of the artifact, such as the name of plugin.
id
Required
- Type: string
Unique id of the artifact.
filename
Required
- Type: string
Relative name of the file.
data
Required
- Type: string
description
Optional
- 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. |
artifacts
Required
public readonly artifacts: {[ key: string ]: CdkGraphArtifact};
- Type: {[ key: string ]: CdkGraphArtifact}
Get record of all graph artifacts keyed by artifact id.
graphJson
Required
public readonly graphJson: CdkGraphArtifact;
- Type: CdkGraphArtifact
Get CdkGraph core graph.json
artifact.
outdir
Required
public readonly outdir: string;
- Type: string
store
Required
public readonly store: Store;
- Type: 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. |
props
Required
- Type: ICfnResourceNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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`
resource
Required
- Type: ResourceNode
{@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}.
node
Required
- Type: 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. |
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
isImport
Required
public readonly isImport: boolean;
- Type: boolean
Indicates if this CfnResource is imported (eg: s3.Bucket.fromBucketArn
).
resource
Optional
public readonly resource: ResourceNode;
- Type: ResourceNode
Reference to the L2 Resource that wraps this L1 CfnResource if it is wrapped.
Constants
Name | Type | Description |
---|---|---|
ATT_IMPORT_ARN_TOKEN |
string |
Normalized CfnReference attribute. |
ATT_IMPORT_ARN_TOKEN
Required
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. |
props
Required
- Type: ITypedEdgeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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.
edge
Required
- Type: Edge
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.
edge
Required
- Type: Edge
The edge to consume.
mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutateSource
public mutateSource(node: Node): void
Change the edge source.
node
Required
- Type: Node
mutateTarget
public mutateTarget(node: Node): void
Change the edge target.
node
Required
- Type: Node
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.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
findInChain
import { Dependency } from '@aws/pdk/cdk-graph'
Dependency.findInChain(chain: any[], predicate: IEdgePredicate)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
isDependency
import { Dependency } from '@aws/pdk/cdk-graph'
Dependency.isDependency(edge: Edge)
Indicates if given edge is a {@link Dependency} edge.
edge
Required
- Type: Edge
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). |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if edge allows destructive mutations.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
isClosed
Required
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.
isCrossStack
Required
public readonly isCrossStack: boolean;
- Type: boolean
Indicates if source and target nodes reside in different root stacks.
isExtraneous
Required
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).
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
Constants
Name | Type | Description |
---|---|---|
PREFIX |
string |
Edge prefix to denote dependency edge. |
PREFIX
Required
public readonly PREFIX: string;
- Type: string
Edge prefix to denote dependency edge.
Edge
- Implements: ISerializableEdge
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. |
props
Required
- Type: IEdgeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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.
edge
Required
- Type: Edge
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.
edge
Required
- Type: Edge
The edge to consume.
mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutateSource
public mutateSource(node: Node): void
Change the edge source.
node
Required
- Type: Node
mutateTarget
public mutateTarget(node: Node): void
Change the edge target.
node
Required
- Type: Node
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.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
findInChain
import { Edge } from '@aws/pdk/cdk-graph'
Edge.findInChain(chain: any[], predicate: IEdgePredicate)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
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). |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if edge allows destructive mutations.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
isClosed
Required
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.
isCrossStack
Required
public readonly isCrossStack: boolean;
- Type: boolean
Indicates if source and target nodes reside in different root stacks.
isExtraneous
Required
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).
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: 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.
cfnTypes
Required
- Type: FilterValue[]
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}
nodeTypes
Required
- Type: FilterValue[]
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.
cfnTypes
Required
- Type: FilterValue[]
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}
nodeTypes
Required
- Type: FilterValue[]
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.
clusterTypes
Optional
- Type: NodeTypeEnum[]
verifyFilterable
import { Filters } from '@aws/pdk/cdk-graph'
Filters.verifyFilterable(store: Store)
Verify that store is filterable, meaning it allows destructive mutations.
store
Required
- Type: Store
ImportReference
Import reference defines Fn::ImportValue type reference edge.
Initializers
import { ImportReference } from '@aws/pdk/cdk-graph'
new ImportReference(props: ITypedEdgeProps)
Name | Type | Description |
---|---|---|
props |
ITypedEdgeProps |
No description. |
props
Required
- Type: ITypedEdgeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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.
edge
Required
- Type: Edge
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.
edge
Required
- Type: Edge
The edge to consume.
mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutateSource
public mutateSource(node: Node): void
Change the edge source.
node
Required
- Type: Node
mutateTarget
public mutateTarget(node: Node): void
Change the edge target.
node
Required
- Type: Node
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.
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.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
findInChain
import { ImportReference } from '@aws/pdk/cdk-graph'
ImportReference.findInChain(chain: any[], predicate: IEdgePredicate)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
isRef
import { ImportReference } from '@aws/pdk/cdk-graph'
ImportReference.isRef(edge: Edge)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
isReference
import { ImportReference } from '@aws/pdk/cdk-graph'
ImportReference.isReference(edge: Edge)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
isImport
import { ImportReference } from '@aws/pdk/cdk-graph'
ImportReference.isImport(edge: Edge)
Indicates if edge is Fn::ImportValue based {@link Reference}.
edge
Required
- Type: Edge
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if edge allows destructive mutations.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
isClosed
Required
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.
isCrossStack
Required
public readonly isCrossStack: boolean;
- Type: boolean
Indicates if source and target nodes reside in different root stacks.
isExtraneous
Required
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).
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
referenceType
Required
public readonly referenceType: ReferenceTypeEnum;
- Type: 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_TYPE
Required
public readonly ATT_TYPE: string;
- Type: string
Attribute defining the type of reference.
PREFIX
Required
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. |
props
Required
- Type: INestedStackNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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.
node
Required
- Type: OutputNode
addParameter
public addParameter(node: ParameterNode): void
Associate {@link ParameterNode} with this stack.
node
Required
- Type: ParameterNode
findOutput
public findOutput(logicalId: string): OutputNode
Find {@link OutputNode} with logicalId defined by this stack.
logicalId
Required
- Type: string
findParameter
public findParameter(parameterId: string): ParameterNode
Find {@link ParameterNode} with parameterId defined by this stack.
parameterId
Required
- Type: string
mutateRemoveOutput
public mutateRemoveOutput(node: OutputNode): boolean
Disassociate {@link OutputNode} from this stack.
node
Required
- Type: OutputNode
mutateRemoveParameter
public mutateRemoveParameter(node: ParameterNode): boolean
Disassociate {@link ParameterNode} from this stack.
node
Required
- Type: ParameterNode
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}.
node
Required
- Type: Node
of
import { NestedStackNode } from '@aws/pdk/cdk-graph'
NestedStackNode.of(node: Node)
Gets the {@link StackNode} containing a given resource.
node
Required
- Type: Node
isNestedStackNode
import { NestedStackNode } from '@aws/pdk/cdk-graph'
NestedStackNode.isNestedStackNode(node: Node)
Indicates if node is a {@link NestedStackNode}.
node
Required
- Type: 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. |
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
exports
Required
public readonly exports: OutputNode[];
- Type: OutputNode[]
Get all exported {@link OutputNode}s defined by this stack.
outputs
Required
public readonly outputs: OutputNode[];
- Type: OutputNode[]
Get all {@link OutputNode}s defined by this stack.
parameters
Required
public readonly parameters: ParameterNode[];
- Type: ParameterNode[]
Get all {@link ParameterNode}s defined by this stack.
stage
Optional
public readonly stage: StageNode;
- Type: StageNode
Get {@link StageNode} containing this stack.
parentStack
Optional
public readonly parentStack: StackNode;
- Type: StackNode
Get parent stack of this nested stack.
Node
- Implements: ISerializableNode
Node class is the base definition of node entities in the graph, as in standard graph theory.
Initializers
import { Node } from '@aws/pdk/cdk-graph'
new Node(props: INodeProps)
Name | Type | Description |
---|---|---|
props |
INodeProps |
No description. |
props
Required
- Type: INodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- 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.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: 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. |
props
Required
- Type: IOutputNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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}.
node
Required
- Type: 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. |
isExport |
boolean |
Indicates if {@link OutputNode} is exported. |
value |
any |
Get the value* attribute. |
exportName |
string |
Get the export name attribute. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
isExport
Required
public readonly isExport: boolean;
- Type: boolean
Indicates if {@link OutputNode} is exported.
value
Required
public readonly value: any;
- Type: any
Get the value* attribute.
exportName
Optional
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_NAME
Required
public readonly ATTR_EXPORT_NAME: string;
- Type: string
Attribute key where output export name is stored.
ATTR_VALUE
Required
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. |
props
Required
- Type: IParameterNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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}.
node
Required
- Type: 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. |
isStackReference |
boolean |
Indicates if parameter is a reference to a stack. |
parameterType |
any |
Get the parameter type attribute. |
value |
any |
Get the value attribute. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
isStackReference
Required
public readonly isStackReference: boolean;
- Type: boolean
Indicates if parameter is a reference to a stack.
parameterType
Required
public readonly parameterType: any;
- Type: any
Get the parameter type attribute.
value
Required
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_TYPE
Required
public readonly ATTR_TYPE: string;
- Type: string
Attribute key where parameter type is stored.
ATTR_VALUE
Required
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. |
props
Required
- Type: IReferenceProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroy the edge.
Remove all references and remove from store.
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- 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.
edge
Required
- Type: Edge
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.
edge
Required
- Type: Edge
The edge to consume.
mutateDirection
public mutateDirection(direction: EdgeDirectionEnum): void
Change the edge direction.
direction
Required
- Type: EdgeDirectionEnum
mutateSource
public mutateSource(node: Node): void
Change the edge source.
node
Required
- Type: Node
mutateTarget
public mutateTarget(node: Node): void
Change the edge target.
node
Required
- Type: Node
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.
Static Functions
Name | Description |
---|---|
findAllInChain |
Find all matching edges based on predicate within an EdgeChain. |
findInChain |
Find first edge matching predicate within an EdgeChain. |
isRef |
Indicates if edge is a Ref based {@link Reference} edge. |
isReference |
Indicates if edge is a {@link Reference}. |
findAllInChain
import { Reference } from '@aws/pdk/cdk-graph'
Reference.findAllInChain(chain: any[], predicate: IEdgePredicate)
Find all matching edges based on predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
findInChain
import { Reference } from '@aws/pdk/cdk-graph'
Reference.findInChain(chain: any[], predicate: IEdgePredicate)
Find first edge matching predicate within an EdgeChain.
chain
Required
- Type: any[]
predicate
Required
- Type: IEdgePredicate
isRef
import { Reference } from '@aws/pdk/cdk-graph'
Reference.isRef(edge: Edge)
Indicates if edge is a Ref based {@link Reference} edge.
edge
Required
- Type: Edge
isReference
import { Reference } from '@aws/pdk/cdk-graph'
Reference.isReference(edge: Edge)
Indicates if edge is a {@link Reference}.
edge
Required
- Type: Edge
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if edge allows destructive mutations.
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
isClosed
Required
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.
isCrossStack
Required
public readonly isCrossStack: boolean;
- Type: boolean
Indicates if source and target nodes reside in different root stacks.
isExtraneous
Required
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).
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
referenceType
Required
public readonly referenceType: ReferenceTypeEnum;
- Type: ReferenceTypeEnum
Get type of reference.
Constants
Name | Type | Description |
---|---|---|
ATT_TYPE |
string |
Attribute defining the type of reference. |
PREFIX |
string |
Edge prefix to denote Ref type reference edge. |
ATT_TYPE
Required
public readonly ATT_TYPE: string;
- Type: string
Attribute defining the type of reference.
PREFIX
Required
public readonly PREFIX: string;
- Type: string
Edge prefix to denote Ref type reference edge.
ResourceNode
ResourceNode class defines a L2 cdk resource construct.
Initializers
import { ResourceNode } from '@aws/pdk/cdk-graph'
new ResourceNode(props: IResourceNodeProps)
Name | Type | Description |
---|---|---|
props |
IResourceNodeProps |
No description. |
props
Required
- Type: IResourceNodeProps
Methods
Name | Description |
---|---|
addAttribute |
Add attribute. |
addFlag |
Add flag. |
addMetadata |
Add metadata entry. |
addTag |
Add tag. |
applyData |
Applies data (attributes, metadata, tags, flag) to entity. |
findMetadata |
Retrieves all metadata entries of a given type. |
getAttribute |
Get attribute by key. |
getTag |
Get tag by key. |
hasAttribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
hasFlag |
Indicates if entity has a given flag. |
hasMetadata |
Indicates if entity has matching metadata entry. |
hasTag |
Indicates if entity has tag, optionally verifying tag value. |
mutateDestroy |
Destroys this node by removing all references and removing this node from the store. |
setAttribute |
Set attribute. |
setTag |
Set tag. |
addChild |
Add child node. |
addLink |
Add link to another node. |
addReverseLink |
Add link from another node. |
doesDependOn |
Indicates if this node depends on another node. |
doesReference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
findAll |
Return this construct and all of its sub-nodes in the given order. |
findAllLinks |
Return all direct links of this node and that of all sub-nodes. |
findAncestor |
Find nearest ancestor of this node matching given predicate. |
findChild |
Find child with given id. |
findLink |
Find link of this node based on predicate. |
findLinks |
Find all links of this node based on predicate. |
getCfnProp |
Get specific CloudFormation property. |
getChild |
Get child node with given id. |
getLinkChains |
Resolve all link chains. |
getNearestAncestor |
Gets the nearest common ancestor shared between this node and another node. |
isAncestor |
Indicates if a specific node is an ancestor of this node. |
isChild |
Indicates if specific node is a child of this node. |
mutateCollapse |
Collapses all sub-nodes of this node into this node. |
mutateCollapseTo |
Collapses this node into an ancestor. |
mutateCollapseToParent |
Collapses this node into it's parent node. |
mutateHoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutateMove |
Move this node into a new parent node. |
mutateRemoveChild |
Remove a child node from this node. |
mutateRemoveLink |
Remove a link from this node. |
mutateRemoveReverseLink |
Remove a link to this node. |
mutateUncluster |
Hoist all children to parent and collapse node to parent. |
toString |
Get string representation of this node. |
mutateCfnResource |
Modifies the L1 resource wrapped by this L2 resource. |
addAttribute
public addAttribute(key: string, value: any): void
Add attribute.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- 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.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
mutateUncluster
public mutateUncluster(): void
Hoist all children to parent and collapse node to parent.
toString
public toString(): string
Get string representation of this node.
mutateCfnResource
public mutateCfnResource(cfnResource?: CfnResourceNode): void
Modifies the L1 resource wrapped by this L2 resource.
cfnResource
Optional
- Type: CfnResourceNode
Static Functions
Name | Description |
---|---|
isResourceNode |
Indicates if node is a {@link ResourceNode}. |
isResourceNode
import { ResourceNode } from '@aws/pdk/cdk-graph'
ResourceNode.isResourceNode(node: Node)
Indicates if node is a {@link ResourceNode}.
node
Required
- Type: 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 |
Get the cfn properties from the L1 resource that this L2 resource wraps. |
cfnType |
string |
Get the CloudFormation resource type for this L2 resource or for the L1 resource is wraps. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
constructInfoFqn |
string |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
rootStack |
StackNode |
Get root stack. |
stack |
StackNode |
Stack the node is contained in. |
isCdkOwned |
boolean |
Indicates if this resource is owned by cdk (defined in cdk library). |
isWrapper |
boolean |
Indicates if Resource wraps a single CfnResource. |
cfnResource |
CfnResourceNode |
Get the default/primary CfnResource that this Resource wraps. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Get the cfn properties from the L1 resource that this L2 resource wraps.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this L2 resource or for the L1 resource is wraps.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
isCdkOwned
Required
public readonly isCdkOwned: boolean;
- Type: boolean
Indicates if this resource is owned by cdk (defined in cdk library).
isWrapper
Required
public readonly isWrapper: boolean;
- Type: boolean
Indicates if Resource wraps a single CfnResource.
cfnResource
Optional
public readonly cfnResource: CfnResourceNode;
- Type: CfnResourceNode
Get the default/primary CfnResource that this Resource wraps.
Constants
Name | Type | Description |
---|---|---|
ATT_WRAPPED_CFN_PROPS |
string |
Attribute key for cfn properties. |
ATT_WRAPPED_CFN_TYPE |
string |
Attribute key for cfn resource type. |
ATT_WRAPPED_CFN_PROPS
Required
public readonly ATT_WRAPPED_CFN_PROPS: string;
- Type: string
Attribute key for cfn properties.
ATT_WRAPPED_CFN_TYPE
Required
public readonly ATT_WRAPPED_CFN_TYPE: string;
- Type: string
Attribute key for cfn resource type.
RootNode
RootNode represents the root of the store tree.
Initializers
import { RootNode } from '@aws/pdk/cdk-graph'
new RootNode(store: Store)
Name | Type | Description |
---|---|---|
store |
Store |
Reference to the store. |
store
Required
- Type: Store
Reference to the store.
Methods
Name | Description |
---|---|
addAttribute |
Add attribute. |
addFlag |
Add flag. |
addMetadata |
Add metadata entry. |
addTag |
Add tag. |
applyData |
Applies data (attributes, metadata, tags, flag) to entity. |
findMetadata |
Retrieves all metadata entries of a given type. |
getAttribute |
Get attribute by key. |
getTag |
Get tag by key. |
hasAttribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
hasFlag |
Indicates if entity has a given flag. |
hasMetadata |
Indicates if entity has matching metadata entry. |
hasTag |
Indicates if entity has tag, optionally verifying tag value. |
mutateDestroy |
Destroys this node by removing all references and removing this node from the store. |
setAttribute |
Set attribute. |
setTag |
Set tag. |
addChild |
Add child node. |
addLink |
Add link to another node. |
addReverseLink |
Add link from another node. |
doesDependOn |
Indicates if this node depends on another node. |
doesReference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
findAll |
Return this construct and all of its sub-nodes in the given order. |
findAllLinks |
Return all direct links of this node and that of all sub-nodes. |
findAncestor |
Find nearest ancestor of this node matching given predicate. |
findChild |
Find child with given id. |
findLink |
Find link of this node based on predicate. |
findLinks |
Find all links of this node based on predicate. |
getCfnProp |
Get specific CloudFormation property. |
getChild |
Get child node with given id. |
getLinkChains |
Resolve all link chains. |
getNearestAncestor |
Gets the nearest common ancestor shared between this node and another node. |
isAncestor |
Indicates if a specific node is an ancestor of this node. |
isChild |
Indicates if specific node is a child of this node. |
mutateCollapse |
Collapses all sub-nodes of this node into this node. |
mutateCollapseTo |
Collapses this node into an ancestor > {@link RootNode} does not support this mutation. |
mutateCollapseToParent |
Collapses this node into it's parent node > {@link RootNode} does not support this mutation. |
mutateHoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutateMove |
Move this node into a new parent node. |
mutateRemoveChild |
Remove a child node from this node. |
mutateRemoveLink |
Remove a link from this node. |
mutateRemoveReverseLink |
Remove a link to this node. |
mutateUncluster |
Hoist all children to parent and collapse node to parent. |
toString |
Get string representation of this node. |
addAttribute
public addAttribute(key: string, value: any): void
Add attribute.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(_strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
{@link RootNode} does not support this mutation
_strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
findAll
public findAll(options?: IFindNodeOptions): Node[]
Return this construct and all of its sub-nodes in the given order.
Optionally filter nodes based on predicate. The root not is excluded from list
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
mutateCollapse
public mutateCollapse(): void
Collapses all sub-nodes of this node into this node.
{@link RootNode} does not support this mutation
mutateCollapseTo
public mutateCollapseTo(_ancestor: Node): Node
Collapses this node into an ancestor > {@link RootNode} does not support this mutation.
_ancestor
Required
- Type: Node
mutateCollapseToParent
public mutateCollapseToParent(): Node
Collapses this node into it's parent node > {@link RootNode} does not support this mutation.
mutateHoist
public mutateHoist(_newParent: Node): void
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor.
{@link RootNode} does not support this mutation
_newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
mutateUncluster
public mutateUncluster(): void
Hoist all children to parent and collapse node to parent.
toString
public toString(): string
Get string representation of this node.
Static Functions
Name | Description |
---|---|
isRootNode |
Indicates if node is a {@link RootNode}. |
isRootNode
import { RootNode } from '@aws/pdk/cdk-graph'
RootNode.isRootNode(node: Node)
Indicates if node is a {@link RootNode}.
node
Required
- Type: 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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
Constants
Name | Type | Description |
---|---|---|
PATH |
string |
Fixed path of root. |
UUID |
string |
Fixed UUID of root. |
PATH
Required
public readonly PATH: string;
- Type: string
Fixed path of root.
UUID
Required
public readonly UUID: string;
- Type: string
Fixed UUID of root.
StackNode
StackNode defines a cdk Stack.
Initializers
import { StackNode } from '@aws/pdk/cdk-graph'
new StackNode(props: IStackNodeProps)
Name | Type | Description |
---|---|---|
props |
IStackNodeProps |
No description. |
props
Required
- Type: IStackNodeProps
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.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- Type: boolean
setAttribute
public setAttribute(key: string, value: any): void
Set attribute.
This will overwrite existing attribute.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
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.
node
Required
- Type: OutputNode
addParameter
public addParameter(node: ParameterNode): void
Associate {@link ParameterNode} with this stack.
node
Required
- Type: ParameterNode
findOutput
public findOutput(logicalId: string): OutputNode
Find {@link OutputNode} with logicalId defined by this stack.
logicalId
Required
- Type: string
findParameter
public findParameter(parameterId: string): ParameterNode
Find {@link ParameterNode} with parameterId defined by this stack.
parameterId
Required
- Type: string
mutateRemoveOutput
public mutateRemoveOutput(node: OutputNode): boolean
Disassociate {@link OutputNode} from this stack.
node
Required
- Type: OutputNode
mutateRemoveParameter
public mutateRemoveParameter(node: ParameterNode): boolean
Disassociate {@link ParameterNode} from this stack.
node
Required
- Type: ParameterNode
Static Functions
Name | Description |
---|---|
isStackNode |
Indicates if node is a {@link StackNode}. |
of |
Gets the {@link StackNode} containing a given resource. |
isStackNode
import { StackNode } from '@aws/pdk/cdk-graph'
StackNode.isStackNode(node: Node)
Indicates if node is a {@link StackNode}.
node
Required
- Type: Node
of
import { StackNode } from '@aws/pdk/cdk-graph'
StackNode.of(node: Node)
Gets the {@link StackNode} containing a given resource.
node
Required
- Type: 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. |
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. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
exports
Required
public readonly exports: OutputNode[];
- Type: OutputNode[]
Get all exported {@link OutputNode}s defined by this stack.
outputs
Required
public readonly outputs: OutputNode[];
- Type: OutputNode[]
Get all {@link OutputNode}s defined by this stack.
parameters
Required
public readonly parameters: ParameterNode[];
- Type: ParameterNode[]
Get all {@link ParameterNode}s defined by this stack.
stage
Optional
public readonly stage: StageNode;
- Type: StageNode
Get {@link StageNode} containing this stack.
StageNode
StageNode defines a cdk Stage.
Initializers
import { StageNode } from '@aws/pdk/cdk-graph'
new StageNode(props: ITypedNodeProps)
Name | Type | Description |
---|---|---|
props |
ITypedNodeProps |
No description. |
props
Required
- Type: ITypedNodeProps
Methods
Name | Description |
---|---|
addAttribute |
Add attribute. |
addFlag |
Add flag. |
addMetadata |
Add metadata entry. |
addTag |
Add tag. |
applyData |
Applies data (attributes, metadata, tags, flag) to entity. |
findMetadata |
Retrieves all metadata entries of a given type. |
getAttribute |
Get attribute by key. |
getTag |
Get tag by key. |
hasAttribute |
Indicates if entity has a given attribute defined, and optionally with a specific value. |
hasFlag |
Indicates if entity has a given flag. |
hasMetadata |
Indicates if entity has matching metadata entry. |
hasTag |
Indicates if entity has tag, optionally verifying tag value. |
mutateDestroy |
Destroys this node by removing all references and removing this node from the store. |
setAttribute |
Set attribute. |
setTag |
Set tag. |
addChild |
Add child node. |
addLink |
Add link to another node. |
addReverseLink |
Add link from another node. |
doesDependOn |
Indicates if this node depends on another node. |
doesReference |
Indicates if this node references another node. |
find |
Recursively find the nearest sub-node matching predicate. |
findAll |
Return this construct and all of its sub-nodes in the given order. |
findAllLinks |
Return all direct links of this node and that of all sub-nodes. |
findAncestor |
Find nearest ancestor of this node matching given predicate. |
findChild |
Find child with given id. |
findLink |
Find link of this node based on predicate. |
findLinks |
Find all links of this node based on predicate. |
getCfnProp |
Get specific CloudFormation property. |
getChild |
Get child node with given id. |
getLinkChains |
Resolve all link chains. |
getNearestAncestor |
Gets the nearest common ancestor shared between this node and another node. |
isAncestor |
Indicates if a specific node is an ancestor of this node. |
isChild |
Indicates if specific node is a child of this node. |
mutateCollapse |
Collapses all sub-nodes of this node into this node. |
mutateCollapseTo |
Collapses this node into an ancestor. |
mutateCollapseToParent |
Collapses this node into it's parent node. |
mutateHoist |
Hoist this node to an ancestor by removing it from its current parent node and in turn moving it to the ancestor. |
mutateMove |
Move this node into a new parent node. |
mutateRemoveChild |
Remove a child node from this node. |
mutateRemoveLink |
Remove a link from this node. |
mutateRemoveReverseLink |
Remove a link to this node. |
mutateUncluster |
Hoist all children to parent and collapse node to parent. |
toString |
Get string representation of this node. |
addStack |
Associate a {@link StackNode} with this stage. |
mutateRemoveStack |
Disassociate {@link StackNode} from this stage. |
addAttribute
public addAttribute(key: string, value: any): void
Add attribute.
key
Required
- Type: string
value
Required
- Type: any
addFlag
public addFlag(flag: FlagEnum): void
Add flag.
flag
Required
- Type: FlagEnum
addMetadata
public addMetadata(metadataType: string, data: any): void
Add metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
addTag
public addTag(key: string, value: string): void
Add tag.
key
Required
- Type: string
value
Required
- 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.
data
Required
- Type: IBaseEntityDataProps
The data to apply.
overwrite
Optional
- Type: boolean
applyFlags
Optional
- 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.
metadataType
Required
- Type: string
getAttribute
public getAttribute(key: string): any
Get attribute by key.
key
Required
- Type: string
getTag
public getTag(key: string): string
Get tag by key.
key
Required
- Type: string
hasAttribute
public hasAttribute(key: string, value?: any): boolean
Indicates if entity has a given attribute defined, and optionally with a specific value.
key
Required
- Type: string
value
Optional
- Type: any
hasFlag
public hasFlag(flag: FlagEnum): boolean
Indicates if entity has a given flag.
flag
Required
- Type: FlagEnum
hasMetadata
public hasMetadata(metadataType: string, data: any): boolean
Indicates if entity has matching metadata entry.
metadataType
Required
- Type: string
data
Required
- Type: any
hasTag
public hasTag(key: string, value?: string): boolean
Indicates if entity has tag, optionally verifying tag value.
key
Required
- Type: string
value
Optional
- Type: string
mutateDestroy
public mutateDestroy(strict?: boolean): void
Destroys this node by removing all references and removing this node from the store.
strict
Optional
- 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.
key
Required
- Type: string
value
Required
- Type: any
setTag
public setTag(key: string, value: string): void
Set tag.
Will overwrite existing tag.
key
Required
- Type: string
value
Required
- Type: string
addChild
public addChild(node: Node): void
Add child node.
node
Required
- Type: Node
addLink
public addLink(edge: Edge): void
Add link to another node.
edge
Required
- Type: Edge
addReverseLink
public addReverseLink(edge: Edge): void
Add link from another node.
edge
Required
- Type: Edge
doesDependOn
public doesDependOn(node: Node): boolean
Indicates if this node depends on another node.
node
Required
- Type: Node
doesReference
public doesReference(node: Node): boolean
Indicates if this node references another node.
node
Required
- Type: Node
find
public find(predicate: INodePredicate): Node
Recursively find the nearest sub-node matching predicate.
predicate
Required
- Type: INodePredicate
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.
options
Optional
- Type: IFindNodeOptions
findAllLinks
public findAllLinks(options?: IFindEdgeOptions): Edge[]
Return all direct links of this node and that of all sub-nodes.
Optionally filter links based on predicate.
options
Optional
- Type: IFindEdgeOptions
findAncestor
public findAncestor(predicate: INodePredicate, max?: number): Node
Find nearest ancestor of this node matching given predicate.
predicate
Required
- Type: INodePredicate
Predicate to match ancestor.
max
Optional
- 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.
id
Required
- Type: string
findLink
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- Type: boolean
Indicates that only direct links should be searched.
findLinks
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.
predicate
Required
- Type: IEdgePredicate
Edge predicate function to match edge.
reverse
Optional
- Type: boolean
Indicates if links are search in reverse order.
follow
Optional
- Type: boolean
Indicates if link chain is followed.
direct
Optional
- 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.
key
Required
- Type: string
getChild
public getChild(id: string): Node
Get child node with given id.
id
Required
- Type: string
getLinkChains
public getLinkChains(reverse?: boolean): any[][]
Resolve all link chains.
reverse
Optional
- Type: boolean
getNearestAncestor
public getNearestAncestor(node: Node): Node
Gets the nearest common ancestor shared between this node and another node.
node
Required
- Type: Node
isAncestor
public isAncestor(ancestor: Node): boolean
Indicates if a specific node is an ancestor of this node.
ancestor
Required
- Type: Node
isChild
public isChild(node: Node): boolean
Indicates if specific node is a child of this node.
node
Required
- Type: Node
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.
ancestor
Required
- Type: Node
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.
newParent
Required
- Type: Node
mutateMove
public mutateMove(newParent: Node): void
Move this node into a new parent node.
newParent
Required
- Type: Node
The parent to move this node to.
mutateRemoveChild
public mutateRemoveChild(node: Node): boolean
Remove a child node from this node.
node
Required
- Type: Node
mutateRemoveLink
public mutateRemoveLink(link: Edge): boolean
Remove a link from this node.
link
Required
- Type: Edge
mutateRemoveReverseLink
public mutateRemoveReverseLink(link: Edge): boolean
Remove a link to this node.
link
Required
- Type: Edge
mutateUncluster
public mutateUncluster(): void
Hoist all children to parent and collapse node to parent.
toString
public toString(): string
Get string representation of this node.
addStack
public addStack(stack: StackNode): void
Associate a {@link StackNode} with this stage.
stack
Required
- Type: StackNode
mutateRemoveStack
public mutateRemoveStack(stack: StackNode): boolean
Disassociate {@link StackNode} from this stage.
stack
Required
- Type: StackNode
Static Functions
Name | Description |
---|---|
isStageNode |
Indicates if node is a {@link StageNode}. |
of |
Gets the {@link StageNode} containing a given resource. |
isStageNode
import { StageNode } from '@aws/pdk/cdk-graph'
StageNode.isStageNode(node: Node)
Indicates if node is a {@link StageNode}.
node
Required
- Type: Node
of
import { StageNode } from '@aws/pdk/cdk-graph'
StageNode.of(node: Node)
Gets the {@link StageNode} containing a given resource.
node
Required
- Type: 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. |
stacks |
StackNode[] |
Gets all stacks contained by this stage. |
attributes
Required
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.
flags
Required
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Get readonly list of all flags.
isDestroyed
Required
public readonly isDestroyed: boolean;
- Type: boolean
Indicates if the entity has been destroyed (eg: removed from store).
isMutated
Required
public readonly isMutated: boolean;
- Type: boolean
Indicates if the entity has had destructive mutations applied.
metadata
Required
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Get readonly list of all metadata entries.
store
Required
public readonly store: Store;
- Type: Store
Reference to the store.
tags
Required
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Get readonly record of all tags.
uuid
Required
public readonly uuid: string;
- Type: string
Universally unique identifier.
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if this node allows destructive mutations.
children
Required
public readonly children: Node[];
- Type: Node[]
Get all direct child nodes.
dependedOnBy
Required
public readonly dependedOnBy: Node[];
- Type: Node[]
Get list of Nodes that depend on this node.
dependencies
Required
public readonly dependencies: Node[];
- Type: Node[]
Get list of Nodes that this node depends on.
dependencyLinks
Required
public readonly dependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the source.
depth
Required
public readonly depth: number;
- Type: number
Indicates the depth of the node relative to root (0).
id
Required
public readonly id: string;
- Type: string
Node id, which is only unique within parent scope.
isAsset
Required
public readonly isAsset: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.ASSET}.
isCfnFqn
Required
public readonly isCfnFqn: boolean;
- Type: boolean
Indicates if node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
isCluster
Required
public readonly isCluster: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.CLUSTER}.
isCustomResource
Required
public readonly isCustomResource: boolean;
- Type: boolean
Indicates if node is a Custom Resource.
isExtraneous
Required
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.
isGraphContainer
Required
public readonly isGraphContainer: boolean;
- Type: boolean
Indicates if this node is considered a {@link FlagEnum.GRAPH_CONTAINER}.
isLeaf
Required
public readonly isLeaf: boolean;
- Type: boolean
Indicates if this node is a leaf node, which means it does not have children.
isTopLevel
Required
public readonly isTopLevel: boolean;
- Type: boolean
Indicates if node is direct child of the graph root node.
links
Required
public readonly links: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the source.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
path
Required
public readonly path: string;
- Type: string
Path of the node.
referencedBy
Required
public readonly referencedBy: Node[];
- Type: Node[]
Get list of Nodes that reference this node.
referenceLinks
Required
public readonly referenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the source.
references
Required
public readonly references: Node[];
- Type: Node[]
Get list of Nodes that this node references.
reverseDependencyLinks
Required
public readonly reverseDependencyLinks: Dependency[];
- Type: Dependency[]
Gets list of {@link Dependency} links (edges) where this node is the target.
reverseLinks
Required
public readonly reverseLinks: Edge[];
- Type: Edge[]
Gets all links (edges) in which this node is the target.
reverseReferenceLinks
Required
public readonly reverseReferenceLinks: Reference[];
- Type: Reference[]
Gets list of {@link Reference} links (edges) where this node is the target.
scopes
Required
public readonly scopes: Node[];
- Type: Node[]
Gets descending ordered list of ancestors from the root.
siblings
Required
public readonly siblings: Node[];
- Type: Node[]
Get list of siblings of this node.
cfnProps
Optional
public readonly cfnProps: PlainObject;
- Type: PlainObject
Gets CloudFormation properties for this node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Get the CloudFormation resource type for this node.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
constructInfoFqn
Optional
public readonly constructInfoFqn: string;
- Type: string
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
Only the root node should not have parent.
rootStack
Optional
public readonly rootStack: StackNode;
- Type: StackNode
Get root stack.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained in.
stacks
Required
public readonly stacks: StackNode[];
- Type: StackNode[]
Gets all stacks contained by this stage.
Store
- Implements: ISerializableGraphStore
Store class provides the in-memory database-like interface for managing all entities in the graph.
Initializers
import { Store } from '@aws/pdk/cdk-graph'
new Store(allowDestructiveMutations?: boolean)
Name | Type | Description |
---|---|---|
allowDestructiveMutations |
boolean |
No description. |
allowDestructiveMutations
Optional
- Type: boolean
Methods
Name | Description |
---|---|
addEdge |
Add edge to the store. |
addNode |
Add node to the store. |
addStack |
Add stack node to the store. |
addStage |
Add stage to the store. |
clone |
Clone the store to allow destructive mutations. |
computeLogicalUniversalId |
Compute universal logicalId based on parent stack and construct logicalId (<stack>:<logicalId> ). |
findNodeByImportArn |
Attempts to lookup the {@link Node} associated with a given import arn token. |
findNodeByLogicalId |
Find node within given stack with given logicalId. |
findNodeByLogicalUniversalId |
Find node by universal logicalId (<stack>:<logicalId> ). |
getEdge |
Get stored edge by UUID. |
getNode |
Get stored node by UUID. |
getStack |
Get stored stack node by UUID. |
getStage |
Get stored stage node by UUID. |
mutateRemoveEdge |
Remove edge from the store. |
mutateRemoveNode |
Remove node from the store. |
recordImportArn |
Records arn tokens from imported resources (eg: s3.Bucket.fromBucketArn() ) that are used for resolving references. |
recordLogicalId |
Record a universal logicalId to node mapping in the store. |
serialize |
Serialize the store. |
verifyDestructiveMutationAllowed |
Verifies that the store allows destructive mutations. |
addEdge
public addEdge(edge: Edge): void
Add edge to the store.
edge
Required
- Type: Edge
addNode
public addNode(node: Node): void
Add node to the store.
node
Required
- Type: Node
addStack
public addStack(stack: StackNode): void
Add stack node to the store.
stack
Required
- Type: StackNode
addStage
public addStage(stage: StageNode): void
Add stage to the store.
stage
Required
- Type: StageNode
clone
public clone(allowDestructiveMutations?: boolean): Store
Clone the store to allow destructive mutations.
allowDestructiveMutations
Optional
- Type: boolean
Indicates if destructive mutations are allowed;
defaults to true
computeLogicalUniversalId
public computeLogicalUniversalId(stack: StackNode, logicalId: string): string
Compute universal logicalId based on parent stack and construct logicalId (<stack>:<logicalId>
).
Construct logicalIds are only unique within their containing stack, so to use logicalId* lookups universally (like resolving references) we need a universal key.
stack
Required
- Type: StackNode
logicalId
Required
- Type: string
findNodeByImportArn
public findNodeByImportArn(value: any): Node
Attempts to lookup the {@link Node} associated with a given import arn token.
value
Required
- Type: any
Import arn value, which is either object to tokenize or already tokenized string.
findNodeByLogicalId
public findNodeByLogicalId(stack: StackNode, logicalId: string): Node
Find node within given stack with given logicalId.
stack
Required
- Type: StackNode
logicalId
Required
- Type: string
findNodeByLogicalUniversalId
public findNodeByLogicalUniversalId(uid: string): Node
Find node by universal logicalId (<stack>:<logicalId>
).
uid
Required
- Type: string
getEdge
public getEdge(uuid: string): Edge
Get stored edge by UUID.
uuid
Required
- Type: string
getNode
public getNode(uuid: string): Node
Get stored node by UUID.
uuid
Required
- Type: string
getStack
public getStack(uuid: string): StackNode
Get stored stack node by UUID.
uuid
Required
- Type: string
getStage
public getStage(uuid: string): StageNode
Get stored stage node by UUID.
uuid
Required
- Type: string
mutateRemoveEdge
public mutateRemoveEdge(edge: Edge): boolean
Remove edge from the store.
edge
Required
- Type: Edge
mutateRemoveNode
public mutateRemoveNode(node: Node): boolean
Remove node from the store.
node
Required
- Type: Node
recordImportArn
public recordImportArn(arnToken: string, resource: Node): void
Records arn tokens from imported resources (eg: s3.Bucket.fromBucketArn()
) that are used for resolving references.
arnToken
Required
- Type: string
resource
Required
- Type: Node
recordLogicalId
public recordLogicalId(stack: StackNode, logicalId: string, resource: Node): void
Record a universal logicalId to node mapping in the store.
stack
Required
- Type: StackNode
logicalId
Required
- Type: string
resource
Required
- Type: Node
serialize
public serialize(): SGGraphStore
Serialize the store.
verifyDestructiveMutationAllowed
public verifyDestructiveMutationAllowed(): void
Verifies that the store allows destructive mutations.
Static Functions
Name | Description |
---|---|
fromSerializedStore |
Builds store from serialized store data. |
fromSerializedStore
import { Store } from '@aws/pdk/cdk-graph'
Store.fromSerializedStore(serializedStore: SGGraphStore)
Builds store from serialized store data.
serializedStore
Required
- Type: SGGraphStore
Properties
Name | Type | Description |
---|---|---|
allowDestructiveMutations |
boolean |
Indicates if the store allows destructive mutations. |
counts |
IStoreCounts |
Get record of all store counters. |
edges |
Edge[] |
Gets all stored edges. |
nodes |
Node[] |
Gets all stored nodes. |
root |
RootNode |
Root node in the store. |
rootStacks |
StackNode[] |
Gets all stored root stack nodes. |
stacks |
StackNode[] |
Gets all stored stack nodes. |
stages |
StageNode[] |
Gets all stored stage nodes. |
version |
string |
Current SemVer version of the store. |
allowDestructiveMutations
Required
public readonly allowDestructiveMutations: boolean;
- Type: boolean
Indicates if the store allows destructive mutations.
Destructive mutations are only allowed on clones of the store to prevent plugins and filters from mutating the store for downstream plugins.
All mutate*
methods are only allowed on stores that allow destructive mutations.
This behavior may change in the future if the need arises for plugins to pass mutated stores to downstream plugins. But it will be done cautiously with ensuring the intent of downstream plugin is to receive the mutated store.
counts
Required
public readonly counts: IStoreCounts;
- Type: IStoreCounts
Get record of all store counters.
edges
Required
public readonly edges: Edge[];
- Type: Edge[]
Gets all stored edges.
nodes
Required
public readonly nodes: Node[];
- Type: Node[]
Gets all stored nodes.
root
Required
public readonly root: RootNode;
- Type: RootNode
Root node in the store.
The root node is not the computed root, but the graph root which is auto-generated and can not be mutated.
rootStacks
Required
public readonly rootStacks: StackNode[];
- Type: StackNode[]
Gets all stored root stack nodes.
stacks
Required
public readonly stacks: StackNode[];
- Type: StackNode[]
Gets all stored stack nodes.
stages
Required
public readonly stages: StageNode[];
- Type: StageNode[]
Gets all stored stage nodes.
version
Required
public readonly version: string;
- Type: string
Current SemVer version of the store.
Protocols
IAppNodeProps
-
Extends: IBaseEntityDataProps
-
Implemented By: IAppNodeProps
{@link AppNode} props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
IAttributeReferenceProps
-
Extends: ITypedEdgeProps
-
Implemented By: IAttributeReferenceProps
Attribute type reference props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
value |
string | number | boolean | PlainObject | string | number | boolean | PlainObject[] |
Resolved attribute value. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
value
Required
public readonly value: string | number | boolean | PlainObject | string | number | boolean | PlainObject[];
- Type: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]
Resolved attribute value.
IBaseEntityDataProps
- Implemented By: IAppNodeProps, IAttributeReferenceProps, IBaseEntityDataProps, IBaseEntityProps, ICfnResourceNodeProps, IEdgeProps, INestedStackNodeProps, INodeProps, IOutputNodeProps, IParameterNodeProps, IReferenceProps, IResourceNodeProps, IStackNodeProps, ITypedEdgeProps, ITypedNodeProps
Base interface for all store entities data props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
IBaseEntityProps
-
Extends: IBaseEntityDataProps
-
Implemented By: IAttributeReferenceProps, IBaseEntityProps, ICfnResourceNodeProps, IEdgeProps, INestedStackNodeProps, INodeProps, IOutputNodeProps, IParameterNodeProps, IReferenceProps, IResourceNodeProps, IStackNodeProps, ITypedEdgeProps, ITypedNodeProps
Base interface for all store entities props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
ICdkGraphPlugin
- Implemented By: ICdkGraphPlugin
CdkGraph Plugin interface.
Properties
Name | Type | Description |
---|---|---|
id |
string |
Unique identifier for this plugin. |
version |
string |
Plugin version. |
dependencies |
string[] |
List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]). |
bind |
IGraphPluginBindCallback |
Binds the plugin to the CdkGraph instance. |
inspect |
IGraphVisitorCallback |
Node visitor callback for construct tree traversal. |
report |
IGraphReportCallback |
Generate asynchronous reports based on the graph. |
synthesize |
IGraphSynthesizeCallback |
Called during CDK synthesize to generate synchronous artifacts based on the in-memory graph passed to the plugin. |
id
Required
public readonly id: string;
- Type: string
Unique identifier for this plugin.
version
Required
public readonly version: string;
- Type: string
Plugin version.
dependencies
Optional
public readonly dependencies: string[];
- Type: string[]
List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).
bind
Required
public readonly bind: IGraphPluginBindCallback;
- Type: IGraphPluginBindCallback
Binds the plugin to the CdkGraph instance.
Enables plugins to receive base configs.
inspect
Optional
public readonly inspect: IGraphVisitorCallback;
- Type: IGraphVisitorCallback
Node visitor callback for construct tree traversal.
This follows IAspect.visit pattern, but the order of visitor traversal in managed by the CdkGraph.
report
Optional
public readonly report: IGraphReportCallback;
- Type: IGraphReportCallback
Generate asynchronous reports based on the graph.
This is not automatically called when synthesizing CDK.
Developer must explicitly add await graphInstance.report()
to the CDK bin or invoke this outside
of the CDK synth. In either case, the plugin receives the in-memory graph interface when invoked, as the
CdkGraph will deserialize the graph prior to invoking the plugin report.
synthesize
Optional
public readonly synthesize: IGraphSynthesizeCallback;
- Type: IGraphSynthesizeCallback
Called during CDK synthesize to generate synchronous artifacts based on the in-memory graph passed to the plugin.
This is called in fifo order of plugins.
ICfnResourceNodeProps
-
Extends: ITypedNodeProps
-
Implemented By: ICfnResourceNodeProps
CfnResourceNode props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
importArnToken |
string |
No description. |
nodeType |
NodeTypeEnum |
No description. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
importArnToken
Optional
public readonly importArnToken: string;
- Type: string
nodeType
Optional
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
IEdgePredicate
- Implemented By: IEdgePredicate
Predicate to match edge.
Methods
Name | Description |
---|---|
filter |
No description. |
filter
public filter(edge: Edge): boolean
edge
Required
- Type: Edge
IEdgeProps
-
Extends: ITypedEdgeProps
-
Implemented By: IEdgeProps
Edge props interface.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
direction |
EdgeDirectionEnum |
Indicates the direction in which the edge is directed. |
edgeType |
EdgeTypeEnum |
Type of edge. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
direction
Required
public readonly direction: EdgeDirectionEnum;
- Type: EdgeDirectionEnum
Indicates the direction in which the edge is directed.
edgeType
Required
public readonly edgeType: EdgeTypeEnum;
- Type: EdgeTypeEnum
Type of edge.
IFilterFocusCallback
- Implemented By: IFilterFocusCallback
Determines focus node of filter plan.
Methods
Name | Description |
---|---|
filter |
No description. |
filter
public filter(store: Store): Node
store
Required
- Type: Store
IFindEdgeOptions
- Implemented By: IFindEdgeOptions
Options for edge based search operations.
Properties
Name | Type | Description |
---|---|---|
order |
constructs.ConstructOrder |
The order of traversal during search path. |
predicate |
IEdgePredicate |
The predicate to match edges(s). |
reverse |
boolean |
Indicates reverse order. |
order
Optional
public readonly order: ConstructOrder;
- Type: constructs.ConstructOrder
The order of traversal during search path.
predicate
Optional
public readonly predicate: IEdgePredicate;
- Type: IEdgePredicate
The predicate to match edges(s).
reverse
Optional
public readonly reverse: boolean;
- Type: boolean
Indicates reverse order.
IFindNodeOptions
- Implemented By: IFindNodeOptions
Options for node based search operations.
Properties
Name | Type | Description |
---|---|---|
order |
constructs.ConstructOrder |
The order of traversal during search path. |
predicate |
INodePredicate |
The predicate to match node(s). |
order
Optional
public readonly order: ConstructOrder;
- Type: constructs.ConstructOrder
The order of traversal during search path.
predicate
Optional
public readonly predicate: INodePredicate;
- Type: INodePredicate
The predicate to match node(s).
IGraphPluginBindCallback
- Implemented By: IGraphPluginBindCallback
Callback signature for graph Plugin.bind
operation.
IGraphReportCallback
- Implemented By: IGraphReportCallback
Callback signature for graph Plugin.report
operation.
IGraphStoreFilter
- Implemented By: IGraphStoreFilter
Store filter callback interface used to perform filtering operations directly against the store, as opposed to using {@link IGraphFilter} definitions.
Methods
Name | Description |
---|---|
filter |
No description. |
filter
public filter(store: Store): void
store
Required
- Type: Store
IGraphSynthesizeCallback
- Implemented By: IGraphSynthesizeCallback
Callback signature for graph Plugin.synthesize
operation.
IGraphVisitorCallback
- Implemented By: IGraphVisitorCallback
Callback signature for graph Plugin.inspect
operation.
INestedStackNodeProps
-
Extends: IStackNodeProps
-
Implemented By: INestedStackNodeProps
{@link NestedStackNode} props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
nodeType |
NodeTypeEnum |
Type of node. |
parentStack |
StackNode |
Parent stack. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
nodeType
Optional
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
parentStack
Required
public readonly parentStack: StackNode;
- Type: StackNode
Parent stack.
INodePredicate
- Implemented By: INodePredicate
Predicate to match node.
Methods
Name | Description |
---|---|
filter |
No description. |
filter
public filter(node: Node): boolean
node
Required
- Type: Node
INodeProps
-
Extends: ITypedNodeProps
-
Implemented By: INodeProps
Node props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
nodeType |
NodeTypeEnum |
Type of node. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
nodeType
Required
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
IOutputNodeProps
-
Extends: ITypedNodeProps
-
Implemented By: IOutputNodeProps
OutputNode props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
value |
any |
Resolved output value. |
description |
string |
Description. |
exportName |
string |
Export name. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
value
Required
public readonly value: any;
- Type: any
Resolved output value.
description
Optional
public readonly description: string;
- Type: string
Description.
exportName
Optional
public readonly exportName: string;
- Type: string
Export name.
IParameterNodeProps
-
Extends: ITypedNodeProps
-
Implemented By: IParameterNodeProps
{@link ParameterNode} props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
parameterType |
string |
Parameter type. |
value |
any |
Resolved value. |
description |
string |
Description. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
parameterType
Required
public readonly parameterType: string;
- Type: string
Parameter type.
value
Required
public readonly value: any;
- Type: any
Resolved value.
description
Optional
public readonly description: string;
- Type: string
Description.
IReferenceProps
-
Extends: ITypedEdgeProps
-
Implemented By: IReferenceProps
Reference edge props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
referenceType |
ReferenceTypeEnum |
Type of reference. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
referenceType
Optional
public readonly referenceType: ReferenceTypeEnum;
- Type: ReferenceTypeEnum
Type of reference.
IResourceNodeProps
-
Extends: ITypedNodeProps
-
Implemented By: IResourceNodeProps
ResourceNode props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
cdkOwned |
boolean |
Indicates if this resource is owned by cdk (defined in cdk library). |
nodeType |
NodeTypeEnum |
Type of node. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
cdkOwned
Required
public readonly cdkOwned: boolean;
- Type: boolean
Indicates if this resource is owned by cdk (defined in cdk library).
nodeType
Optional
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
ISerializableEdge
- Implemented By: AttributeReference, Dependency, Edge, ImportReference, Reference, ISerializableEdge
Interface for serializable graph edge entity.
ISerializableEntity
- Implemented By: AppNode, AttributeReference, BaseEntity, CfnResourceNode, Dependency, Edge, ImportReference, NestedStackNode, Node, OutputNode, ParameterNode, Reference, ResourceNode, RootNode, StackNode, StageNode, ISerializableEntity
Interface for serializable graph entities.
ISerializableGraphStore
- Implemented By: Store, ISerializableGraphStore
Interface for serializable graph store.
Methods
Name | Description |
---|---|
serialize |
No description. |
serialize
public serialize(): SGGraphStore
ISerializableNode
- Implemented By: AppNode, CfnResourceNode, NestedStackNode, Node, OutputNode, ParameterNode, ResourceNode, RootNode, StackNode, StageNode, ISerializableNode
Interface for serializable graph node entity.
IStackNodeProps
-
Extends: ITypedNodeProps
-
Implemented By: INestedStackNodeProps, IStackNodeProps
{@link StackNode} props.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
nodeType |
NodeTypeEnum |
Type of node. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
nodeType
Optional
public readonly nodeType: NodeTypeEnum;
- Type: NodeTypeEnum
Type of node.
IStoreCounts
- Implemented By: IStoreCounts
Interface for store counts.
Properties
Name | Type | Description |
---|---|---|
cfnResources |
{[ key: string ]: number} |
Returns {@link ICounterRecord} containing total number of each cfnResourceType. |
edges |
number |
Counts total number of edges in the store. |
edgeTypes |
{[ key: string ]: number} |
Returns {@link ICounterRecord} containing total number of each edge type ({@link EdgeTypeEnum}). |
nodes |
number |
Counts total number of nodes in the store. |
nodeTypes |
{[ key: string ]: number} |
Returns {@link ICounterRecord} containing total number of each node type ({@link NodeTypeEnum}). |
stacks |
number |
Counts total number of stacks in the store. |
stages |
number |
Counts total number of stages in the store. |
cfnResources
Required
public readonly cfnResources: {[ key: string ]: number};
- Type: {[ key: string ]: number}
Returns {@link ICounterRecord} containing total number of each cfnResourceType.
edges
Required
public readonly edges: number;
- Type: number
Counts total number of edges in the store.
edgeTypes
Required
public readonly edgeTypes: {[ key: string ]: number};
- Type: {[ key: string ]: number}
Returns {@link ICounterRecord} containing total number of each edge type ({@link EdgeTypeEnum}).
nodes
Required
public readonly nodes: number;
- Type: number
Counts total number of nodes in the store.
nodeTypes
Required
public readonly nodeTypes: {[ key: string ]: number};
- Type: {[ key: string ]: number}
Returns {@link ICounterRecord} containing total number of each node type ({@link NodeTypeEnum}).
stacks
Required
public readonly stacks: number;
- Type: number
Counts total number of stacks in the store.
stages
Required
public readonly stages: number;
- Type: number
Counts total number of stages in the store.
ITypedEdgeProps
-
Extends: IBaseEntityProps
-
Implemented By: IAttributeReferenceProps, IEdgeProps, IReferenceProps, ITypedEdgeProps
Base edge props agnostic to edge type.
Used for extending per edge class with type specifics.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
source |
Node |
Edge source is the node that defines the edge (tail). |
target |
Node |
Edge target is the node being referenced by the source (head). |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
source
Required
public readonly source: Node;
- Type: Node
Edge source is the node that defines the edge (tail).
target
Required
public readonly target: Node;
- Type: Node
Edge target is the node being referenced by the source (head).
ITypedNodeProps
-
Extends: IBaseEntityProps
-
Implemented By: ICfnResourceNodeProps, INestedStackNodeProps, INodeProps, IOutputNodeProps, IParameterNodeProps, IResourceNodeProps, IStackNodeProps, ITypedNodeProps
Base node props agnostic to node type.
Used for extending per node class with type specifics.
Properties
Name | Type | Description |
---|---|---|
attributes |
{[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]} |
Attributes. |
flags |
FlagEnum[] |
Flags. |
metadata |
constructs.MetadataEntry[] |
Metadata entries. |
tags |
{[ key: string ]: string} |
Tags. |
store |
Store |
Store. |
uuid |
string |
UUID. |
id |
string |
Node id, which is unique within parent scope. |
path |
string |
Path of the node. |
cfnType |
string |
Type of CloudFormation resource. |
constructInfo |
ConstructInfo |
Synthesized construct information defining jii resolution data. |
logicalId |
string |
Logical id of the node, which is only unique within containing stack. |
parent |
Node |
Parent node. |
stack |
StackNode |
Stack the node is contained. |
attributes
Optional
public readonly attributes: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]};
- Type: {[ key: string ]: string | number | boolean | PlainObject | string | number | boolean | PlainObject[]}
Attributes.
flags
Optional
public readonly flags: FlagEnum[];
- Type: FlagEnum[]
Flags.
metadata
Optional
public readonly metadata: MetadataEntry[];
- Type: constructs.MetadataEntry[]
Metadata entries.
tags
Optional
public readonly tags: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Tags.
store
Required
public readonly store: Store;
- Type: Store
Store.
uuid
Required
public readonly uuid: string;
- Type: string
UUID.
id
Required
public readonly id: string;
- Type: string
Node id, which is unique within parent scope.
path
Required
public readonly path: string;
- Type: string
Path of the node.
cfnType
Optional
public readonly cfnType: string;
- Type: string
Type of CloudFormation resource.
constructInfo
Optional
public readonly constructInfo: ConstructInfo;
- Type: ConstructInfo
Synthesized construct information defining jii resolution data.
logicalId
Optional
public readonly logicalId: string;
- Type: string
Logical id of the node, which is only unique within containing stack.
parent
Optional
public readonly parent: Node;
- Type: Node
Parent node.
stack
Optional
public readonly stack: StackNode;
- Type: StackNode
Stack the node is contained.
Enums
CdkConstructIds
Common cdk construct ids.
Members
Name | Description |
---|---|
DEFAULT |
No description. |
RESOURCE |
No description. |
EXPORTS |
No description. |
DEFAULT
RESOURCE
EXPORTS
CdkGraphArtifacts
CdkGraph core artifacts.
Members
Name | Description |
---|---|
GRAPH_METADATA |
No description. |
GRAPH |
No description. |
GRAPH_METADATA
GRAPH
CfnAttributesEnum
Common cfn attribute keys.
Members
Name | Description |
---|---|
TYPE |
No description. |
PROPS |
No description. |
TYPE
PROPS
ConstructInfoFqnEnum
Commonly used cdk construct info fqn (jsii fully-qualified ids).
Members
Name | Description |
---|---|
APP |
No description. |
PDKAPP_MONO |
No description. |
PDKAPP |
No description. |
STAGE |
No description. |
STACK |
No description. |
NESTED_STACK |
No description. |
CFN_STACK |
No description. |
CFN_OUTPUT |
No description. |
CFN_PARAMETER |
No description. |
CUSTOM_RESOURCE |
No description. |
AWS_CUSTOM_RESOURCE |
No description. |
CUSTOM_RESOURCE_PROVIDER |
No description. |
CUSTOM_RESOURCE_PROVIDER_2 |
No description. |
LAMBDA |
No description. |
CFN_LAMBDA |
No description. |
LAMBDA_LAYER_VERSION |
No description. |
CFN_LAMBDA_LAYER_VERSION |
No description. |
LAMBDA_ALIAS |
No description. |
CFN_LAMBDA_ALIAS |
No description. |
LAMBDA_BASE |
No description. |
LAMBDA_SINGLETON |
No description. |
LAMBDA_LAYER_AWSCLI |
No description. |
CFN_LAMBDA_PERMISSIONS |
No description. |
ASSET_STAGING |
No description. |
S3_ASSET |
No description. |
ECR_TARBALL_ASSET |
No description. |
EC2_INSTANCE |
No description. |
CFN_EC2_INSTANCE |
No description. |
SECURITY_GROUP |
No description. |
CFN_SECURITY_GROUP |
No description. |
VPC |
No description. |
CFN_VPC |
No description. |
PRIVATE_SUBNET |
No description. |
CFN_PRIVATE_SUBNET |
No description. |
PUBLIC_SUBNET |
No description. |
CFN_PUBLIC_SUBNET |
No description. |
IAM_ROLE |
No description. |
APP
PDKAPP_MONO
PDKAPP
STAGE
STACK
NESTED_STACK
CFN_STACK
CFN_OUTPUT
CFN_PARAMETER
CUSTOM_RESOURCE
AWS_CUSTOM_RESOURCE
CUSTOM_RESOURCE_PROVIDER
CUSTOM_RESOURCE_PROVIDER_2
LAMBDA
CFN_LAMBDA
LAMBDA_LAYER_VERSION
CFN_LAMBDA_LAYER_VERSION
LAMBDA_ALIAS
CFN_LAMBDA_ALIAS
LAMBDA_BASE
LAMBDA_SINGLETON
LAMBDA_LAYER_AWSCLI
CFN_LAMBDA_PERMISSIONS
ASSET_STAGING
S3_ASSET
ECR_TARBALL_ASSET
EC2_INSTANCE
CFN_EC2_INSTANCE
SECURITY_GROUP
CFN_SECURITY_GROUP
VPC
CFN_VPC
PRIVATE_SUBNET
CFN_PRIVATE_SUBNET
PUBLIC_SUBNET
CFN_PUBLIC_SUBNET
IAM_ROLE
EdgeDirectionEnum
EdgeDirection specifies in which direction the edge is directed or if it is undirected.
Members
Name | Description |
---|---|
NONE |
Indicates that edge is undirected; |
FORWARD |
Indicates the edge is directed from the source to the target. |
BACK |
Indicates the edge is directed from the target to the source. |
BOTH |
Indicates the edge is bi-directional. |
NONE
Indicates that edge is undirected;
meaning there is no directional relationship between the source and target.
FORWARD
Indicates the edge is directed from the source to the target.
BACK
Indicates the edge is directed from the target to the source.
BOTH
Indicates the edge is bi-directional.
EdgeTypeEnum
Edge types handles by the graph.
Members
Name | Description |
---|---|
CUSTOM |
Custom edge. |
REFERENCE |
Reference edge (Ref, Fn::GetAtt, Fn::ImportValue). |
DEPENDENCY |
CloudFormation dependency edge. |
CUSTOM
Custom edge.
REFERENCE
Reference edge (Ref, Fn::GetAtt, Fn::ImportValue).
DEPENDENCY
CloudFormation dependency edge.
FilterPreset
Filter presets.
Members
Name | Description |
---|---|
COMPACT |
Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges. |
NON_EXTRANEOUS |
Collapses extraneous nodes to parent and prunes extraneous edges. |
NONE |
No filtering is performed which will output verbose graph. |
COMPACT
Collapses extraneous nodes to parent and cdk created nodes on themselves, and prunes extraneous edges.
This most closely represents the developers code for the current application and reduces the noise one expects.
NON_EXTRANEOUS
Collapses extraneous nodes to parent and prunes extraneous edges.
NONE
No filtering is performed which will output verbose graph.
FilterStrategy
Filter strategy to apply to filter matches.
Members
Name | Description |
---|---|
PRUNE |
Remove filtered entity and all its edges. |
COLLAPSE |
Collapse all child entities of filtered entity into filtered entity; |
COLLAPSE_TO_PARENT |
Collapse all filtered entities into their parent entity; |
PRUNE
Remove filtered entity and all its edges.
COLLAPSE
Collapse all child entities of filtered entity into filtered entity;
and hoist all edges.
COLLAPSE_TO_PARENT
Collapse all filtered entities into their parent entity;
and hoist its edges to parent.
FlagEnum
Graph flags.
Members
Name | Description |
---|---|
CLUSTER |
Indicates that node is a cluster (container) and treated like an emphasized subgraph. |
GRAPH_CONTAINER |
Indicates that node is non-resource container (Root, App) and used for structural purpose in the graph only. |
EXTRANEOUS |
Indicates that the entity is extraneous and considered collapsible to parent without impact of intent. |
ASSET |
Indicates node is considered a CDK Asset (Lambda Code, Docker Image, etc). |
CDK_OWNED |
Indicates that node was created by CDK. |
CFN_FQN |
Indicates node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn* construct. |
CLOSED_EDGE |
Indicates that edge is closed; |
MUTATED |
Indicates that entity was mutated; |
IMPORT |
Indicates that resource is imported into CDK (eg: lambda.Function.fromFunctionName() , s3.Bucket.fromBucketArn() ). |
CUSTOM_RESOURCE |
Indicates if node is a CustomResource. |
AWS_CUSTOM_RESOURCE |
Indicates if node is an AwsCustomResource, which is a custom resource that simply calls the AWS SDK API via singleton provider. |
AWS_API_CALL_LAMBDA |
Indicates if lambda function resource is a singleton AWS API call lambda for AwsCustomResources. |
CLUSTER
Indicates that node is a cluster (container) and treated like an emphasized subgraph.
GRAPH_CONTAINER
Indicates that node is non-resource container (Root, App) and used for structural purpose in the graph only.
EXTRANEOUS
Indicates that the entity is extraneous and considered collapsible to parent without impact of intent.
ASSET
Indicates node is considered a CDK Asset (Lambda Code, Docker Image, etc).
CDK_OWNED
Indicates that node was created by CDK.
CFN_FQN
Indicates node ConstructInfoFqn denotes a aws-cdk-lib.*.Cfn*
construct.
CLOSED_EDGE
Indicates that edge is closed;
meaning source === target
. This flag only gets applied on creation of edge, not during mutations to maintain initial intent.
MUTATED
Indicates that entity was mutated;
meaning a mutation was performed to change originally computed graph value.
IMPORT
Indicates that resource is imported into CDK (eg: lambda.Function.fromFunctionName()
, s3.Bucket.fromBucketArn()
).
CUSTOM_RESOURCE
Indicates if node is a CustomResource.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html
AWS_CUSTOM_RESOURCE
Indicates if node is an AwsCustomResource, which is a custom resource that simply calls the AWS SDK API via singleton provider.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.AwsCustomResource.html
AWS_API_CALL_LAMBDA
Indicates if lambda function resource is a singleton AWS API call lambda for AwsCustomResources.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.AwsCustomResource.html
MetadataTypeEnum
Common cdk metadata types.
Members
Name | Description |
---|---|
LOGICAL_ID |
No description. |
LOGICAL_ID
NodeTypeEnum
Node types handled by the graph.
Members
Name | Description |
---|---|
DEFAULT |
Default node type - used for all nodes that don't have explicit type defined. |
CFN_RESOURCE |
L1 cfn resource node. |
RESOURCE |
L2 cdk resource node. |
CUSTOM_RESOURCE |
Cdk customer resource node. |
ROOT |
Graph root node. |
APP |
Cdk App node. |
STAGE |
Cdk Stage node. |
STACK |
Cdk Stack node. |
NESTED_STACK |
Cdk NestedStack node. |
OUTPUT |
CfnOutput node. |
PARAMETER |
CfnParameter node. |
ASSET |
Cdk asset node. |
DEFAULT
Default node type - used for all nodes that don't have explicit type defined.
CFN_RESOURCE
L1 cfn resource node.
RESOURCE
L2 cdk resource node.
CUSTOM_RESOURCE
Cdk customer resource node.
ROOT
Graph root node.
APP
Cdk App node.
STAGE
Cdk Stage node.
STACK
Cdk Stack node.
NESTED_STACK
Cdk NestedStack node.
OUTPUT
CfnOutput node.
PARAMETER
CfnParameter node.
ASSET
Cdk asset node.
ReferenceTypeEnum
Reference edge types.
Members
Name | Description |
---|---|
REF |
CloudFormation Ref reference. |
ATTRIBUTE |
CloudFormation Fn::GetAtt reference. |
IMPORT |
CloudFormation Fn::ImportValue reference. |
IMPORT_ARN |
CloudFormation Fn::Join reference of imported resourced (eg: s3.Bucket.fromBucketArn() ). |
REF
CloudFormation Ref reference.
ATTRIBUTE
CloudFormation Fn::GetAtt reference.
IMPORT
CloudFormation Fn::ImportValue reference.
IMPORT_ARN
CloudFormation Fn::Join reference of imported resourced (eg: s3.Bucket.fromBucketArn()
).