Skip to content

Properties override

In some cases while generating the diagram it might be necessary to override a value read from the cloud provider, like for instance to set a custom name or a custom value for a specified property. This is possible by simply using the file, or f, argument multiple times. The provided files will be merged, and the values in the last will take precedence over the previous.

For instance assuming your generated inventory looks like:

accounts:
  "000000000000":
    id: "000000000000"
    name: ""
    # ...

You can override the name of the account by specifying the following in inventory.override.yml:

accounts:
  "000000000000":
    id: "000000000000"
    name: "some-custom-name"

Then simply use both files when generating the diagram:

docker run --rm \
  -v `pwd`/output/inventory.yml:/opt/infra-inspector/inventory.yml:ro \
  -v `pwd`/inventory.override.yml:/opt/infra-inspector/inventory.override.yml:ro \
  -v `pwd`/output:/output \
  ghcr.io/infra-inspector/infra-inspector:latest \
  diagram -f /opt/infra-inspector/inventory.yml -f /opt/infra-inspector/inventory.override.yml -o /output/diagram.drawio

Note that the .override.yml suffix convention it's just for clarity clarity, but if needed any name can be used.