Skip to content

Commit 90cc280

Browse files
authored
Adding a new variable page, getting rid of the old one, and fixing links! (#489)
2 parents 0e939ee + 773a104 commit 90cc280

35 files changed

+591
-782
lines changed

content/terraform/v1.12.x/data/language-nav-data.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"title": "Variables and Outputs",
211211
"routes": [
212212
{ "title": "Overview", "path": "values" },
213-
{ "title": "Input Variables", "path": "values/variables" },
213+
{ "title": "Variable block", "href": "/terraform/language/block/variable" },
214214
{ "title": "Output block", "href": "/terraform/language/block/output" },
215215
{ "title": "Local Values", "path": "values/locals" }
216216
]
@@ -1142,6 +1142,10 @@
11421142
{
11431143
"title": "Terraform block",
11441144
"path": "block/terraform"
1145+
},
1146+
{
1147+
"title": "Variable block",
1148+
"path": "block/variable"
11451149
}
11461150
]
11471151
},

content/terraform/v1.12.x/docs/cli/commands/import.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ The command-line flags are all optional. The following flags are available:
6767
can be set multiple times. Variable values are interpreted as
6868
[literal expressions](/terraform/language/expressions/types) in the
6969
Terraform language, so list and map values can be specified via this flag.
70-
70+
<!-- TODO: add link to new variable usage page once done -->
7171
- `-var-file=foo` - Set variables in the Terraform configuration from
72-
a [variable file](/terraform/language/values/variables#variable-definitions-tfvars-files). If
72+
a [variable file](/terraform/language/block/variable#variable-definitions-tfvars-files). If
7373
`terraform.tfvars` or any `.auto.tfvars` files are present in the current
74-
directory, they are automatically loaded. Terraform loads `terraform.tfvars`
74+
directory, they are automatically loaded. Terraform loads `terraform.tfvars`
7575
first and the `.auto.tfvars` files after in alphabetical order. Any files
7676
specified by `-var-file` override any values set automatically from files in
7777
the working directory. This flag can be used multiple times. This is only

content/terraform/v1.12.x/docs/cli/commands/plan.mdx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ description: >-
55
changes that Terraform will make to your infrastructure.
66
---
77

8-
# `terraform plan` command
8+
# `terraform plan` command
99

1010
The `terraform plan` command creates an execution plan, which lets you preview
11-
the changes that Terraform plans to make to your infrastructure.
11+
the changes that Terraform plans to make to your infrastructure.
1212

1313
## Introduction
1414
By default, Terraform performs the following operations when it creates a plan:
@@ -138,25 +138,25 @@ In addition to alternate [planning modes](#planning-modes), there are several op
138138
-> **Note:** Use `-target=ADDRESS` in exceptional circumstances only, such as recovering from mistakes or working around Terraform limitations. Refer to [Resource Targeting](#resource-targeting) for more details.
139139

140140
- `-var 'NAME=VALUE'` - Sets a value for a single
141-
[input variable](/terraform/language/values/variables) declared in the
141+
[input variable](/terraform/language/block/variable) declared in the
142142
root module of the configuration. Use this option multiple times to set
143143
more than one variable. Refer to
144144
[Input Variables on the Command Line](#input-variables-on-the-command-line) for more information.
145-
145+
<!-- TODO: add link to new variable usage page once done -->
146146
- `-var-file=FILENAME` - Sets values for potentially many
147-
[input variables](/terraform/language/values/variables) declared in the
147+
[input variables](/terraform/language/block/variable) declared in the
148148
root module of the configuration, using definitions from a
149-
["tfvars" file](/terraform/language/values/variables#variable-definitions-tfvars-files).
149+
["tfvars" file](/terraform/language/block/variable#variable-definitions-tfvars-files).
150150
Use this option multiple times to include values from more than one file.
151-
151+
<!-- TODO: add link to new variable usage page once done -->
152152
There are several other ways to set values for input variables in the root
153153
module, aside from the `-var` and `-var-file` options. Refer to
154-
[Assigning Values to Root Module Variables](/terraform/language/values/variables#assigning-values-to-root-module-variables) for more information.
154+
[Assigning Values to Root Module Variables](/terraform/language/block/variable#assigning-values-to-root-module-variables) for more information.
155155

156156
### Input Variables on the Command Line
157157

158158
You can use the `-var` command line option to specify values for
159-
[input variables](/terraform/language/values/variables) declared in your
159+
[input variables](/terraform/language/block/variable) declared in your
160160
root module.
161161

162162
However, to do so will require writing a command line that is parsable both
@@ -222,10 +222,11 @@ terraform plan -var 'name=["a", "b", "c"]'
222222
terraform plan -var "name=[\"a\", \"b\", \"c\"]"
223223
```
224224

225+
<!-- TODO: add link to new variable usage page once done -->
225226
Similar constraints apply when setting input variables using environment
226227
variables. For more information on the various methods for setting root module
227228
input variables, see
228-
[Assigning Values to Root Module Variables](/terraform/language/values/variables#assigning-values-to-root-module-variables).
229+
[Assigning Values to Root Module Variables](/terraform/language/block/variable#assigning-values-to-root-module-variables).
229230

230231
### Resource Targeting
231232

content/terraform/v1.12.x/docs/cli/config/environment-variables.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
page_title: Terraform CLI environment variables reference
33
description: >-
4-
Terraform environment variables let you customize the Terraform CLI's default behavior.
4+
Terraform environment variables let you customize the Terraform CLI's default behavior.
55
Learn about the Terraform CLI environment variables.
66
---
77

@@ -61,7 +61,8 @@ export TF_VAR_alist='[1,2,3]'
6161
export TF_VAR_amap='{ foo = "bar", baz = "qux" }'
6262
```
6363

64-
For more on how to use `TF_VAR_name` in context, check out the section on [Variable Configuration](/terraform/language/values/variables).
64+
<!-- TODO: add link to new variable usage page once done -->
65+
For more on how to use `TF_VAR_name` in context, check out the section on [Variable Configuration](/terraform/language/block/variable).
6566

6667
## TF_CLI_ARGS and TF_CLI_ARGS_name
6768

content/terraform/v1.12.x/docs/cli/workspaces/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Use the [`terraform workspace list`](/terraform/cli/commands/workspace/list), [`
2121

2222
Use [the `terraform workspace select` command](/terraform/cli/commands/workspace/select) to change the currently selected workspace. For a given working directory, you can only select one workspace at a time. Most Terraform commands only interact with the currently selected workspace. This includes [provisioning](/terraform/cli/run) and [state manipulation](/terraform/cli/state).
2323

24-
When you provision infrastructure in each workspace, you usually need to manually specify different [input variables](/terraform/language/values/variables) to differentiate each collection. For example, you might deploy test infrastructure to a different region.
24+
When you provision infrastructure in each workspace, you usually need to manually specify different [input variables](/terraform/language/block/variable) to differentiate each collection. For example, you might deploy test infrastructure to a different region.
2525

2626

2727
## Use Cases

content/terraform/v1.12.x/docs/language/block/output.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Passing output values between child modules and the root module is useful for ma
158158
The following ephemeral contexts can set values for output blocks with the `ephemeral` argument, and they can also reference output blocks with the `ephemeral` argument:
159159
- Another child module's ephemeral `output` block
160160
- A [write-only argument](/terraform/language/resources/ephemeral/write-only)
161-
- [Variables with the `ephemeral` argument](/terraform/language/values/variables#exclude-values-from-state)
161+
- [Variables with the `ephemeral` argument](/terraform/language/block/variable#ephemeral)
162162
- [An `ephemeral` resource block](/terraform/language/resources/ephemeral)
163163
- Configuring providers in the [`provider` block](/terraform/language/providers)
164164
- In [provisioner](/terraform/language/resources/provisioners/syntax) and [connection](/terraform/language/resources/provisioners/connection) blocks

0 commit comments

Comments
 (0)