Skip to content

Commit

Permalink
Docs update for modules cmd human view
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Nov 18, 2024
1 parent 054d53e commit 0778f7a
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions website/docs/cli/commands/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ key, source, and version.

## Usage

Usage: `terraform modules -json`
Usage: `terraform modules [options]`

The following flags are available:
The following optional flags are available:

- `-json` - Displays the module declarations in a machine-readable, JSON format.

The `-json` flag is _required_ to run the `terraform modules` command. In future releases, we will extend this command to allow for additional options.

The output of `terraform modules` includes a `format_version` key, which is set to the value of `"1.0"` in Terraform 1.10.0. The semantics of this version are:
The output of `terraform modules -json` includes a `format_version` key, which is set to the value of `"1.0"` in Terraform 1.10.0. The semantics of this version are:

- For minor versions, such as `"1.1"`, changes or additions will be backward-compatible.
Ignore object properties that are unrecognized to remain forward-compatible
Expand All @@ -37,6 +35,26 @@ We will introduce new major versions only within the bounds of

## Output Format

The following example is a representation of the JSON output format that `terraform modules` returns.

```
Module: my_local_module
Source: ./path/to/local/module
Version:
Module: my_private_registry_module
Source: app.terraform.io/hashicorp/label/null
Version: 1.0.0
Module: my_public_registry_module
Source: terraform-aws-modules/iam/aws
Version: 5.47.1
Module: my_remote_module
Source: https://example.com/vpc-module.zip
Version:
```

The following example is a representation of the JSON output format that `terraform modules -json` returns.

```javascript
Expand Down

0 comments on commit 0778f7a

Please sign in to comment.