2020-10-16 07:25:38 -07:00
|
|
|
---
|
|
|
|
id: terraform
|
|
|
|
title: Terraform Context
|
|
|
|
sidebar_label: Terraform
|
|
|
|
---
|
|
|
|
|
|
|
|
## What
|
|
|
|
|
|
|
|
Display the currently active Terraform Workspace name.
|
|
|
|
|
2021-09-01 04:45:33 -07:00
|
|
|
:::caution
|
2020-11-28 01:25:35 -08:00
|
|
|
This requires a terraform binary in your PATH and will only show in directories that contain a `.terraform` subdirectory
|
|
|
|
:::
|
2020-10-16 07:25:38 -07:00
|
|
|
|
|
|
|
## Sample Configuration
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "terraform",
|
|
|
|
"style": "powerline",
|
|
|
|
"powerline_symbol": "\uE0B0",
|
|
|
|
"foreground": "#000000",
|
2021-11-20 02:14:26 -08:00
|
|
|
"background": "#ebcc34",
|
2022-03-27 01:12:47 -07:00
|
|
|
"template": "{{.WorkspaceName}}"
|
2020-10-16 07:25:38 -07:00
|
|
|
}
|
|
|
|
```
|
2021-11-20 02:14:26 -08:00
|
|
|
|
2022-02-09 05:31:51 -08:00
|
|
|
## Properties
|
|
|
|
|
|
|
|
- fetch_version: `boolean` - fetch the version information from `versions.tf`, `main.tf` or `terraform.tfstate` -
|
|
|
|
defaults to `false`
|
|
|
|
|
2022-02-01 03:10:46 -08:00
|
|
|
## Template ([info][templates])
|
|
|
|
|
|
|
|
:::note default template
|
|
|
|
|
|
|
|
``` template
|
2022-02-09 05:31:51 -08:00
|
|
|
{{ .WorkspaceName }}{{ if .Version }} {{ .Version }}{{ end }}
|
2022-02-01 03:10:46 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
### Properties
|
2021-11-20 02:14:26 -08:00
|
|
|
|
|
|
|
- `.WorkspaceName`: `string` - is the current workspace name
|
2022-02-09 05:31:51 -08:00
|
|
|
- `.Version`: `string` - terraform version (set `fetch_version` to `true`)
|
2022-01-22 10:46:56 -08:00
|
|
|
|
2022-04-20 09:43:59 -07:00
|
|
|
[templates]: /docs/configuration/templates
|