Generate PlantUML Images from a Terraform State file.
Take precautions when using State files (as they are open JSON files, most likely with secrets).
This package does NOT require Internet connection to run, nor it stores any parsed info anywhere. Its only effect is to generate two output files: .puml and optionally .png files. Any possible sensitive value is ignored, it can even be redacted beforehand if Security procedures demand so.
Safest way to generate a valid TF State file is to run terraform init, plan & apply
locally, not logged to any real service, using a tool like LocalStack.
- Install
npm i -g tfpuml
- (Alpha) Not published to npm yet, so clone this repo, and run
npm link
from root
- (Alpha) Not published to npm yet, so clone this repo, and run
- Download a
plantuml.jar
from official sources- This packages comes with a script
tfpuml-download-plantuml
, run it to download a copy into this package folder - Some IDEs are able to visualize PlantUML
.puml
files using plugins
- This packages comes with a script
- Copy your TF state file to this folder root as
terraform.tfstate
- Run
tfpuml
- Output:
output.puml
- Output:
- Run
java -jar plantuml.jar output.puml
- Output:
Terraform Stage Graph.png
- Output:
tfpuml <input TF state file> <output .puml file>
- Defaults are
terraform.tfstate
andoutput.puml
- Defaults are
tfpuml --image
runs the PlantUML visualization graphic lib at the end and outputs anoutput.png
image filetfpuml --no-check
ignores checking for Terraform Version, use it for state files versions < 1.30 (might run into issues)
See tfpuml --help
for further options
- AWS
- Buckets
- IAM Users
- Regions
- VPCs
- AZs
- Subnets
- VPCs
- RDS (partial)
- EC2 (partial)
- ECS (coming next)
- More common resources supported