Diagram Customization
Pluralith's mission is to generate infrastructure diagrams in a completely automated way. For that we have developed a dedicated in-house algorithm to draw diagrams and we are constantly improving it.
Sometimes, however, our algorithm still falls short and diagrams might look a little messy or you might want certain resources to be displayed differently. To allow for that we've introduced a simple way for you to customize how our algorithm treats resources through the pluralith.yml
config (more on that here).
Diagram Settings
In your pluralith.yml
config file you can configure how Pluralith draws your diagram through the diagram
key as shown below:
# _
# |_)| _ _ |._|_|_
# | ||_|| (_||| | | |
#
# Welcome to Pluralith!
# https://www.pluralith.com
#
# This is your Pluralith config file
# Learn more about it at https://docs.pluralith.com/docs/more/config
org_id: ########
project_id: ########
project_name: ########
config:
# title: null
# version: null
# sync_to_backend: false
# ...
diagram: # <- This is where you configure how your diagram is drawn
hide:
- aws_subnet.ZergNet1
Targets
You have various options to customize how the Pluralith algorithm treats resources. With each options you target everything from a specific resource at a given index all the way up to an entire module.
info
You can target:
- resourceType
- moduleName
- moduleName.resourceType
- moduleName.resourceType.resourceName
- moduleName.resourceType.resourceName.index
Options
The actual options you have for all the targets listed above are outlined in the table below, followed by a full example.
hide | Hides the the target. Helps to remove unnecessary clutter. |
show | Force-shows the target. Pluralith attempts to intelligently hide resources to make the diagram more readable. This might not always work for you and the show option lets you override Pluralith. |
groups | Groups everything in the target's context. This might help to make the diagram more readable. |
ungroup | Force-ungroups a resource group. Pluralith attempts to intelligently group resources to make the diagram more readable. This might not always work for you and the ungroup option lets you override Pluralith. |
relations | Links two targets. They can be linked as a connected (a line is drawn between them) or nested (one is nested inside the other). |
unrelate | Force-unlinks two targets. Pluralith generates connections between resources by checking dependencies in Terraform state. This might not always work for you and the unrelate option lets you override Pluralith. |
Example
# _
# |_)| _ _ |._|_|_
# | ||_|| (_||| | | |
#
# Welcome to Pluralith!
# https://www.pluralith.com
#
# This is your Pluralith config file
# Learn more about it at https://docs.pluralith.com/docs/more/config
org_id: ########
project_id: ########
project_name: ########
config:
# title: null
# version: null
# sync_to_backend: false
# ...
diagram:
hide:
- resourceType
- moduleName.resourceType.resourceName
- moduleName.resourceType.resourceName.index
- moduleName
show:
- resourceType
- moduleName.resourceType.resourceName
- moduleName.resourceType.resourceName.index
- moduleName
groups:
- name: groupName
resources:
- resourceType
- moduleName.resourceType.resourceName
- moduleName.resourceType.resourceName.index
- moduleName
ungroup:
- resourceType
- moduleName.resourceType.resourceName
- moduleName.resourceType.resourceName.index
- moduleName
relations:
- parent: element
child: element
type: nested
- parent: element
child: element
type: connected
- parent: element
child: element
type: connected
unrelate:
- resource1: moduleName.resourceType.resourceName.index
resource2: moduleName.resourceType.resourceName.index
- resource1: moduleName.resourceType.resourceName.index
resource2: moduleName.resourceType.resourceName.index
- resource1: moduleName.resourceType.resourceName.index
resource2: moduleName.resourceType.resourceName.index