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
|
2022-08-09 23:42:18 -07:00
|
|
|
This requires a terraform binary in your PATH and will only show in directories that contain a `.terraform` subdirectory.
|
2020-11-28 01:25:35 -08:00
|
|
|
:::
|
2020-10-16 07:25:38 -07:00
|
|
|
|
|
|
|
## Sample Configuration
|
|
|
|
|
2023-03-31 11:55:36 -07:00
|
|
|
import Config from '@site/src/components/Config.js';
|
|
|
|
|
|
|
|
<Config data={{
|
2020-10-16 07:25:38 -07:00
|
|
|
"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}}"
|
2023-03-31 11:55:36 -07:00
|
|
|
}}/>
|
2021-11-20 02:14:26 -08:00
|
|
|
|
2022-02-09 05:31:51 -08:00
|
|
|
## Properties
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
| Name | Type | Description |
|
|
|
|
| --------------- | --------- | ---------------------------------------------------------------------------------- |
|
|
|
|
| `fetch_version` | `boolean` | fetch the version information from `versions.tf`, `main.tf` or `terraform.tfstate` |
|
|
|
|
|
2022-02-09 05:31:51 -08:00
|
|
|
defaults to `false`
|
|
|
|
|
2022-02-01 03:10:46 -08:00
|
|
|
## Template ([info][templates])
|
|
|
|
|
|
|
|
:::note default template
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
```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
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ---------------- | -------- | ------------------------------------------------- |
|
|
|
|
| `.WorkspaceName` | `string` | is the current workspace name |
|
|
|
|
| `.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
|