2021-01-12 23:06:53 +01:00
|
|
|
---
|
2021-11-23 00:47:36 +01:00
|
|
|
page_title: 'Command: version'
|
|
|
|
description: >-
|
|
|
|
The terraform version command displays the Terraform version and the version
|
|
|
|
of all installed plugins.
|
2021-01-12 23:06:53 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# 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
|
2021-11-23 00:47:36 +01:00
|
|
|
and security checks [unless disabled](/cli/commands/#upgrade-and-security-bulletin-checks).
|
2021-01-12 23:06:53 +01:00
|
|
|
|
|
|
|
This command has one optional flag:
|
|
|
|
|
2021-07-30 17:16:08 +02:00
|
|
|
* `-json` - If specified, the version information is formatted as a JSON object,
|
2021-11-23 00:47:36 +01:00
|
|
|
and no upgrade or security information is included.
|
2021-01-12 23:06:53 +01:00
|
|
|
|
2021-07-30 17:16:08 +02:00
|
|
|
-> **Note:** Platform information was added to the `version` command in Terraform 0.15.
|
2021-01-12 23:06:53 +01:00
|
|
|
|
|
|
|
## 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
|
|
|
|
}
|
2021-11-23 00:47:36 +01:00
|
|
|
```
|