Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdk-dia

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk-dia

🎡 Automated diagrams of CDK provisioned infrastructure

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6K
decreased by-15.67%
Maintainers
1
Weekly downloads
 
Created
Source

Mentioned in Awesome CDK Test npm version

🎡 CDK-Dia - Automated diagrams for CDK infrastructure

Cdk-dia diagrams your CDK provisioned infrastructure using the Grpahviz dot lanuguage.

Example

This Diagram was automatically generated from an AWS CDK stack

Getting started

Add cdk-dia to your CDK project

$ npm install cdk-dia

Install Graphviz

$ brew install graphviz
  • If you don't use brew: Graphviz installation in many environments is well documented.
  • make sure Graphviz's dot binary is available in your PATH.

Synthesize your CDK application

$ cdk synth

Generate a CDK-DIA diagram

$ npx cdk-dia

Customize diagrams

In some cases it is useful to be able to tweak a diagram. For this purpose CDK-DIA includes customizers/decorators you can use with your CDK constructs in order to tweak the diagram.

  • In order to customize you have to add cdk-dia as a npm project dependency (globally installing it using npm -g won't allow you to use the CdkDiaDecorator class)

Example:

Consider the following diagram of a 3-Tier CDK Stack:

In this diagram CDK-DIA collapsed the DBTier (done automatically to any CDK Level 2 (L2) construct) in order to create a diagram which contains the most important details.

One can use a decorator in order to customize the diagram and prevent CDK-DIA from collapsing the Construct.

This is done by implementing CDK's IInpectable's interface and using CDK-DIA's decorator. example:

This results in a Diagram where the DB-Tier was not collapsed providing more details:

CLI arguments

  • npx cdk-dia --help - Get possible arguments
  • npx cdk-dia --stacks stackOne stackFour - only diagram chosen aws-cdk stacks
    • npx cdk-dia --stacks pipelinestack/prod/database - choose stacks by path (nested stacks, pipeline stacks)

FAQs

Package last updated on 10 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc