Skip to content

API Reference

Structs

DiagramOptions

Options for diagrams.

Initializer

import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.DiagramOptions(
  title: str,
  node_positions: typing.Mapping[INodePosition] = None,
  preset: FilterPreset = None,
  theme: typing.Union[IGraphThemeConfigAlt, str] = None
)

Properties

Name Type Description
title str No description.
node_positions typing.Mapping[INodePosition] No description.
preset aws.pdk.cdk_graph_plugin_diagram.FilterPreset No description.
theme typing.Union[IGraphThemeConfigAlt, str] No description.

titleRequired
title: str
  • Type: str

node_positionsOptional
node_positions: typing.Mapping[INodePosition]

presetOptional
preset: FilterPreset
  • Type: aws.pdk.cdk_graph_plugin_diagram.FilterPreset

themeOptional
theme: typing.Union[IGraphThemeConfigAlt, str]

IDiagramConfig

Diagram configuration definition.

Initializer

import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.IDiagramConfig(
  filter_plan: IGraphFilterPlan = None,
  format: typing.Union[DiagramFormat, typing.List[DiagramFormat]] = None,
  node_positions: typing.Mapping[INodePosition] = None,
  theme: typing.Union[IGraphThemeConfigAlt, str] = None,
  name: str,
  title: str,
  ignore_defaults: bool = None
)

Properties

Name Type Description
filter_plan aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format typing.Union[DiagramFormat, typing.List[DiagramFormat]] The output format(s) to generated.
node_positions typing.Mapping[INodePosition] Config for predetermined node positions given their CDK construct id.
theme typing.Union[IGraphThemeConfigAlt, str] Config for graph theme.
name str Name of the diagram.
title str The title of the diagram.
ignore_defaults bool Indicates if default diagram config is applied as defaults to this config.

filter_planOptional
filter_plan: IGraphFilterPlan
  • Type: aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan

Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.


formatOptional
format: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
  • Type: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
  • Default: DiagramFormat.PNG - which will through extension also generate DiagramFormat.SVG and DiagramFormat.DOT

The output format(s) to generated.


node_positionsOptional
node_positions: typing.Mapping[INodePosition]

Config for predetermined node positions given their CDK construct id.


themeOptional
theme: typing.Union[IGraphThemeConfigAlt, str]

Config for graph theme.


nameRequired
name: str
  • Type: str

Name of the diagram.

Used as the basename of the generated file(s) which gets the extension appended.


titleRequired
title: str
  • Type: str

The title of the diagram.


ignore_defaultsOptional
ignore_defaults: bool
  • Type: bool
  • 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 aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.IDiagramConfigBase(
  filter_plan: IGraphFilterPlan = None,
  format: typing.Union[DiagramFormat, typing.List[DiagramFormat]] = None,
  node_positions: typing.Mapping[INodePosition] = None,
  theme: typing.Union[IGraphThemeConfigAlt, str] = None
)

Properties

Name Type Description
filter_plan aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format typing.Union[DiagramFormat, typing.List[DiagramFormat]] The output format(s) to generated.
node_positions typing.Mapping[INodePosition] Config for predetermined node positions given their CDK construct id.
theme typing.Union[IGraphThemeConfigAlt, str] Config for graph theme.

filter_planOptional
filter_plan: IGraphFilterPlan
  • Type: aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan

Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.


formatOptional
format: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
  • Type: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
  • Default: DiagramFormat.PNG - which will through extension also generate DiagramFormat.SVG and DiagramFormat.DOT

The output format(s) to generated.


node_positionsOptional
node_positions: typing.Mapping[INodePosition]

Config for predetermined node positions given their CDK construct id.


themeOptional
theme: typing.Union[IGraphThemeConfigAlt, str]

Config for graph theme.


IPluginConfig

Plugin configuration for diagram plugin.

Initializer

import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.IPluginConfig(
  defaults: IDiagramConfigBase = None,
  diagrams: typing.List[IDiagramConfig] = None
)

Properties

Name Type Description
defaults IDiagramConfigBase Default configuration to apply to all diagrams.
diagrams typing.List[IDiagramConfig] List of diagram configurations to generate diagrams.

defaultsOptional
defaults: IDiagramConfigBase

Default configuration to apply to all diagrams.


diagramsOptional
diagrams: typing.List[IDiagramConfig]

List of diagram configurations to generate diagrams.


Classes

CdkGraphDiagramPlugin

  • Implements: aws.pdk.cdk_graph_plugin_diagram.ICdkGraphPlugin

CdkGraphDiagramPlugin is a {@link ICdkGraphPluginCdkGraph Plugin} implementation for generating diagram artifacts from the {@link CdkGraph} framework.

Initializers

import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin(
  defaults: IDiagramConfigBase = None,
  diagrams: typing.List[IDiagramConfig] = None
)
Name Type Description
defaults IDiagramConfigBase Default configuration to apply to all diagrams.
diagrams typing.List[IDiagramConfig] List of diagram configurations to generate diagrams.

defaultsOptional

Default configuration to apply to all diagrams.


diagramsOptional

List of diagram configurations to generate diagrams.


Methods

Name Description
get_diagram_artifact Get diagram artifact for a given name and format.

get_diagram_artifact
def get_diagram_artifact(
  name: str,
  format: DiagramFormat
) -> CdkGraphArtifact

Get diagram artifact for a given name and format.

nameRequired
  • Type: str

formatRequired

Static Functions

Name Description
artifact_filename Get standardized artifact file name for diagram artifacts.
artifact_id Get standardized artifact id for diagram artifacts.

artifact_filename
import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin.artifact_filename(
  name: str,
  format: DiagramFormat
)

Get standardized artifact file name for diagram artifacts.

nameRequired
  • Type: str

formatRequired

artifact_id
import aws.pdk.cdk_graph_plugin_diagram

aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin.artifact_id(
  name: str,
  format: DiagramFormat
)

Get standardized artifact id for diagram artifacts.

nameRequired
  • Type: str

formatRequired

Properties

Name Type Description
config IPluginConfig Get diagram plugin config.
id str Unique identifier for this plugin.
version str Plugin version.
default_dot_artifact aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact Get default dot artifact.
default_png_artifact aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact Get default PNG artifact.
dependencies typing.List[str] List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).
bind aws.pdk.cdk_graph_plugin_diagram.IGraphPluginBindCallback Binds the plugin to the CdkGraph instance.
report aws.pdk.cdk_graph_plugin_diagram.IGraphReportCallback Generate asynchronous reports based on the graph.

configRequired
config: IPluginConfig

Get diagram plugin config.


idRequired
id: str
  • Type: str

Unique identifier for this plugin.


versionRequired
version: str
  • Type: str

Plugin version.


default_dot_artifactOptional
default_dot_artifact: CdkGraphArtifact
  • Type: aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact

Get default dot artifact.


default_png_artifactOptional
default_png_artifact: CdkGraphArtifact
  • Type: aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact

Get default PNG artifact.


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

List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).


bindRequired
bind: IGraphPluginBindCallback
  • Type: aws.pdk.cdk_graph_plugin_diagram.IGraphPluginBindCallback

Binds the plugin to the CdkGraph instance.

Enables plugins to receive base configs.


reportOptional
report: IGraphReportCallback
  • Type: aws.pdk.cdk_graph_plugin_diagram.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 str Namespace for artifacts of the diagram plugin.
ID str Fixed id of the diagram plugin.
VERSION str Current semantic version of the diagram plugin.

ARTIFACT_NSRequired
ARTIFACT_NS: str
  • Type: str

Namespace for artifacts of the diagram plugin.


IDRequired
ID: str
  • Type: str

Fixed id of the diagram plugin.


VERSIONRequired
VERSION: str
  • Type: str

Current semantic version of the diagram plugin.


Protocols

IGraphThemeConfigAlt

GraphThemeConfigAlt is simplified definition of theme to apply.

Properties

Name Type Description
rendering IGraphThemeRendering No description.
theme str No description.

renderingOptional
rendering: IGraphThemeRendering

themeOptional
theme: str
  • Type: str

IGraphThemeRendering

Properties for defining the rendering options for the graph theme.

Properties

Name Type Description
cfn_resource_icon_max GraphThemeRenderingIconTarget Highest Graph.CfnResourceNode icon to render.
cfn_resource_icon_min GraphThemeRenderingIconTarget Lowest Graph.CfnResourceNode icon to render.
resource_icon_max GraphThemeRenderingIconTarget Highest Graph.ResourceNode icon to render.
resource_icon_min GraphThemeRenderingIconTarget Lowest Graph.ResourceNode icon to render.
layout str Layout direction of the graph.
stack str Specify regex pattern to match root stacks to render.
stage str Specify which stage to render when multiple stages are available.
unconstrained_cross_cluster_edges bool Prevent cross-cluster edges from ranking nodes in layout.

cfn_resource_icon_maxOptional
cfn_resource_icon_max: GraphThemeRenderingIconTarget

Highest Graph.CfnResourceNode icon to render.


cfn_resource_icon_minOptional
cfn_resource_icon_min: GraphThemeRenderingIconTarget

Lowest Graph.CfnResourceNode icon to render.


resource_icon_maxOptional
resource_icon_max: GraphThemeRenderingIconTarget

Highest Graph.ResourceNode icon to render.


resource_icon_minOptional
resource_icon_min: GraphThemeRenderingIconTarget

Lowest Graph.ResourceNode icon to render.


layoutOptional
layout: str
  • Type: str
  • Default: horizontal

Layout direction of the graph.


stackOptional
stack: str
  • Type: str
  • Default: undefined Will render all stacks

Specify regex pattern to match root stacks to render.


stageOptional
stage: str
  • Type: str
  • 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.


unconstrained_cross_cluster_edgesOptional
unconstrained_cross_cluster_edges: bool
  • Type: bool
  • Default: false

Prevent cross-cluster edges from ranking nodes in layout.

https://graphviz.org/docs/attrs/constraint/


IGraphThemeRenderingIconProps

Icon specific properties for configuring graph rendering of resource icons.

Properties

Name Type Description
cfn_resource_icon_max GraphThemeRenderingIconTarget Highest Graph.CfnResourceNode icon to render.
cfn_resource_icon_min GraphThemeRenderingIconTarget Lowest Graph.CfnResourceNode icon to render.
resource_icon_max GraphThemeRenderingIconTarget Highest Graph.ResourceNode icon to render.
resource_icon_min GraphThemeRenderingIconTarget Lowest Graph.ResourceNode icon to render.

cfn_resource_icon_maxOptional
cfn_resource_icon_max: GraphThemeRenderingIconTarget

Highest Graph.CfnResourceNode icon to render.


cfn_resource_icon_minOptional
cfn_resource_icon_min: GraphThemeRenderingIconTarget

Lowest Graph.CfnResourceNode icon to render.


resource_icon_maxOptional
resource_icon_max: GraphThemeRenderingIconTarget

Highest Graph.ResourceNode icon to render.


resource_icon_minOptional
resource_icon_min: GraphThemeRenderingIconTarget

Lowest Graph.ResourceNode icon to render.


IGraphThemeRenderingOptions

Additional graph rendering options.

Properties

Name Type Description
layout str Layout direction of the graph.
stack str Specify regex pattern to match root stacks to render.
stage str Specify which stage to render when multiple stages are available.
unconstrained_cross_cluster_edges bool Prevent cross-cluster edges from ranking nodes in layout.

layoutOptional
layout: str
  • Type: str
  • Default: horizontal

Layout direction of the graph.


stackOptional
stack: str
  • Type: str
  • Default: undefined Will render all stacks

Specify regex pattern to match root stacks to render.


stageOptional
stage: str
  • Type: str
  • 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.


unconstrained_cross_cluster_edgesOptional
unconstrained_cross_cluster_edges: bool
  • Type: bool
  • Default: false

Prevent cross-cluster edges from ranking nodes in layout.

https://graphviz.org/docs/attrs/constraint/


INodePosition

Positional coordinates for a node in inches.

Properties

Name Type Description
x typing.Union[int, float] No description.
y typing.Union[int, float] No description.

xRequired
x: typing.Union[int, float]
  • Type: typing.Union[int, float]

yRequired
y: typing.Union[int, float]
  • Type: typing.Union[int, float]

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



Last update: 2024-10-30