diff --git a/content/terraform/v1.12.x/data/language-nav-data.json b/content/terraform/v1.12.x/data/language-nav-data.json index b1efdcd7c..bf523e93d 100644 --- a/content/terraform/v1.12.x/data/language-nav-data.json +++ b/content/terraform/v1.12.x/data/language-nav-data.json @@ -210,7 +210,7 @@ "title": "Variables and Outputs", "routes": [ { "title": "Overview", "path": "values" }, - { "title": "Input Variables", "path": "values/variables" }, + { "title": "Variable block", "href": "/terraform/language/block/variable" }, { "title": "Output block", "href": "/terraform/language/block/output" }, { "title": "Local Values", "path": "values/locals" } ] @@ -1142,6 +1142,10 @@ { "title": "Terraform block", "path": "block/terraform" + }, + { + "title": "Variable block", + "path": "block/variable" } ] }, diff --git a/content/terraform/v1.12.x/docs/cli/commands/import.mdx b/content/terraform/v1.12.x/docs/cli/commands/import.mdx index c3097e739..003a392b6 100644 --- a/content/terraform/v1.12.x/docs/cli/commands/import.mdx +++ b/content/terraform/v1.12.x/docs/cli/commands/import.mdx @@ -67,11 +67,11 @@ The command-line flags are all optional. The following flags are available: can be set multiple times. Variable values are interpreted as [literal expressions](/terraform/language/expressions/types) in the Terraform language, so list and map values can be specified via this flag. - + - `-var-file=foo` - Set variables in the Terraform configuration from - a [variable file](/terraform/language/values/variables#variable-definitions-tfvars-files). If + a [variable file](/terraform/language/block/variable#variable-definitions-tfvars-files). If `terraform.tfvars` or any `.auto.tfvars` files are present in the current - directory, they are automatically loaded. Terraform loads `terraform.tfvars` + directory, they are automatically loaded. Terraform loads `terraform.tfvars` first and the `.auto.tfvars` files after in alphabetical order. Any files specified by `-var-file` override any values set automatically from files in the working directory. This flag can be used multiple times. This is only diff --git a/content/terraform/v1.12.x/docs/cli/commands/plan.mdx b/content/terraform/v1.12.x/docs/cli/commands/plan.mdx index 7cbbcf6fa..770c1d2e0 100644 --- a/content/terraform/v1.12.x/docs/cli/commands/plan.mdx +++ b/content/terraform/v1.12.x/docs/cli/commands/plan.mdx @@ -5,10 +5,10 @@ description: >- changes that Terraform will make to your infrastructure. --- -# `terraform plan` command +# `terraform plan` command The `terraform plan` command creates an execution plan, which lets you preview -the changes that Terraform plans to make to your infrastructure. +the changes that Terraform plans to make to your infrastructure. ## Introduction 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 -> **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. - `-var 'NAME=VALUE'` - Sets a value for a single - [input variable](/terraform/language/values/variables) declared in the + [input variable](/terraform/language/block/variable) declared in the root module of the configuration. Use this option multiple times to set more than one variable. Refer to [Input Variables on the Command Line](#input-variables-on-the-command-line) for more information. - + - `-var-file=FILENAME` - Sets values for potentially many - [input variables](/terraform/language/values/variables) declared in the + [input variables](/terraform/language/block/variable) declared in the root module of the configuration, using definitions from a - ["tfvars" file](/terraform/language/values/variables#variable-definitions-tfvars-files). + ["tfvars" file](/terraform/language/block/variable#variable-definitions-tfvars-files). Use this option multiple times to include values from more than one file. - + There are several other ways to set values for input variables in the root module, aside from the `-var` and `-var-file` options. Refer to -[Assigning Values to Root Module Variables](/terraform/language/values/variables#assigning-values-to-root-module-variables) for more information. +[Assigning Values to Root Module Variables](/terraform/language/block/variable#assigning-values-to-root-module-variables) for more information. ### Input Variables on the Command Line You can use the `-var` command line option to specify values for -[input variables](/terraform/language/values/variables) declared in your +[input variables](/terraform/language/block/variable) declared in your root module. 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"]' terraform plan -var "name=[\"a\", \"b\", \"c\"]" ``` + Similar constraints apply when setting input variables using environment variables. For more information on the various methods for setting root module input variables, see -[Assigning Values to Root Module Variables](/terraform/language/values/variables#assigning-values-to-root-module-variables). +[Assigning Values to Root Module Variables](/terraform/language/block/variable#assigning-values-to-root-module-variables). ### Resource Targeting diff --git a/content/terraform/v1.12.x/docs/cli/config/environment-variables.mdx b/content/terraform/v1.12.x/docs/cli/config/environment-variables.mdx index 70144c6fd..69c3b3565 100644 --- a/content/terraform/v1.12.x/docs/cli/config/environment-variables.mdx +++ b/content/terraform/v1.12.x/docs/cli/config/environment-variables.mdx @@ -1,7 +1,7 @@ --- page_title: Terraform CLI environment variables reference description: >- - Terraform environment variables let you customize the Terraform CLI's default behavior. + Terraform environment variables let you customize the Terraform CLI's default behavior. Learn about the Terraform CLI environment variables. --- @@ -61,7 +61,8 @@ export TF_VAR_alist='[1,2,3]' export TF_VAR_amap='{ foo = "bar", baz = "qux" }' ``` -For more on how to use `TF_VAR_name` in context, check out the section on [Variable Configuration](/terraform/language/values/variables). + +For more on how to use `TF_VAR_name` in context, check out the section on [Variable Configuration](/terraform/language/block/variable). ## TF_CLI_ARGS and TF_CLI_ARGS_name diff --git a/content/terraform/v1.12.x/docs/cli/workspaces/index.mdx b/content/terraform/v1.12.x/docs/cli/workspaces/index.mdx index 3baca17bd..3252ce8d2 100644 --- a/content/terraform/v1.12.x/docs/cli/workspaces/index.mdx +++ b/content/terraform/v1.12.x/docs/cli/workspaces/index.mdx @@ -21,7 +21,7 @@ Use the [`terraform workspace list`](/terraform/cli/commands/workspace/list), [` 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). -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. +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. ## Use Cases diff --git a/content/terraform/v1.12.x/docs/language/block/output.mdx b/content/terraform/v1.12.x/docs/language/block/output.mdx index c2f3f217b..b8b192ce1 100644 --- a/content/terraform/v1.12.x/docs/language/block/output.mdx +++ b/content/terraform/v1.12.x/docs/language/block/output.mdx @@ -158,7 +158,7 @@ Passing output values between child modules and the root module is useful for ma 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: - Another child module's ephemeral `output` block - A [write-only argument](/terraform/language/resources/ephemeral/write-only) -- [Variables with the `ephemeral` argument](/terraform/language/values/variables#exclude-values-from-state) +- [Variables with the `ephemeral` argument](/terraform/language/block/variable#ephemeral) - [An `ephemeral` resource block](/terraform/language/resources/ephemeral) - Configuring providers in the [`provider` block](/terraform/language/providers) - In [provisioner](/terraform/language/resources/provisioners/syntax) and [connection](/terraform/language/resources/provisioners/connection) blocks diff --git a/content/terraform/v1.12.x/docs/language/block/resource.mdx b/content/terraform/v1.12.x/docs/language/block/resource.mdx index 931c92cb0..28405f94b 100644 --- a/content/terraform/v1.12.x/docs/language/block/resource.mdx +++ b/content/terraform/v1.12.x/docs/language/block/resource.mdx @@ -62,7 +62,7 @@ The `resource` block supports the following arguments: - [`provisioner ""`](#provisioner)   block - [`source`](#source)   string - [`destination`](#destination)   string - - [`content`](#content)   string + - [`content`](#content)   string - [`command`](#command)   string - [`working_dir`](#working_dir)   string - [`interpreter`](#interpreter)   string @@ -82,13 +82,13 @@ The following `resource` block defines all of the supported built-in arguments y ```hcl resource "" "