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. |
title
Required
title: str
- Type: str
node_positions
Optional
node_positions: typing.Mapping[INodePosition]
- Type: typing.Mapping[INodePosition]
preset
Optional
preset: FilterPreset
- Type: aws.pdk.cdk_graph_plugin_diagram.FilterPreset
theme
Optional
theme: typing.Union[IGraphThemeConfigAlt, str]
- Type: 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_plan
Optional
filter_plan: IGraphFilterPlan
- Type: aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format
Optional
format: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
- Type: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
- Default:
DiagramFormat.PNG
- which will through extension also generateDiagramFormat.SVG
andDiagramFormat.DOT
The output format(s) to generated.
node_positions
Optional
node_positions: typing.Mapping[INodePosition]
- Type: typing.Mapping[INodePosition]
Config for predetermined node positions given their CDK construct id.
theme
Optional
theme: typing.Union[IGraphThemeConfigAlt, str]
- Type: typing.Union[IGraphThemeConfigAlt, str]
Config for graph theme.
name
Required
name: str
- Type: str
Name of the diagram.
Used as the basename of the generated file(s) which gets the extension appended.
title
Required
title: str
- Type: str
The title of the diagram.
ignore_defaults
Optional
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_plan
Optional
filter_plan: IGraphFilterPlan
- Type: aws.pdk.cdk_graph_plugin_diagram.IGraphFilterPlan
Graph {@link IGraphFilterPlanFilter Plan} used to generate a unique diagram.
format
Optional
format: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
- Type: typing.Union[DiagramFormat, typing.List[DiagramFormat]]
- Default:
DiagramFormat.PNG
- which will through extension also generateDiagramFormat.SVG
andDiagramFormat.DOT
The output format(s) to generated.
node_positions
Optional
node_positions: typing.Mapping[INodePosition]
- Type: typing.Mapping[INodePosition]
Config for predetermined node positions given their CDK construct id.
theme
Optional
theme: typing.Union[IGraphThemeConfigAlt, str]
- Type: 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. |
defaults
Optional
defaults: IDiagramConfigBase
- Type: IDiagramConfigBase
Default configuration to apply to all diagrams.
diagrams
Optional
diagrams: typing.List[IDiagramConfig]
- Type: 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. |
defaults
Optional
- Type: IDiagramConfigBase
Default configuration to apply to all diagrams.
diagrams
Optional
- Type: typing.List[IDiagramConfig]
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.
name
Required
- Type: str
format
Required
- Type: DiagramFormat
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.
name
Required
- Type: str
format
Required
- Type: DiagramFormat
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.
name
Required
- Type: str
format
Required
- Type: DiagramFormat
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. |
config
Required
config: IPluginConfig
- Type: IPluginConfig
Get diagram plugin config.
id
Required
id: str
- Type: str
Unique identifier for this plugin.
version
Required
version: str
- Type: str
Plugin version.
default_dot_artifact
Optional
default_dot_artifact: CdkGraphArtifact
- Type: aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact
Get default dot artifact.
default_png_artifact
Optional
default_png_artifact: CdkGraphArtifact
- Type: aws.pdk.cdk_graph_plugin_diagram.CdkGraphArtifact
Get default PNG artifact.
dependencies
Optional
dependencies: typing.List[str]
- Type: typing.List[str]
List of plugins this plugin depends on, including optional semver version (eg: ["foo", "bar@1.2"]).
bind
Required
bind: IGraphPluginBindCallback
- Type: aws.pdk.cdk_graph_plugin_diagram.IGraphPluginBindCallback
Binds the plugin to the CdkGraph instance.
Enables plugins to receive base configs.
report
Optional
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_NS
Required
ARTIFACT_NS: str
- Type: str
Namespace for artifacts of the diagram plugin.
ID
Required
ID: str
- Type: str
Fixed id of the diagram plugin.
VERSION
Required
VERSION: str
- Type: str
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 |
str |
No description. |
rendering
Optional
rendering: IGraphThemeRendering
- Type: IGraphThemeRendering
theme
Optional
theme: str
- Type: str
IGraphThemeRendering
-
Extends: IGraphThemeRenderingIconProps, IGraphThemeRenderingOptions
-
Implemented By: 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_max
Optional
cfn_resource_icon_max: GraphThemeRenderingIconTarget
Highest Graph.CfnResourceNode icon to render.
cfn_resource_icon_min
Optional
cfn_resource_icon_min: GraphThemeRenderingIconTarget
Lowest Graph.CfnResourceNode icon to render.
resource_icon_max
Optional
resource_icon_max: GraphThemeRenderingIconTarget
Highest Graph.ResourceNode icon to render.
resource_icon_min
Optional
resource_icon_min: GraphThemeRenderingIconTarget
Lowest Graph.ResourceNode icon to render.
layout
Optional
layout: str
- Type: str
- Default: horizontal
Layout direction of the graph.
stack
Optional
stack: str
- Type: str
- Default: undefined Will render all stacks
Specify regex pattern to match root stacks to render.
stage
Optional
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_edges
Optional
unconstrained_cross_cluster_edges: bool
- Type: bool
- 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 |
---|---|---|
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_max
Optional
cfn_resource_icon_max: GraphThemeRenderingIconTarget
Highest Graph.CfnResourceNode icon to render.
cfn_resource_icon_min
Optional
cfn_resource_icon_min: GraphThemeRenderingIconTarget
Lowest Graph.CfnResourceNode icon to render.
resource_icon_max
Optional
resource_icon_max: GraphThemeRenderingIconTarget
Highest Graph.ResourceNode icon to render.
resource_icon_min
Optional
resource_icon_min: GraphThemeRenderingIconTarget
Lowest Graph.ResourceNode icon to render.
IGraphThemeRenderingOptions
- Implemented By: IGraphThemeRendering, 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. |
layout
Optional
layout: str
- Type: str
- Default: horizontal
Layout direction of the graph.
stack
Optional
stack: str
- Type: str
- Default: undefined Will render all stacks
Specify regex pattern to match root stacks to render.
stage
Optional
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_edges
Optional
unconstrained_cross_cluster_edges: bool
- Type: bool
- 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 |
typing.Union[int, float] |
No description. |
y |
typing.Union[int, float] |
No description. |
x
Required
x: typing.Union[int, float]
- Type: typing.Union[int, float]
y
Required
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