Convert your terraform files into AWS diagrams in 2 min
Tags: aws, devops, terraform
Published: 2023-12-18 15:49:35

You’re likely familiar with tools like Mingrammer that can generate cloud diagrams from Python code. If not, check it out — it’s pretty cool. While other tools, such as mermaid, allow you to draw diagrams from text files, today I want to introduce you to something even cooler: generating infrastructure diagrams directly from your Terraform files.

It might seem as magical as AI, but it doesn’t rely on AI. This is made possible with Holori, a new tool focused on cloud infrastructure that takes your Terraform files as input (main.tf, output.tf, variables.tf, backend.tf — excluding the tfstate) and generates awesome infrastructure diagrams for AWS, GCP, and Azure.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3iea0ovjz9898f00c03a.png)

## Why is it useful to generate Terraform diagrams?
Generating [Terraform diagrams](https://holori.com/terraform-diagram/) with Holori serves various purposes:

-**Visualizing your Terraform:** Gain a clear visual representation of your infrastructure.

-**Collaborating on your Terraform:** Share and discuss infrastructure design with your team.

-**Documenting your infrastructure:** Automatically generate documentation for your infrastructure.

-**Visualizing your current AWS infrastructure:** Get an overview of your existing AWS setup.

-**Tracking your Terraform changes (with CI/CD)**: Monitor changes made to your infrastructure with continuous integration and deployment.

-**Continuous infrastructure visibility (with CI/CD):** Ensure ongoing visibility into your infrastructure with automated diagram generation.

## Generate easily clear and accurate AWS diagram from Terraform

**How it works**

1- Create an account on Holori : https://app.holori.com/

2- Click on create new project > Import from terraform

3- Upload your ZIP file : these ZIP files must be contain (main.tf, output.tf, variables.tf, backend.tf… not the tfsate)

4- Wait 2 min and get your infra diagram auto generated

5- Iterate on your diagrams and drill down on the terraform attributes


{% embed https://www.youtube.com/watch?v=pBMdf6jaWEA&t=74s&ab_channel=Holori %}


## Connect Holori to your CI/CD for automated terraform diagram generation

By linking Holori to your Git hosting service, Terraform diagrams are automatically generated in the comments of your Pull Request. Holori monitors your repository for Terraform code changes, and when detected, a new Terraform diagram snapshot is posted in your CI/CD.


This ensures better visibility across the entire team, faster PR reviews, avoidance of costly mistakes, and evergreen documentation of your infrastructure. AND MOST OF ALL, IT’S COOL.

By opening the PR in Holori App, you can access the diagram, edit it, check the terraform attributes and export the PDF documentation.

Holori team is currently working on generating the diff diagram that highlights the future changes of the PR. The diff diagrams will be accessible in the CI/CD or in Holori App.

**How it works**

1- Create an account on Holori : https://app.holori.com/

2- Click on create new project > Generate Terraform diagrams in your CI/CD

3- Follow the Github app installation procedure

4- Select your organizations and repos that you want connect to Holori



## Conclusion:

It’s not AI but it’s magic, generating diagrams from Terraform files is now made possible by Holori !

Holori aims to simplify the visualization, collaboration, and documentation processes associated with Cloud Infrastructure. The integration with CI/CD adds automation, ensuring that AWS diagrams are always up-to-date with the latest Terraform code changes.

The Holori App provides a user-friendly interface for managing and editing generated diagrams, making it a very valuable asset for teams working with Terraform in cloud environments.

**You can try it now for free : app.holori.com/ — Holori offers 50 CI Runs/month for free**