diff --git a/website/docs/cli/commands/modules.mdx b/website/docs/cli/commands/modules.mdx index 00db42dce736..792d498a241f 100644 --- a/website/docs/cli/commands/modules.mdx +++ b/website/docs/cli/commands/modules.mdx @@ -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 @@ -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