Skip to content

inventory command

This command allows you to query inventory.

Usage

formae inventory [COMMAND]

Resources inventory

Usage

formae inventory resources [OPTIONS]

Options

Option Description
--max-results Maximum number of resources to display in the table (0 = unlimited) [default: 10]
--output-consumer Consumer of the command result (human | machine) [default: "human"]
--output-schema The schema to use for the machine output (json | yaml) [default: "json"]
--query Query that allows to find resources by their properties [default: ""]

Consumer

Currently, there are two consumers:

  • human (default): The CLI assumes a human user is interacting with it. Output is less strictly formatted and more verbose
  • machine: The CLI assumes the data printed to stdout will be processed by a machine or another tool

Query

This command, using the --query flag, allows you to search and retrieve resources managed by formae. The query language is simple and is described in detail here. Following fields are available for search:

  • stack: the stack that the extracted resources need to belong to (case sensitive)
  • label: the label of the resource (case sensitive)
  • type: the type of the resource (case insensitive)
  • commandid: the id of the command for which to retrieve the resources
  • managed: true means only resources will be extracted that the user applied previously. false means automatically discovered resources will be extracted. Not setting this flag means both will be extracted

Here are a few examples:

  • formae inventory resources --query='stack:foobar' --output-consumer=machine: retrieve all currently managed resources from the stack foobar for the machine consumer (as JSON)
  • formae inventory resources --query='-stack:foobar': retrieve all currently managed resources from any stack other than foobar
  • formae inventory resources --query='type:aws::ec2::subnet': retrieve all currently managed resources of type subnet
  • formae inventory resources: retrieve all resources currently managed by formae

Human output

This command outputs a tabular summary of resources in question.