Skip to content

awslabs/diagram-as-code

Diagram-as-code

This command line interface (CLI) tool enables drawing infrastructure diagrams for Amazon Web Services through YAML code. It facilitates diagram-as-code without relying on image libraries.

The CLI tool promotes code reuse, testing, integration, and automating the diagramming process. It allows managing diagrams with Git by writing human-readable YAML.

(generated from the example of PrivateLink)

Getting started

for Gopher (go 1.21 or higher)

$ go install github.com/awslabs/diagram-as-code/cmd/awsdac@latest

for macOS user

In preparing.

Usage

awsdac <input filename> [flags]

Flags:
  -h, --help            help for awsdac
  -o, --output string   Output file name (default "output.png")
  -v, --verbose         Enable verbose logging

Example

$ awsdac examples/alb-ec2.yaml
$ awsdac privatelink.yaml -o custom-output.png

Example templates are here.

Features

  • Compliant with AWS architecture guidelines
    Easily generate diagrams that follow AWS diagram guidelines.
  • Flexible
    Automatically adjust the position and size of groups.
  • Lightweight & CI/CD-friendly
    Start quickly on a container; no dependency on headless browser or GUI.
  • Integrate with your Infrastructure as Code
    Generate diagrams to align with your IaC code without managing diagrams manually.
  • As a drawing library
    Use as Golang Library and integrate with other IaC tools, AI, or drawing GUI tools.
  • Extensible
    Add definition files to create non-AWS diagrams as well.

Resource types

See doc/resource-types.md.

Resource Link

See doc/links.md.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.