Tag: DevOps

  • Draw your infrastructure. Deploy it. Here’s how that actually works.

    The idea sounds simple: draw an architecture diagram, press a button, get Terraform. But anyone who has tried to automate the path from architecture design to deployable infrastructure knows it’s not simple. The gap between a diagram and working IaC is where most of the complexity lives.

    In this post I want to explain how the draw-to-deploy workflow actually functions — the technical pieces involved, where the hard problems are, and what makes it reliable versus fragile.

    Why the gap exists.

    Architecture diagrams and infrastructure as code are two different representations of the same thing — but they’re designed for different audiences and optimized for different purposes.

    A diagram is optimized for human understanding. It shows relationships, groupings, and high-level structure. It deliberately abstracts away implementation details. A service and a container are distinct boxes in a diagram. How the container image is built, what resources it requests, what health check it uses — none of that is in the diagram.

    IaC is optimized for machine execution. It’s explicit about every detail. A Kubernetes deployment manifest needs a container image, resource limits, liveness probes, environment variables, and dozens of other fields that have no representation in a diagram.

    Bridging these two representations is the core technical challenge of draw-to-deploy. You’re translating from human-optimized to machine-optimized, and the translation requires filling in a lot of information that exists in the diagram implicitly or not at all.

    The technical pieces.

    1. A structured diagram format

    The first requirement is that diagrams are structured, not just visual. A PNG export of a Visio diagram is a picture — you can look at it, but a system can’t parse it meaningfully. Draw-to-deploy requires a format where the diagram structure is machine-readable.

    draw.io (also known as diagrams.net) stores diagrams as XML. The XML encodes what shapes exist, what they’re connected to, and what labels they carry. It’s not infrastructure-aware by default — a box labeled ‘service’ is just a labeled box — but it’s parseable.

    Mermaid is more structured. A Mermaid architecture diagram explicitly declares node types and relationships in a syntax designed for parsing. The semantic information is more reliable.

    The more structured the input format, the more the system can infer about the infrastructure being described.

    2. Component recognition and classification

    Given a parseable diagram, the next step is identifying what each component is. A box labeled ‘PostgreSQL’ or a standard database icon is recognizable. A box with a custom label might be a service, a database, a queue, a load balancer — the system needs to determine which.

    This is where an infrastructure-aware diagram format pays off. If the diagram is drawn in a tool that has explicit node types — ‘this is a Kubernetes service, this is an RDS instance, this is an S3 bucket’ — classification is reliable. If you’re parsing a free-form diagram, you’re relying on label matching and shape heuristics, which is less reliable.

    Good component recognition produces a typed infrastructure model: Service A (type: Kubernetes Deployment), connected to Database B (type: PostgreSQL RDS), running in Environment C (type: AWS VPC).

    3. Relationship extraction

    Connections in a diagram represent relationships. But ‘relationship’ is underspecified. Two components connected by an arrow might have a network connection, a dependency, a data flow, an API call, or a simple ‘runs inside’ relationship. The type of relationship determines what IaC is generated.

    A Service connected to a Database generates different IaC than a Service connected to a Message Queue. Getting this right requires either explicit relationship labeling in the diagram or inference from component types.

    The rule I apply: if the relationship type matters for IaC generation (and it almost always does), it should be explicitly labeled. Rely on inference only for relationships where the type is unambiguous — a container connecting to a cluster node is always a ‘runs on’ relationship.

    4. Template-based code generation

    With a typed infrastructure model and explicit relationships, code generation is the most tractable part of the problem. Each component type maps to a template. The templates are parameterized by the values extracted from the diagram — name, environment, scale, connectivity.

    A Kubernetes Deployment template has fields for: name, image, replicas, resource requests and limits, environment variables, volume mounts, and health checks. Some of these come from the diagram (name, perhaps replicas if specified). Others come from defaults appropriate for the component type and environment. Some require explicit values that must be provided.

    The output is IaC that is correct in structure and partially complete in content. The engineer filling in the remaining values has a valid starting point — not a blank file.

    5. The defaults problem

    This is the hardest part of reliable draw-to-deploy, and the part that most implementations get wrong.

    A diagram doesn’t specify resource limits. What does the generated Terraform request? A diagram doesn’t specify backup retention. What does the generated RDS configuration set? A diagram doesn’t specify encryption. What does the generated storage configuration use?

    If the generator picks arbitrary defaults, the result is either insecure (defaulting to no encryption), over-provisioned (defaulting to large instance sizes), or under-specified (generating a skeleton that can’t actually deploy without significant manual completion).

    Sensible defaults require infrastructure knowledge baked into the generator. The defaults for a production PostgreSQL RDS instance should be different from the defaults for a development one. The defaults for infrastructure in a GDPR-regulated environment should include encryption settings that defaults for a non-regulated environment might not require.

    Context-aware defaults — defaults that depend on the environment, the regulatory context, and the component type — are what separate a useful draw-to-deploy implementation from one that generates technically valid but operationally wrong code.

    What makes it reliable.

    A draw-to-deploy workflow is reliable when:

    • The diagram format is structured and infrastructure-aware, not free-form
    • Component types are explicit, not inferred from labels
    • Relationship types are labeled, not guessed
    • Defaults are context-aware — they know what environment and regulatory context they’re generating for
    • The generated code is reviewed by an engineer before deployment — the diagram-to-IaC step fills in structure, not substitutes for judgment

    That last point matters. Draw-to-deploy is not a push-button deploy system. It’s a system that eliminates the manual, error-prone translation layer between design and code, and produces a correct-structure, sane-defaults starting point that an engineer reviews and approves. The engineer is still in the loop — they’re just not spending their time transcribing box positions into YAML.

    What the workflow looks like in practice.

    Here’s the practical sequence with Vernix.one:

    • Draw the architecture in Vernix.one’s visual designer, or import an existing draw.io or Mermaid diagram
    • Vernix.one parses the diagram, classifies components, and extracts relationships
    • The infrastructure model is built — a structured, typed representation of what the diagram describes
    • Select the target environment (development, staging, production) and IaC format (Terraform, Pulumi, Ansible)
    • Vernix.one generates IaC using environment-appropriate defaults and your organization’s standards
    • Review the generated code — verify the defaults are right, fill in any values that require manual specification (specific secrets, custom configurations)
    • Deploy through your normal pipeline

    The time from diagram to deployable IaC is minutes, not days. The generated code is structurally correct and compliant with defaults appropriate for the environment. The engineer’s time is spent on review and refinement, not transcription.

    The closed loop.

    The workflow doesn’t stop at deployment. After the infrastructure is running, Vernix.one’s discovery engine scans the live environment and updates the infrastructure model. If the deployed infrastructure diverges from the diagram — a scale change, a configuration update, an emergency fix — the model reflects the divergence.

    The diagram is no longer a static document that becomes wrong the moment it’s published. It’s a view into the current state of the infrastructure model, updated from the real environment. When you look at the diagram tomorrow, it reflects what’s running tomorrow.

    This is the closed loop that makes the workflow durable rather than a one-time convenience. Design flows into deployment. Deployment flows back into the model. The model always reflects reality.

    If you want to see this with your own diagrams — bring a draw.io file, a Mermaid diagram, or even a Terraform file, and we’ll run the full workflow in a demo session.

    Book a Demo