npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tfpuml

v0.2.6

Published

Generate PlantUML Images from a Terraform State file

Downloads

21

Readme

terraform-plantuml

GitHub Codacy Badge Depfu

Generate PlantUML Images from a Terraform State file.

Example

See Examples for Terraform samples and their image outputs.

Considerations:

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.

Steps

  • Install npm i -g tfpuml
  • Download a PlantUML JAR from official sources (Releases)
    • 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
  • Copy your TF state file, it is usually named terraform.tfstate
  • Run tfpuml where your TF state file resides
    • Output: output.puml
  • Run tfpuml --image to run and export a PNG diagram
    • Or, run java -jar plantuml.jar output.puml using the PUML file from previous step
    • Output: output.png

Options

  • tfpuml <input TF state file> <output .puml file>
    • Defaults are terraform.tfstate and output.puml
  • tfpuml --image runs the PlantUML visualization graphic lib at the end and outputs an output.png image file
  • tfpuml --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

Support

  • AWS
    • Buckets
    • IAM Users
    • Regions
      • VPCs
        • AZs
        • Subnets
        • Gateways like IGWs, NATs, and others
    • EC2
      • On Demand, Spot
    • Lambdas
    • RDS
    • ECS (partial)
      • Cluster

Limitations

Since we're using PlantUML as both input and visualization, it doesn't support intersecting groups - it is a limitation of GraphViz and not really incentivized by PlantUML (or C4 Model) design. For this project it means groups that usually intersect with AZs like Security Groups, Beanstalk or Clusters have to rely on some group repetition.

To avoid cluttering the diagram, some AWS resources are intentionally left out, like Security Groups, IAM policies/roles and CloudWatch Logs.

Roadmap

  • ECS Services & Tasks positioned at their subnets
  • More examples from terraform-aws-modules

Acknowledgements

  • AWS Icons for PlantUML - This project is really a tool built on top of it - only possible because of their amazing job.