testform modules
testform [global options] modules [options]The testform modules command inspects the referenced configuration (main.yml and domain configuration files) and prints a list of all testing modules declared in the workspace along with their sources and resolved versions.
It matches the exact format and JSON schema of terraform modules.
Command Options
Section titled “Command Options”| Option | Default | Description |
|---|---|---|
-json |
false |
Outputs declared modules and their resolved versions in machine-readable JSON format. |
-var 'foo=bar' |
— | Sets an input variable value in the root module. Can be specified multiple times. |
-var-file=filename |
— | Loads variable values from a file (testform.vars.yml or *.auto.vars.yml). |
Usage Examples
Section titled “Usage Examples”1. No modules declared
Section titled “1. No modules declared”When no modules are present in the configuration:
$ testform modulesNo modules found in configuration.And in JSON mode (-json):
$ testform modules -json{"format_version":"1.0","modules":null}2. Modules tree output
Section titled “2. Modules tree output”When modules are declared in main.yml (using the module: block):
version: "1.0"module: auth: source: "./modules/auth" checkout: source: "./modules/checkout" version: "1.2.0" remote_qa: source: "git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0"Running testform modules:
$ testform modulesModules declared by configuration:.├── "auth"[./modules/auth]├── "checkout"[./modules/checkout] 1.2.0└── "remote_qa"[git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0] v2.0.03. JSON Output (-json)
Section titled “3. JSON Output (-json)”Enables CI/CD pipelines, security scanners, and auditing tools to programmatically inspect declared modules:
$ testform modules -json{ "format_version": "1.0", "modules": [ { "key": "auth", "source": "./modules/auth", "version": "" }, { "key": "checkout", "source": "./modules/checkout", "version": "1.2.0" }, { "key": "remote_qa", "source": "git::https://github.com/my-org/qa-modules.git//auth?ref=v2.0.0", "version": "v2.0.0" } ]}Exit Codes
Section titled “Exit Codes”0: Command executed successfully.1: Configuration reading or syntax error.