DrawDSL guide
Declare namespaced resources, place related resources in containers, then connect their IDs.
direction right
aws:lambda handler "Request handler"
aws:dynamodb data "Application data"
handler --> data : stores results
Arrows
source --> target directed, solid
source -.-> target directed, dashed
source --- target undirected, solid
source -.- target undirected, dashed
source <--> target bidirectional, solid
source <-.-> target bidirectional, dashed
Pin an endpoint with T:, R:, B:, or L:: R:handler --> T:data.
Declarations and containers
namespace:symbol id "Optional label"
aws:cloud cloud "AWS Cloud" {
aws:region region "ap-southeast-1" {
aws:lambda worker
}
}
Use # for comments. Labels support \n, \", and \\ escapes. Layout directives include direction, node-spacing, layer-spacing, edge-spacing, padding, and container-only col. Define reusable colors with color primary = #f90; style an edge with [color=primary, width=3] or a group with [background=primary].
Keyboard: Tab indents, Shift+Tab leaves the editor, and Esc moves focus to the toolbar. Containers can be collapsed with the chevrons in the fold gutter (or Fold all); folded lines stay part of the diagram and edits elsewhere keep folds intact.
Grid layout
Use core:layout for an invisible structural container. Set col 2 to arrange its direct children in declaration order; nested layout containers can define separate columns without adding a visible group.
core:layout grid {
col 5
core:layout far-left {
col 1
aws:tgw tgw-rhmp-eznetw-internet
}
}
Children are placed left to right, then top to bottom, with smaller items centered in their cells. Resources inside the grid can still be connected, but core:layout containers cannot be edge endpoints.
Use Copy draw.io XML to copy the generated XML, then open diagrams.net and import or paste it into your diagram. Download .drawio saves the same output as a file, and Download .drawdsl saves the exact current source.
Use Copy share link to copy a self-contained URL for this DSL. Links are compressed when possible and work without a backend; anyone with the link can read the DSL, so do not include secrets.
Use Saved diagrams to keep named copies in this browser's local storage. They stay on this device and browser profile until you delete them.