Skip to content

Quick start

Requirements

To install infra-inspector you need:

  • AWS credentials: this is required to create the inventory file, as infra-inspector will need to call AWS APIs; please make sure the credentials have all the required permissions;
  • Docker: this is required to install infra-inspector.

Install

Please follow the installation guide.

Generate the inventory

To generate the inventory:

docker run --rm \
  -v ~/.aws/credentials:/root/.aws/credentials:ro \
  -v `pwd`/inventory-config.yml:/opt/infra-inspector/inventory-config.yml:ro \
  -v `pwd`/output:/output \
  ghcr.io/infra-inspector/infra-inspector:latest \
  inventory -c /opt/infra-inspector/inventory-config.yml -o /output/inventory.yml

This command assumes an inventory configuration file named inventory-config.yml and a directory output are in the current folder.

It also assume that the AWS profile, if any, specified in the config exists in ~/.aws/credentials. If no profile is specified, the credentials will be loaded using the normal process. The used credentials should have the required read permissions to read all the supported resources, no write access is needed.

Generate the diagram

From the inventory we generated above we can then create the diagram with:

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

If you need to override some details about the infrastructure (ie. to clarify some resource names, you can edit the inventory YAML file before running the last command).

The output can then be opened in Draw.io, which can be used from the CLI as well, in case you need to export the diagram as image.