Diagrams that change with every apply

The Terraform and OpenTofu provider makes your diagram part of the configuration, so each apply redraws it.

Works withTerraformOpenTofuPulumi, through the providerLatest release: 0.1.0

A Terraform module gets one more file: the Plotwork provider, a plotwork_import data source that reads the module's own .tf files, and a plotwork_diagram resource with a stable link. It works with Terraform and OpenTofu.

Start with one block

Pin the provider, set an API key, and apply. The diagram link is an output like any other.

  • OpenTofu installs it by its full Terraform Registry address until it has a listing of its own.
main.tf
terraform {  required_providers {    plotwork = {      source  = "plotwork-official/plotwork"      version = "~> 0.1"    }  }}provider "plotwork" {} # reads PLOTWORK_API_KEY# Draw this module's Terraform.data "plotwork_import" "network" {  format = "terraform"  files = {    for f in fileset(path.module, "*.tf") : f => file("${path.module}/${f}")  }}# Publish it with a link that never changes.resource "plotwork_diagram" "network" {  source = data.plotwork_import.network.source  name   = "Production network"  alias  = "prod-network"}output "diagram" {  value = plotwork_diagram.network.stable_url}
export PLOTWORK_API_KEY="pw_..."terraform init && terraform apply

See what a plan changes before apply

The HCP Terraform run task draws each plan into your library, every change marked in its colour.

Set up the run task (opens in a new tab)

Your SVG, in your own bucket

plotwork_render hands back the SVG for S3, Azure Blob Storage, Cloud Storage or a local file.

Draw into your own storage (opens in a new tab)

Live values from the apply

Fill a diagram template with the CIDRs, endpoints and DNS names only the apply knows.

Draw live values (opens in a new tab)

Brand, icons and patterns as code

Set the organisation's colours, icons and approved patterns in the same apply that redraws its diagrams.

Organisations in Terraform (opens in a new tab)

Icons from your buckets and CDNs

Upload organisation icons from a file, an S3 or Azure blob, or an https address on a CDN.

Host icons for Terraform (opens in a new tab)

Pulumi stacks, through the same provider

TypeScript and Python stacks run this provider through Pulumi's Any Terraform Provider, not a native package.

Use it from Pulumi (opens in a new tab)

Agents write it, apply ships it

The provider runs the engine the MCP server runs, so what an agent drafts is what apply publishes.

One engine
plotwork_import reads every format import_source reads, with the same coverage line.
Templates from agents
An agent writes the diagram template; templatefile fills in the values at apply.
Scoped keys
Design resources need an organisation key with the Brand, icons and patterns scope.
Connect an agent (opens in a new tab)
MCPimport_source
Request{  "format": "terraform",  "text": "<main.tf, 51 lines>"}Response{  "ok": true,  "coverage": {    "line": "Drawn 8 of 8 resources.",    "complete": true  },  "diagnostics": [],  "validation": { "valid": true }}

Works withClaude CodeCursorVS CodeCodexWindsurfGemini CLIand any MCP client

Answers for your platform review

What platform and security teams ask before a provider joins their pipelines.

Release
  • 0.1.0 on the Terraform Registry
OpenTofu
  • Tested on OpenTofu, installed by its full Terraform Registry address
Pulumi
  • Runs through Pulumi's Any Terraform Provider, in TypeScript or Python
  • Not a native Pulumi package
Run task
  • HCP Terraform and Terraform Enterprise, post-plan and advisory
  • Never stores the plan, the run token or a variable
  • Pro and Enterprise
Blocks and plans
  • plotwork_import: Pro and Enterprise
  • plotwork_render: Pro and Enterprise
  • plotwork_diagram: Every plan
  • plotwork_organization_brand: Pro and Enterprise
  • plotwork_organization_icon: Pro and Enterprise
  • plotwork_pattern: Enterprise
Source
  • MIT licensed, with its code and changelog on GitHub
  • Each release GPG signed, with a CycloneDX SBOM and SLSA provenance
  • Ten runnable examples, smoke tested before each release
What it sends
  • Only the files and diagram source you pass it; pass configuration, not state
Identity
  • Single sign-on with OpenID Connect
  • Single sign-on with SAML
  • SCIM provisioning of members and groups
Audit
  • Audit log export
  • Audit events and drift sent to Datadog, Dynatrace, Splunk, Microsoft Sentinel or a webhook
Data
  • Diagram source is not stored unless you publish it
Deployment
  • Hosted, or self-hosted with no outbound request

Put your diagrams in your Terraform

Start with the quick start, or run one of the ten examples with your own key.