Cloud network and infrastructure topology preset built on top of Choreo's rendering primitives.
Choreo.Infrastructure is a domain-specific vocabulary layer that adds cloud-network
concepts — VPCs, subnets, compute, load balancers, managed databases, storage — on top of
the same graph, cluster, and rendering stack used by Choreo. It is not a parallel
implementation: it shares Choreo.Theme, Choreo.Internal, and the Yog rendering pipeline
directly.
The key additions over plain Choreo are:
- Typed cluster boundaries —
:vpc,:subnet_public,:subnet_privatecarry security semantics (e.g. databases should not be in public subnets) that generic clusters do not. Choreo.Infrastructure.Analysis— structural audit rules that inspect topology against those security semantics (direct internet-to-private-subnet links, misplaced databases, etc.).- Network vocabulary —
add_vpc/3,add_compute/3,add_managed_db/3etc. as intent-revealing builders instead of the genericadd_cluster/3/add_service/3.
Node colors and shapes are resolved through Choreo.Theme (:internet, :compute, and
:managed_db are first-class theme types), so the full theme system — including :dark,
:warm, :forest, :ocean — applies to infrastructure diagrams without any extra
configuration.
Element types
:internet— public gateway or client zone:load_balancer— traffic proxy (e.g. ALB, ingress):compute— application runner (EC2, ECS task, Kubernetes pod):managed_db— stateful database (RDS, Aurora):storage— blob/file storage (S3, EFS)
Network boundaries (Clusters)
:vpc— Virtual Private Cloud container:subnet_public— Public subnet zone (internet-facing):subnet_private— Private subnet zone (isolated)
Quick Start
infra =
Choreo.Infrastructure.new()
|> Choreo.Infrastructure.add_internet(:gateway, label: "Internet Gateway")
|> Choreo.Infrastructure.add_vpc("vpc_main", label: "Production VPC")
|> Choreo.Infrastructure.add_subnet_public("subnet_dmz", label: "Public Subnet", parent: "vpc_main")
|> Choreo.Infrastructure.add_subnet_private("subnet_app", label: "Private Subnet", parent: "vpc_main")
|> Choreo.Infrastructure.add_load_balancer(:alb, label: "ALB", cluster: "subnet_dmz")
|> Choreo.Infrastructure.add_compute(:api, label: "API Service", cluster: "subnet_app")
|> Choreo.Infrastructure.add_managed_db(:db, label: "Postgres RDS", cluster: "subnet_app")
|> Choreo.Infrastructure.connect(:gateway, :alb)
|> Choreo.Infrastructure.connect(:alb, :api)
|> Choreo.Infrastructure.connect(:api, :db)
# Check for architecture warning violations
warnings = Choreo.Infrastructure.Analysis.warnings(infra)
dot = Choreo.Infrastructure.to_dot(infra)
mermaid = Choreo.Infrastructure.to_mermaid(infra)
Summary
Functions
Adds a compute workload runner node (EC2, ECS task, Kubernetes pod).
Adds an internet gateway or public internet entrypoint node.
Adds a load balancer proxy node (ALB, Ingress Controller).
Adds a managed database node (RDS, Aurora, DynamoDB).
Adds a storage bucket or block storage node (S3, EFS).
Adds a private subnet cluster boundary.
Adds a public subnet cluster boundary.
Adds a VPC cluster network boundary.
Connects two infrastructure nodes together.
Returns all edges.
Creates a new empty cloud infrastructure diagram.
Returns all node IDs.
Renders the infrastructure topology to DOT format.
Renders the infrastructure topology to Mermaid.js syntax.
Types
@type t() :: %Choreo.Infrastructure{ clusters: %{required(String.t()) => map()}, edge_meta: %{optional(Yog.Multi.Graph.edge_id()) => map()}, graph: Yog.Multi.Graph.t() }
Functions
@spec add_compute(t(), Yog.node_id(), keyword()) :: t()
Adds a compute workload runner node (EC2, ECS task, Kubernetes pod).
@spec add_internet(t(), Yog.node_id(), keyword()) :: t()
Adds an internet gateway or public internet entrypoint node.
@spec add_load_balancer(t(), Yog.node_id(), keyword()) :: t()
Adds a load balancer proxy node (ALB, Ingress Controller).
@spec add_managed_db(t(), Yog.node_id(), keyword()) :: t()
Adds a managed database node (RDS, Aurora, DynamoDB).
@spec add_storage(t(), Yog.node_id(), keyword()) :: t()
Adds a storage bucket or block storage node (S3, EFS).
Adds a private subnet cluster boundary.
Adds a public subnet cluster boundary.
Adds a VPC cluster network boundary.
@spec connect(t(), Yog.node_id(), Yog.node_id(), keyword()) :: t()
Connects two infrastructure nodes together.
@spec edges(t()) :: [{Yog.node_id(), Yog.node_id(), any()}]
Returns all edges.
@spec new() :: t()
Creates a new empty cloud infrastructure diagram.
@spec nodes(t()) :: [Yog.node_id()]
Returns all node IDs.
Renders the infrastructure topology to DOT format.
Options
:theme—:default,:dark,:warm,:forest,:ocean, or aChoreo.Themestruct:highlighted_nodes— list of node IDs to highlight:highlighted_edges— list of edge IDs or{from, to}tuples to highlight
Renders the infrastructure topology to Mermaid.js syntax.
Options
:theme—:default,:dark,:warm,:forest,:ocean, or aChoreo.Themestruct:direction—:td(default),:lr,:rl,:bt:highlighted_nodes— list of node IDs to highlight:highlighted_edges— list of edge IDs or{from, to}tuples to highlight