From cf0c54f8340d11f85b64026f021513b3bbeb327a Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Tue, 12 Jan 2021 17:06:53 -0500 Subject: [PATCH 1/3] Add documentation page for version The version command, although not the mightiest of our commands, did not have a page among our docs. --- website/docs/commands/version.html.markdown | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 website/docs/commands/version.html.markdown diff --git a/website/docs/commands/version.html.markdown b/website/docs/commands/version.html.markdown new file mode 100644 index 000000000..5ee38419e --- /dev/null +++ b/website/docs/commands/version.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "docs" +page_title: "Command: version" +sidebar_current: "docs-commands-version" +description: |- + The `terraform version` command displays the version of Terraform and all installed plugins. +--- + +# Command: version + +The `terraform version` displays the current version of Terraform and all +installed plugins. + +## Usage + +Usage: `terraform version [options]` + +With no additional arguments, `version` will display the version of Terraform, +the platform it's installed on, installed providers, and the results of upgrade +and security checks [unless disabled](/docs/commands/index.html#upgrade-and-security-bulletin-checks). + +This command has one optional flag: + +* `-json` - If specified, the version information is formatted as a JSON object, + and no upgrade or security information is included. + +-> **Note:** Platform information was added to the `version` command in Terraform 0.15. + +## Example + +Basic usage, with upgrade and security information shown if relevant: + +```shellsession +$ terraform version +Terraform v0.15.0 +on darwin_amd64 ++ provider registry.terraform.io/hashicorp/null v3.0.0 + +Your version of Terraform is out of date! The latest version +is X.Y.Z. You can update by downloading from https://www.terraform.io/downloads.html +``` + +As JSON: + +```shellsession +$ terraform version -json +{ + "terraform_version": "0.15.0", + "platform": "darwin_amd64", + "provider_selections": { + "registry.terraform.io/hashicorp/null": "3.0.0" + }, + "terraform_outdated": true +} +``` \ No newline at end of file From ccb205896d60dc0ed41f629ccb0f82ed896332c4 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 12 Jan 2021 14:34:45 -0800 Subject: [PATCH 2/3] website: Fix alphabetical ordering of commands --- website/layouts/docs.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/layouts/docs.erb b/website/layouts/docs.erb index 48348e688..fc74f5a27 100644 --- a/website/layouts/docs.erb +++ b/website/layouts/docs.erb @@ -462,11 +462,11 @@
  • - validate + untaint
  • - untaint + validate
  • From 66f2c82d3347826fabb01a17585b0b4c02f0f07a Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 12 Jan 2021 14:40:45 -0800 Subject: [PATCH 3/3] website: Add version command to sidebar nav and to plugins overview page --- website/docs/cli/plugins/index.html.md | 4 ++++ website/layouts/docs.erb | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/website/docs/cli/plugins/index.html.md b/website/docs/cli/plugins/index.html.md index 0dce9f6c0..bae835eea 100644 --- a/website/docs/cli/plugins/index.html.md +++ b/website/docs/cli/plugins/index.html.md @@ -37,6 +37,10 @@ more information, see [CLI Config File](/docs/commands/cli-config.html). Use the [`terraform providers`](/docs/commands/providers.html) command to get information about the providers required by the current working directory's configuration. +Use the [`terraform version`](/docs/commands/version.html) command (or +`terraform -version`) to show the specific provider versions installed for the +current working directory. + Use the [`terraform providers schema`](/docs/commands/providers/schema.html) command to get machine-readable information about the resources and configuration options offered by each provider. diff --git a/website/layouts/docs.erb b/website/layouts/docs.erb index fc74f5a27..67e1aefc1 100644 --- a/website/layouts/docs.erb +++ b/website/layouts/docs.erb @@ -291,6 +291,10 @@ providers
  • +
  • + version +
  • +
  • providers lock
  • @@ -469,6 +473,10 @@ validate +
  • + version +
  • +
  • workspace list