Merge pull request #27486 from hashicorp/pselle/version-doc

Add documentation page for version
This commit is contained in:
Pam Selle 2021-01-13 12:44:11 -05:00 committed by GitHub
commit 61f9d2177b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 1 deletions

View File

@ -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.

View File

@ -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
}
```

View File

@ -291,6 +291,10 @@
<a href="/docs/commands/providers.html"><code>providers</code></a>
</li>
<li>
<a href="/docs/commands/version.html"><code>version</code></a>
</li>
<li>
<a href="/docs/commands/providers/lock.html"><code>providers lock</code></a>
</li>
@ -461,12 +465,16 @@
<a href="/docs/commands/taint.html"><code>taint</code></a>
</li>
<li>
<a href="/docs/commands/untaint.html"><code>untaint</code></a>
</li>
<li>
<a href="/docs/commands/validate.html"><code>validate</code></a>
</li>
<li>
<a href="/docs/commands/untaint.html"><code>untaint</code></a>
<a href="/docs/commands/version.html"><code>version</code></a>
</li>
<li>