API Reference
Structs
DiagramOptions
Options for diagrams.
Initializer
import { DiagramOptions } from '@aws/pdk/cdk-graph-plugin-diagram'
const diagramOptions: DiagramOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
title |
string |
No description. |
nodePositions |
{[ key: string ]: INodePosition} |
No description. |
preset |
aws/pdk/cdk-graph.FilterPreset |
No description. |
theme |
IGraphThemeConfigAlt | string |
No description. |
title
Required
public readonly title: string;
- Type: string
nodePositions
Optional
public readonly nodePositions: {[ key: string ]: INodePosition};
- Type: {[ key: string ]: INodePosition}
preset
Optional
public readonly preset: FilterPreset;
- Type: aws/pdk/cdk-graph.FilterPreset
theme
Optional
public readonly theme: IGraphThemeConfigAlt | string;
- Type: IGraphThemeConfigAlt | string
IDiagramConfig
Diagram configuration definition.
Initializer
import { IDiagramConfig } from '@aws/pdk/cdk-graph-plugin-diagram'
const iDiagramConfig: IDiagramConfig = { ... }
Properties
Name | Type | Description |
---|---|---|
filterPlan |
aws/pdk/cdk-graph.IGraphFilterPlan |
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram. |
format |
DiagramFormat | DiagramFormat[] |
The output format(s) to generated. |
nodePositions |
{[ key: string ]: INodePosition} |
Config for predetermined node positions given their CDK construct id. |
theme |
IGraphThemeConfigAlt | string |
Config for graph theme. |
name |
string |
Name of the diagram. |
title |
string |
The title of the diagram. |
ignoreDefaults |
boolean |
Indicates if default diagram config is applied as defaults to this config. |
filterPlan
Optional
public readonly filterPlan: IGraphFilterPlan;
- Type: aws/pdk/cdk-graph.IGraphFilterPlan
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format
Optional
public readonly format: DiagramFormat | DiagramFormat[];
- Type: DiagramFormat | DiagramFormat[]
- Default:
DiagramFormat.PNG
- which will through extension also generateDiagramFormat.SVG
andDiagramFormat.DOT
The output format(s) to generated.
nodePositions
Optional
public readonly nodePositions: {[ key: string ]: INodePosition};
- Type: {[ key: string ]: INodePosition}
Config for predetermined node positions given their CDK construct id.
theme
Optional
public readonly theme: IGraphThemeConfigAlt | string;
- Type: IGraphThemeConfigAlt | string
Config for graph theme.
name
Required
public readonly name: string;
- Type: string
Name of the diagram.
Used as the basename of the generated file(s) which gets the extension appended.
title
Required
public readonly title: string;
- Type: string
The title of the diagram.
ignoreDefaults
Optional
public readonly ignoreDefaults: boolean;
- Type: boolean
- Default: false
Indicates if default diagram config is applied as defaults to this config.
IDiagramConfigBase
Base config to specific a unique diagram to be generated.
Initializer
import { IDiagramConfigBase } from '@aws/pdk/cdk-graph-plugin-diagram'
const iDiagramConfigBase: IDiagramConfigBase = { ... }
Properties
Name | Type | Description |
---|---|---|
filterPlan |
aws/pdk/cdk-graph.IGraphFilterPlan |
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram. |
format |
DiagramFormat | DiagramFormat[] |
The output format(s) to generated. |
nodePositions |
{[ key: string ]: INodePosition} |
Config for predetermined node positions given their CDK construct id. |
theme |
IGraphThemeConfigAlt | string |
Config for graph theme. |
filterPlan
Optional
public readonly filterPlan: IGraphFilterPlan;
- Type: aws/pdk/cdk-graph.IGraphFilterPlan
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format
Optional
public readonly format: DiagramFormat | DiagramFormat[];
- Type: DiagramFormat | DiagramFormat[]
- Default:
DiagramFormat.PNG
- which will through extension also generateDiagramFormat.SVG
andDiagramFormat.DOT
The output format(s) to generated.
nodePositions
Optional
public readonly nodePositions: {[ key: string ]: INodePosition};
- Type: {[ key: string ]: INodePosition}
Config for predetermined node positions given their CDK construct id.
theme
Optional
public readonly theme: IGraphThemeConfigAlt | string;
- Type: IGraphThemeConfigAlt | string
Config for graph theme.
IPluginConfig
Plugin configuration for diagram plugin.
Initializer
import { IPluginConfig } from '@aws/pdk/cdk-graph-plugin-diagram'
const iPluginConfig: IPluginConfig = { ... }
Properties
Name | Type | Description |
---|---|---|
defaults |
IDiagramConfigBase |
Default configuration to apply to all diagrams. |
diagrams |
IDiagramConfig[] |
List of diagram configurations to generate diagrams. |
defaults
Optional
public readonly defaults: IDiagramConfigBase;
- Type: IDiagramConfigBase
Default configuration to apply to all diagrams.
diagrams
Optional
public readonly diagrams: IDiagramConfig[];
- Type: IDiagramConfig[]
List of diagram configurations to generate diagrams.
Classes
CdkGraphDiagramPlugin
- Implements: aws/pdk/cdk-graph.ICdkGraphPlugin
CdkGraphDiagramPlugin is a {@link ICdkGraphPluginCdkGraph Plugin} implementation for generating diagram artifacts from the {@link CdkGraph} framework.
Initializers
import { CdkGraphDiagramPlugin } from '@aws/pdk/cdk-graph-plugin-diagram'
new CdkGraphDiagramPlugin(config?: IPluginConfig)
Name | Type | Description |
---|---|---|
config |
IPluginConfig |
No description. |
config
Optional
- Type: IPluginConfig
Methods
Name | Description |
---|---|
getDiagramArtifact |
Get diagram artifact for a given name and format. |
getDiagramArtifact
public getDiagramArtifact(name: string, format: DiagramFormat): CdkGraphArtifact
Get diagram artifact for a given name and format.
name
Required
- Type: string
format
Required
- Type: DiagramFormat
Static Functions
Name | Description |
---|---|
artifactFilename |
Get standardized artifact file name for diagram artifacts. |
artifactId |
Get standardized artifact id for diagram artifacts. |
artifactFilename
import { CdkGraphDiagramPlugin } from '@aws/pdk/cdk-graph-plugin-diagram'
CdkGraphDiagramPlugin.artifactFilename(name: string, format: DiagramFormat)
Get standardized artifact file name for diagram artifacts.
name
Required
- Type: string
format
Required
- Type: DiagramFormat
artifactId
import { CdkGraphDiagramPlugin } from '@aws/pdk/cdk-graph-plugin-diagram'
CdkGraphDiagramPlugin.artifactId(name: string, format: DiagramFormat)
Get standardized artifact id for diagram artifacts.
name
Required
- Type: string
format
Required
- Type: DiagramFormat
Properties
Name | Type | Description |
---|---|---|
config |
IPluginConfig |
Get diagram plugin config. |
id |
string |
Unique identifier for this plugin. |
version |
string |
Plugin version. |
defaultDotArtifact |
aws/pdk/cdk-graph.CdkGraphArtifact |
Get default dot artifact. |
defaultPngArtifact |
aws/pdk/cdk-graph.CdkGraphArtifact |
Get default PNG artifact. |
dependencies |
string[] |
List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]). |
bind |
aws/pdk/cdk-graph.IGraphPluginBindCallback |
Binds the plugin to the CdkGraph instance. |
report |
aws/pdk/cdk-graph.IGraphReportCallback |
Generate asynchronous reports based on the graph. |
config
Required
public readonly config: IPluginConfig;
- Type: IPluginConfig
Get diagram plugin config.
id
Required
public readonly id: string;
- Type: string
Unique identifier for this plugin.
version
Required
public readonly version: string;
- Type: string
Plugin version.
defaultDotArtifact
Optional
public readonly defaultDotArtifact: CdkGraphArtifact;
- Type: aws/pdk/cdk-graph.CdkGraphArtifact
Get default dot artifact.
defaultPngArtifact
Optional
public readonly defaultPngArtifact: CdkGraphArtifact;
- Type: aws/pdk/cdk-graph.CdkGraphArtifact
Get default PNG artifact.
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: aws/pdk/cdk-graph.IGraphPluginBindCallback
Binds the plugin to the CdkGraph instance.
Enables plugins to receive base configs.
report
Optional
public readonly report: IGraphReportCallback;
- Type: aws/pdk/cdk-graph.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.
Constants
Name | Type | Description |
---|---|---|
ARTIFACT_NS |
string |
Namespace for artifacts of the diagram plugin. |
ID |
string |
Fixed id of the diagram plugin. |
VERSION |
string |
Current semantic version of the diagram plugin. |
ARTIFACT_NS
Required
public readonly ARTIFACT_NS: string;
- Type: string
Namespace for artifacts of the diagram plugin.
ID
Required
public readonly ID: string;
- Type: string
Fixed id of the diagram plugin.
VERSION
Required
public readonly VERSION: string;
- Type: string
Current semantic version of the diagram plugin.
Protocols
IGraphThemeConfigAlt
- Implemented By: IGraphThemeConfigAlt
GraphThemeConfigAlt is simplified definition of theme to apply.
Properties
Name | Type | Description |
---|---|---|
rendering |
IGraphThemeRendering |
No description. |
theme |
string |
No description. |
rendering
Optional
public readonly rendering: IGraphThemeRendering;
- Type: IGraphThemeRendering
theme
Optional
public readonly theme: string;
- Type: string
IGraphThemeRendering
-
Extends: IGraphThemeRenderingIconProps, IGraphThemeRenderingOptions
-
Implemented By: IGraphThemeRendering
Properties for defining the rendering options for the graph theme.
Properties
Name | Type | Description |
---|---|---|
cfnResourceIconMax |
GraphThemeRenderingIconTarget |
Highest Graph.CfnResourceNode icon to render. |
cfnResourceIconMin |
GraphThemeRenderingIconTarget |
Lowest Graph.CfnResourceNode icon to render. |
resourceIconMax |
GraphThemeRenderingIconTarget |
Highest Graph.ResourceNode icon to render. |
resourceIconMin |
GraphThemeRenderingIconTarget |
Lowest Graph.ResourceNode icon to render. |
layout |
string |
Layout direction of the graph. |
stack |
string |
Specify regex pattern to match root stacks to render. |
stage |
string |
Specify which stage to render when multiple stages are available. |
unconstrainedCrossClusterEdges |
boolean |
Prevent cross-cluster edges from ranking nodes in layout. |
cfnResourceIconMax
Optional
public readonly cfnResourceIconMax: GraphThemeRenderingIconTarget;
Highest Graph.CfnResourceNode icon to render.
cfnResourceIconMin
Optional
public readonly cfnResourceIconMin: GraphThemeRenderingIconTarget;
Lowest Graph.CfnResourceNode icon to render.
resourceIconMax
Optional
public readonly resourceIconMax: GraphThemeRenderingIconTarget;
Highest Graph.ResourceNode icon to render.
resourceIconMin
Optional
public readonly resourceIconMin: GraphThemeRenderingIconTarget;
Lowest Graph.ResourceNode icon to render.
layout
Optional
public readonly layout: string;
- Type: string
- Default: horizontal
Layout direction of the graph.
stack
Optional
public readonly stack: string;
- Type: string
- Default: undefined Will render all stacks
Specify regex pattern to match root stacks to render.
stage
Optional
public readonly stage: string;
- Type: string
- Default: last
Specify which stage to render when multiple stages are available.
Can be a preset value of "first", "last", and "all", or regex string of the stage(s) to render.
unconstrainedCrossClusterEdges
Optional
public readonly unconstrainedCrossClusterEdges: boolean;
- Type: boolean
- Default: false
Prevent cross-cluster edges from ranking nodes in layout.
IGraphThemeRenderingIconProps
- Implemented By: IGraphThemeRendering, IGraphThemeRenderingIconProps
Icon specific properties for configuring graph rendering of resource icons.
Properties
Name | Type | Description |
---|---|---|
cfnResourceIconMax |
GraphThemeRenderingIconTarget |
Highest Graph.CfnResourceNode icon to render. |
cfnResourceIconMin |
GraphThemeRenderingIconTarget |
Lowest Graph.CfnResourceNode icon to render. |
resourceIconMax |
GraphThemeRenderingIconTarget |
Highest Graph.ResourceNode icon to render. |
resourceIconMin |
GraphThemeRenderingIconTarget |
Lowest Graph.ResourceNode icon to render. |
cfnResourceIconMax
Optional
public readonly cfnResourceIconMax: GraphThemeRenderingIconTarget;
Highest Graph.CfnResourceNode icon to render.
cfnResourceIconMin
Optional
public readonly cfnResourceIconMin: GraphThemeRenderingIconTarget;
Lowest Graph.CfnResourceNode icon to render.
resourceIconMax
Optional
public readonly resourceIconMax: GraphThemeRenderingIconTarget;
Highest Graph.ResourceNode icon to render.
resourceIconMin
Optional
public readonly resourceIconMin: GraphThemeRenderingIconTarget;
Lowest Graph.ResourceNode icon to render.
IGraphThemeRenderingOptions
- Implemented By: IGraphThemeRendering, IGraphThemeRenderingOptions
Additional graph rendering options.
Properties
Name | Type | Description |
---|---|---|
layout |
string |
Layout direction of the graph. |
stack |
string |
Specify regex pattern to match root stacks to render. |
stage |
string |
Specify which stage to render when multiple stages are available. |
unconstrainedCrossClusterEdges |
boolean |
Prevent cross-cluster edges from ranking nodes in layout. |
layout
Optional
public readonly layout: string;
- Type: string
- Default: horizontal
Layout direction of the graph.
stack
Optional
public readonly stack: string;
- Type: string
- Default: undefined Will render all stacks
Specify regex pattern to match root stacks to render.
stage
Optional
public readonly stage: string;
- Type: string
- Default: last
Specify which stage to render when multiple stages are available.
Can be a preset value of "first", "last", and "all", or regex string of the stage(s) to render.
unconstrainedCrossClusterEdges
Optional
public readonly unconstrainedCrossClusterEdges: boolean;
- Type: boolean
- Default: false
Prevent cross-cluster edges from ranking nodes in layout.
INodePosition
- Implemented By: INodePosition
Positional coordinates for a node in inches.
Properties
Name | Type | Description |
---|---|---|
x |
number |
No description. |
y |
number |
No description. |
x
Required
public readonly x: number;
- Type: number
y
Required
public readonly y: number;
- Type: number
Enums
DiagramFormat
Supported diagram formats that can be generated.
Extended formats are automatically generated, for example if you generate "png" which extends "svg" which extends "dot", the resulting generated files will be all aforementioned.
Members
Name | Description |
---|---|
DOT |
Graphviz DOT Language. |
SVG |
SVG generated using dot-wasm from {@link DiagramFormat.DOT} file. |
PNG |
PNG generated using sharp from {@link DiagramFormat.SVG} file. |
DOT
Graphviz DOT Language.
SVG
SVG generated using dot-wasm from {@link DiagramFormat.DOT} file.
PNG
PNG generated using sharp from {@link DiagramFormat.SVG} file.
GraphThemeRenderingIconTarget
Icon rendering target options for GraphTheme.
Members
Name | Description |
---|---|
DATA |
Data icon (eg: EC2 instance type icon, T2). |
RESOURCE |
Resource icon. |
GENERAL |
General icon. |
SERVICE |
Service icon. |
CATEGORY |
Category icon. |
DATA
Data icon (eg: EC2 instance type icon, T2).
Resolution precedence: data => resource => general => service => category
RESOURCE
Resource icon.
Resolution precedence: resource => general => service => category
GENERAL
General icon.
Resolution precedence: resource => general => service => category
SERVICE
Service icon.
Resolution precedence: service => category
CATEGORY
Category icon.
Resolution precedence: category