website: Language: Update links to moved pages
This commit is contained in:
parent
78dcc8dc1b
commit
7a8dd326c6
|
@ -129,7 +129,7 @@ the reinitialization process, Terraform will ask if you'd like to migrate
|
|||
your existing state to the new configuration. This allows you to easily
|
||||
switch from one backend to another.
|
||||
|
||||
If you're using multiple [workspaces](/docs/state/workspaces.html),
|
||||
If you're using multiple [workspaces](/docs/language/state/workspaces.html),
|
||||
Terraform can copy all workspaces to the destination. If Terraform detects
|
||||
you have multiple workspaces, it will ask if this is what you want to do.
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ these by calling a backend either **standard** or **enhanced**. All backends
|
|||
must implement **standard** functionality. These are defined below:
|
||||
|
||||
* **Standard**: State management, functionality covered in
|
||||
[State Storage & Locking](/docs/backends/state.html)
|
||||
[State Storage & Locking](/docs/language/state/backends.html)
|
||||
|
||||
* **Enhanced**: Everything in standard plus
|
||||
[remote operations](/docs/backends/operations.html).
|
||||
|
|
|
@ -17,4 +17,4 @@ Cloud or Terraform Enterprise.
|
|||
|
||||
Notably, this documentation does not cover the syntax and usage of the Terraform
|
||||
language. For that, see the
|
||||
[Terraform Language Documentation](/docs/configuration/index.html).
|
||||
[Terraform Language Documentation](/docs/language/index.html).
|
||||
|
|
|
@ -5,7 +5,7 @@ page_title: "Writing and Modifying Code - Terraform CLI"
|
|||
|
||||
# Writing and Modifying Terraform Code
|
||||
|
||||
The [Terraform language](/docs/configuration/index.html) is Terraform's primary
|
||||
The [Terraform language](/docs/language/index.html) is Terraform's primary
|
||||
user interface, and all of Terraform's workflows rely on configurations written
|
||||
in the Terraform language.
|
||||
|
||||
|
@ -15,7 +15,7 @@ potentially save you time and effort.
|
|||
|
||||
- [The `terraform console` command](/docs/commands/console.html) starts an
|
||||
interactive shell for evaluating Terraform
|
||||
[expressions](/docs/configuration/expressions/index.html), which can be a faster way
|
||||
[expressions](/docs/language/expressions/index.html), which can be a faster way
|
||||
to verify that a particular resource argument results in the value you expect.
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ page_title: "Initializing Working Directories - Terraform CLI"
|
|||
|
||||
Terraform expects to be invoked from a working directory that contains
|
||||
configuration files written in
|
||||
[the Terraform language](/docs/configuration/index.html). Terraform uses
|
||||
[the Terraform language](/docs/language/index.html). Terraform uses
|
||||
configuration content from this directory, and also uses the directory to store
|
||||
settings, cached plugins and modules, and sometimes state data.
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ or just to gain a deeper or more holistic understanding of your infrastructure.
|
|||
- [The `terraform graph` command](/docs/commands/graph.html) creates a visual
|
||||
representation of a configuration or a set of planned changes.
|
||||
- [The `terraform output` command](/docs/commands/output.html) can get the
|
||||
values for the top-level [output values](/docs/configuration/outputs.html) of
|
||||
values for the top-level [output values](/docs/language/values/outputs.html) of
|
||||
a configuration, which are often helpful when making use of the infrastructure
|
||||
Terraform has provisioned.
|
||||
- [The `terraform show` command](/docs/commands/show.html) can generate
|
||||
|
|
|
@ -7,7 +7,7 @@ page_title: "Managing Plugins - Terraform CLI"
|
|||
|
||||
Terraform relies on plugins called "providers" in order to manage various types
|
||||
of resources. (For more information about providers, see
|
||||
[Providers](/docs/configuration/blocks/providers/index.html) in the Terraform
|
||||
[Providers](/docs/language/providers/index.html) in the Terraform
|
||||
language docs.)
|
||||
|
||||
-> **Note:** Providers are currently the only plugin type most Terraform users
|
||||
|
@ -15,7 +15,7 @@ will interact with. Terraform also supports third-party provisioner plugins, but
|
|||
we discourage their use.
|
||||
|
||||
Terraform downloads and/or installs any providers
|
||||
[required](/docs/configuration/provider-requirements.html) by a configuration
|
||||
[required](/docs/language/providers/requirements.html) by a configuration
|
||||
when [initializing](/docs/cli/init/index.html) a working directory. By default,
|
||||
this works without any additional interaction but requires network access to
|
||||
download providers from their source registry.
|
||||
|
|
|
@ -7,7 +7,7 @@ page_title: "Provisioning Infrastructure - Terraform CLI"
|
|||
|
||||
Terraform's primary function is to create, modify, and destroy infrastructure
|
||||
resources to match the desired state described in a
|
||||
[Terraform configuration](/docs/configuration/index.html).
|
||||
[Terraform configuration](/docs/language/index.html).
|
||||
|
||||
When people refer to "running Terraform," they generally mean performing these
|
||||
provisioning actions in order to affect real infrastructure objects. The
|
||||
|
|
|
@ -5,7 +5,7 @@ page_title: "Manipulating State - Terraform CLI"
|
|||
|
||||
# Manipulating Terraform State
|
||||
|
||||
Terraform uses [state data](/docs/state/index.html) to remember which
|
||||
Terraform uses [state data](/docs/language/state/index.html) to remember which
|
||||
real-world object corresponds to each resource in the configuration;
|
||||
this allows it to modify an existing object when its resource declaration
|
||||
changes.
|
||||
|
|
|
@ -22,4 +22,4 @@ configuration changes.
|
|||
|
||||
- [The `terraform untaint` command](/docs/commands/untaint.html) undoes a
|
||||
previous taint, or can preserve a resource that was automatically tainted due
|
||||
to failed [provisioners](/docs/provisioners/index.html).
|
||||
to failed [provisioners](/docs/language/resources/provisioners/syntax.html).
|
||||
|
|
|
@ -6,7 +6,7 @@ page_title: "Managing Workspaces - Terraform CLI"
|
|||
# Managing Workspaces
|
||||
|
||||
In Terraform CLI, _workspaces_ are separate instances of
|
||||
[state data](/docs/state/index.html) that can be used from the same working
|
||||
[state data](/docs/language/state/index.html) that can be used from the same working
|
||||
directory. You can use workspaces to manage multiple non-overlapping groups of
|
||||
resources with the same configuration.
|
||||
|
||||
|
@ -34,11 +34,11 @@ Since most of the resources you can manage with Terraform don't include a unique
|
|||
name as part of their configuration, it's common to use the same Terraform
|
||||
configuration to provision multiple groups of similar resources.
|
||||
|
||||
Terraform relies on [state](/docs/state/index.html) to associate resources with
|
||||
Terraform relies on [state](/docs/language/state/index.html) to associate resources with
|
||||
real-world objects, so if you run the same configuration multiple times with
|
||||
completely separate state data, Terraform can manage many non-overlapping groups
|
||||
of resources. In some cases you'll want to change
|
||||
[variable values](/docs/configuration/variables.html) for these different
|
||||
[variable values](/docs/language/values/variables.html) for these different
|
||||
resource collections (like when specifying differences between staging and
|
||||
production deployments), and in other cases you might just want many instances
|
||||
of a particular infrastructure pattern.
|
||||
|
@ -46,7 +46,7 @@ of a particular infrastructure pattern.
|
|||
The simplest way to maintain multiple instances of a configuration with
|
||||
completely separate state data is to use multiple
|
||||
[working directories](/docs/cli/init/index.html) (with different
|
||||
[backend](/docs/configuration/backend.html) configurations per directory, if you
|
||||
[backend](/docs/language/settings/backends/configuration.html) configurations per directory, if you
|
||||
aren't using the default `local` backend).
|
||||
|
||||
However, this isn't always the most _convenient_ way to handle separate states.
|
||||
|
@ -70,7 +70,7 @@ data, run history, and settings.
|
|||
These two kinds of workspaces are different, but related. When using Terraform
|
||||
CLI as a frontend for Terraform Cloud, you associate the current working
|
||||
directory with one or more remote workspaces by configuring
|
||||
[the `remote` backend](/docs/backends/types/remote.html). If you associate the
|
||||
[the `remote` backend](/docs/language/settings/backends/remote.html). If you associate the
|
||||
directory with multiple workspaces (using a name prefix), you can use the
|
||||
`terraform workspace` commands to select which remote workspace to use.
|
||||
|
||||
|
|
|
@ -71,13 +71,13 @@ the change.
|
|||
Once upgraded the configuration will no longer be compatible with Terraform
|
||||
v0.11 and earlier. When upgrading a shared module that is called from multiple
|
||||
configurations, you may need to
|
||||
[fix existing configurations to a previous version](/docs/configuration/blocks/modules/syntax.html#version)
|
||||
[fix existing configurations to a previous version](/docs/language/modules/syntax.html#version)
|
||||
to allow for a gradual upgrade. If the module is published via
|
||||
[a Terraform registry](/docs/registry/), assign a new _major_ version number
|
||||
to the upgraded module source to represent the fact that this is a breaking
|
||||
change for v0.11 callers. If a module is installed directly from a version
|
||||
control system such as Git,
|
||||
[use specific revisions](https://www.terraform.io/docs/modules/sources.html#selecting-a-revision)
|
||||
[use specific revisions](https://www.terraform.io/docs/language/modules/sources.html#selecting-a-revision)
|
||||
to control which version is used by which caller.
|
||||
|
||||
The command-line options are all optional. The available options are:
|
||||
|
|
|
@ -23,7 +23,7 @@ providers are in use for a module, detect the source address for those
|
|||
providers where possible, and record this information in a
|
||||
[`required_providers` block][required-providers].
|
||||
|
||||
[required-providers]: /docs/configuration/provider-requirements.html
|
||||
[required-providers]: /docs/language/providers/requirements.html
|
||||
|
||||
~> Note: the command ignores `.tf.json` files and override files in the module.
|
||||
|
||||
|
|
|
@ -56,14 +56,14 @@ The command-line flags are all optional. The list of available flags are:
|
|||
apply.
|
||||
|
||||
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used. This setting
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used. This setting
|
||||
does not persist and other commands, such as init, may not be aware of the
|
||||
alternate statefile. To configure an alternate statefile path which is
|
||||
available to all terraform commands, use the [local backend](/docs/backends/types/local.html).
|
||||
available to all terraform commands, use the [local backend](/docs/language/settings/backends/local.html).
|
||||
|
||||
* `-state-out=path` - Path to write updated state file. By default, the
|
||||
`-state` path will be used. Ignored when
|
||||
[remote state](/docs/state/remote.html) is used.
|
||||
[remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-target=resource` - A [Resource
|
||||
Address](/docs/internals/resource-addressing.html) to target. For more
|
||||
|
@ -72,11 +72,11 @@ The command-line flags are all optional. The list of available flags are:
|
|||
|
||||
* `-var 'foo=bar'` - Set a variable in the Terraform configuration. This flag
|
||||
can be set multiple times. Variable values are interpreted as
|
||||
[literal expressions](/docs/configuration/expressions/types.html) in the
|
||||
[literal expressions](/docs/language/expressions/types.html) 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](/docs/configuration/variables.html#variable-definitions-tfvars-files). If
|
||||
a [variable file](/docs/language/values/variables.html#variable-definitions-tfvars-files). If
|
||||
a `terraform.tfvars` or any `.auto.tfvars` files are present in the current
|
||||
directory, they will be automatically loaded. `terraform.tfvars` is loaded
|
||||
first and the `.auto.tfvars` files after in alphabetical order. Any files
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
|
||||
The CLI configuration file configures per-user settings for CLI behaviors,
|
||||
which apply across all Terraform working directories. This is separate from
|
||||
[your infrastructure configuration](/docs/configuration/index.html).
|
||||
[your infrastructure configuration](/docs/language/index.html).
|
||||
|
||||
## Location
|
||||
|
||||
|
@ -394,7 +394,7 @@ provider_installation {
|
|||
With development overrides in effect, the `terraform init` command will still
|
||||
attempt to select a suitable published version of your provider to install and
|
||||
record in
|
||||
[the dependency lock file](/docs/configuration/dependency-lock.html)
|
||||
[the dependency lock file](/docs/language/dependency-lock.html)
|
||||
for future use, but other commands like
|
||||
`terraform apply` will disregard the lock file's entry for `hashicorp/null` and
|
||||
will use the given directory instead. Once your new changes are included in a
|
||||
|
|
|
@ -10,27 +10,27 @@ description: |-
|
|||
# Command: console
|
||||
|
||||
The `terraform console` command provides an interactive console for
|
||||
evaluating [expressions](/docs/configuration/expressions/index.html).
|
||||
evaluating [expressions](/docs/language/expressions/index.html).
|
||||
|
||||
## Usage
|
||||
|
||||
Usage: `terraform console [options]`
|
||||
|
||||
This command provides an interactive command-line console for evaluating and
|
||||
experimenting with [expressions](/docs/configuration/expressions/index.html).
|
||||
experimenting with [expressions](/docs/language/expressions/index.html).
|
||||
This is useful for testing interpolations before using them in configurations,
|
||||
and for interacting with any values currently saved in
|
||||
[state](/docs/state/index.html).
|
||||
[state](/docs/language/state/index.html).
|
||||
|
||||
If the current state is empty or has not yet been created, the console can be
|
||||
used to experiment with the expression syntax and
|
||||
[built-in functions](/docs/configuration/functions.html).
|
||||
[built-in functions](/docs/language/functions/index.html).
|
||||
|
||||
The supported options are:
|
||||
|
||||
* `-state=path` - Path to a local state file. Expressions will be evaluated
|
||||
using values from this state file. If not specified, the state associated
|
||||
with the current [workspace](/docs/state/workspaces.html) is used.
|
||||
with the current [workspace](/docs/language/state/workspaces.html) is used.
|
||||
|
||||
You can close the console with the `exit` command or by pressing Control-C
|
||||
or Control-D.
|
||||
|
@ -50,6 +50,6 @@ $ echo "1 + 5" | terraform console
|
|||
|
||||
## Remote State
|
||||
|
||||
If [remote state](/docs/state/remote.html) is used by the current backend,
|
||||
If [remote state](/docs/language/state/remote.html) is used by the current backend,
|
||||
Terraform will read the state for the current workspace from the backend
|
||||
before evaluating any expressions.
|
||||
|
|
|
@ -59,7 +59,7 @@ 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](/docs/configuration/variables.html).
|
||||
For more on how to use `TF_VAR_name` in context, check out the section on [Variable Configuration](/docs/language/values/variables.html).
|
||||
|
||||
## TF_CLI_ARGS and TF_CLI_ARGS_name
|
||||
|
||||
|
@ -114,7 +114,7 @@ export TF_WORKSPACE=your_workspace
|
|||
Using this environment variable is recommended only for non-interactive usage, since in a local shell environment it can be easy to forget the variable is set and apply changes to the wrong state.
|
||||
|
||||
For more information regarding workspaces, check out the section on [Using Workspaces]
|
||||
(https://www.terraform.io/docs/state/workspaces.html).
|
||||
(https://www.terraform.io/docs/language/state/workspaces.html).
|
||||
|
||||
## TF_IN_AUTOMATION
|
||||
|
||||
|
@ -159,4 +159,4 @@ If `TF_IGNORE` is set to "trace", Terraform will output debug messages to displa
|
|||
export TF_IGNORE=trace
|
||||
```
|
||||
|
||||
For more details on `.terraformignore`, please see [Excluding Files from Upload with .terraformignore](/docs/backends/types/remote.html#excluding-files-from-upload-with-terraformignore).
|
||||
For more details on `.terraformignore`, please see [Excluding Files from Upload with .terraformignore](/docs/language/settings/backends/remote.html#excluding-files-from-upload-with-terraformignore).
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
The `terraform fmt` command is used to rewrite Terraform configuration files
|
||||
to a canonical format and style. This command applies a subset of
|
||||
the [Terraform language style conventions](/docs/configuration/style.html),
|
||||
the [Terraform language style conventions](/docs/language/syntax/style.html),
|
||||
along with other minor adjustments for readability.
|
||||
|
||||
Other Terraform commands that generate Terraform configuration will produce
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: get
|
||||
|
||||
The `terraform get` command is used to download and update
|
||||
[modules](/docs/modules/index.html) mentioned in the root module.
|
||||
[modules](/docs/language/modules/develop/index.html) mentioned in the root module.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ itself having created all objects. If you import existing objects into Terraform
|
|||
be careful to import each remote object to only one Terraform resource address.
|
||||
If you import the same object multiple times, Terraform may exhibit unwanted
|
||||
behavior. For more information on this assumption, see
|
||||
[the State section](/docs/state/).
|
||||
[the State section](/docs/language/state/index.html).
|
||||
|
||||
The command-line flags are all optional. The list of available flags are:
|
||||
|
||||
|
@ -75,12 +75,12 @@ in the configuration for the target resource, and that is the best behavior in m
|
|||
|
||||
* `-var 'foo=bar'` - Set a variable in the Terraform configuration. This flag
|
||||
can be set multiple times. Variable values are interpreted as
|
||||
[literal expressions](/docs/configuration/expressions/types.html) in the
|
||||
[literal expressions](/docs/language/expressions/types.html) in the
|
||||
Terraform language, so list and map values can be specified via this flag.
|
||||
This is only useful with the `-config` flag.
|
||||
|
||||
* `-var-file=foo` - Set variables in the Terraform configuration from
|
||||
a [variable file](/docs/configuration/variables.html#variable-definitions-tfvars-files). If
|
||||
a [variable file](/docs/language/values/variables.html#variable-definitions-tfvars-files). If
|
||||
a `terraform.tfvars` or any `.auto.tfvars` files are present in the current
|
||||
directory, they will be automatically loaded. `terraform.tfvars` is loaded
|
||||
first and the `.auto.tfvars` files after in alphabetical order. Any files
|
||||
|
@ -139,7 +139,7 @@ $ terraform import module.foo.aws_instance.bar i-abcd1234
|
|||
## Example: Import into Resource configured with count
|
||||
|
||||
The example below will import an AWS instance into the first instance of the `aws_instance` resource named `baz` configured with
|
||||
[`count`](/docs/configuration/meta-arguments/count.html):
|
||||
[`count`](/docs/language/meta-arguments/count.html):
|
||||
|
||||
```shell
|
||||
$ terraform import 'aws_instance.baz[0]' i-abcd1234
|
||||
|
@ -148,7 +148,7 @@ $ terraform import 'aws_instance.baz[0]' i-abcd1234
|
|||
## Example: Import into Resource configured with for_each
|
||||
|
||||
The example below will import an AWS instance into the `"example"` instance of the `aws_instance` resource named `baz` configured with
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html):
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html):
|
||||
|
||||
Linux, Mac OS, and UNIX:
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ be statically specified in the configuration file.
|
|||
## Child Module Installation
|
||||
|
||||
During init, the configuration is searched for `module` blocks, and the source
|
||||
code for referenced [modules](/docs/modules/) is retrieved from the locations
|
||||
code for referenced [modules](/docs/language/modules/develop/index.html) is retrieved from the locations
|
||||
given in their `source` arguments.
|
||||
|
||||
Re-running init with modules already installed will install the sources for
|
||||
|
@ -126,10 +126,10 @@ Terraform installs providers using
|
|||
[the provider installation settings in the CLI configuration](./cli-config.html#provider-installation).
|
||||
|
||||
For more information about specifying which providers are required for each
|
||||
of your modules, see [Provider Requirements](/docs/configuration/provider-requirements.html).
|
||||
of your modules, see [Provider Requirements](/docs/language/providers/requirements.html).
|
||||
|
||||
After successful installation, Terraform writes information about the selected
|
||||
providers to [the dependency lock file](/docs/configuration/dependency-lock.html).
|
||||
providers to [the dependency lock file](/docs/language/dependency-lock.html).
|
||||
You should commit this file to your version control system to ensure that
|
||||
when you run `terraform init` again in future Terraform will select exactly
|
||||
the same provider versions. Use the `-upgrade` option if you want Terraform
|
||||
|
|
|
@ -31,7 +31,7 @@ The command-line flags are all optional. The list of available flags are:
|
|||
for processing complex data types.
|
||||
* `-no-color` - If specified, output won't contain any color.
|
||||
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
## Examples
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ The available options are:
|
|||
* `-refresh=true` - Update the state prior to checking for differences.
|
||||
|
||||
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-target=resource` - A [Resource
|
||||
Address](/docs/internals/resource-addressing.html) to target. This flag can
|
||||
|
@ -78,11 +78,11 @@ The available options are:
|
|||
|
||||
* `-var 'foo=bar'` - Set a variable in the Terraform configuration. This flag
|
||||
can be set multiple times. Variable values are interpreted as
|
||||
[literal expressions](/docs/configuration/expressions/types.html) in the
|
||||
[literal expressions](/docs/language/expressions/types.html) 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](/docs/configuration/variables.html#variable-definitions-tfvars-files). If
|
||||
a [variable file](/docs/language/values/variables.html#variable-definitions-tfvars-files). If
|
||||
a `terraform.tfvars` or any `.auto.tfvars` files are present in the current
|
||||
directory, they will be automatically loaded. `terraform.tfvars` is loaded
|
||||
first and the `.auto.tfvars` files after in alphabetical order. Any files
|
||||
|
@ -115,7 +115,7 @@ of resources relates to configuration.
|
|||
Instead of using `-target` as a means to operate on isolated portions of very
|
||||
large configurations, prefer instead to break large configurations into
|
||||
several smaller configurations that can each be independently applied.
|
||||
[Data sources](/docs/configuration/data-sources.html) can be used to access
|
||||
[Data sources](/docs/language/data-sources/index.html) can be used to access
|
||||
information about resources created in other configurations, allowing
|
||||
a complex system architecture to be broken down into more manageable parts
|
||||
that can be updated independently.
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
# Command: providers
|
||||
|
||||
The `terraform providers` command shows information about the
|
||||
[provider requirements](/docs/configuration/provider-requirements.html) of the
|
||||
[provider requirements](/docs/language/providers/requirements.html) of the
|
||||
configuration in the current working directory, as an aid to understanding
|
||||
where each requirement was detected from.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
|
||||
The `terraform providers lock` consults upstream registries (by default) in
|
||||
order to write provider dependency information into
|
||||
[the dependency lock file](/docs/configuration/dependency-lock.html).
|
||||
[the dependency lock file](/docs/language/dependency-lock.html).
|
||||
|
||||
The common way to update the dependency lock file is as a side-effect of normal
|
||||
provider installation during
|
||||
|
@ -35,7 +35,7 @@ automatic approach may not be sufficient:
|
|||
on both Windows and Linux) and the upstream registry for a provider is unable
|
||||
to provide signed checksums using the latest hashing scheme, subsequent runs
|
||||
of Terraform on other platforms may
|
||||
[add additional checksums to the lock file](/docs/configuration/dependency-lock.html#new-provider-package-checksums).
|
||||
[add additional checksums to the lock file](/docs/language/dependency-lock.html#new-provider-package-checksums).
|
||||
You can avoid that by pre-populating hashes for all of the platforms you
|
||||
intend to use, using the `terraform providers lock` command.
|
||||
|
||||
|
@ -49,7 +49,7 @@ With no additional command line arguments, `terraform providers lock` will
|
|||
analyze the configuration in the current working directory to find all of
|
||||
the providers it depends on, and it will fetch the necessary data about those
|
||||
providers from their origin registries and then update
|
||||
[the dependency lock file](/docs/configuration/dependency-lock.html) to
|
||||
[the dependency lock file](/docs/language/dependency-lock.html) to
|
||||
include a selected version for each provider and all of the package checksums
|
||||
that are covered by the provider developer's cryptographic signature.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ description: |-
|
|||
|
||||
# Command: push
|
||||
|
||||
!> **Important:** The `terraform push` command is no longer functional. Its functionality was replaced and surpassed by [the `remote` backend](/docs/backends/types/remote.html), which works with current versions of Terraform Cloud. The `remote` backend allows you to run remote operations directly from the command line, and displays real-time output from the remote run environment.
|
||||
!> **Important:** The `terraform push` command is no longer functional. Its functionality was replaced and surpassed by [the `remote` backend](/docs/language/settings/backends/remote.html), which works with current versions of Terraform Cloud. The `remote` backend allows you to run remote operations directly from the command line, and displays real-time output from the remote run environment.
|
||||
|
||||
The `terraform push` command was an early implementation of remote Terraform runs. It allowed teams to push a configuration to a remote run environment in a discontinued version of Terraform Enterprise.
|
||||
|
||||
|
|
|
@ -43,11 +43,11 @@ The `terraform refresh` command accepts the following options:
|
|||
to 10.
|
||||
|
||||
* `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-state-out=path` - Path to write updated state file. By default, the
|
||||
`-state` path will be used. Ignored when
|
||||
[remote state](/docs/state/remote.html) is used.
|
||||
[remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-target=resource` - A [Resource
|
||||
Address](/docs/internals/resource-addressing.html) to target. Operation will
|
||||
|
@ -56,11 +56,11 @@ The `terraform refresh` command accepts the following options:
|
|||
|
||||
* `-var 'foo=bar'` - Set a variable in the Terraform configuration. This flag
|
||||
can be set multiple times. Variable values are interpreted as
|
||||
[literal expressions](/docs/configuration/expressions/types.html) in the
|
||||
[literal expressions](/docs/language/expressions/types.html) 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](/docs/configuration/variables.html#variable-definitions-tfvars-files). If
|
||||
a [variable file](/docs/language/values/variables.html#variable-definitions-tfvars-files). If
|
||||
a `terraform.tfvars` or any `.auto.tfvars` files are present in the current
|
||||
directory, they will be automatically loaded. `terraform.tfvars` is loaded
|
||||
first and the `.auto.tfvars` files after in alphabetical order. Any files
|
||||
|
|
|
@ -18,7 +18,7 @@ flag.
|
|||
|
||||
-> **Note:** When using the `-json` command-line flag, any sensitive values in
|
||||
Terraform state will be displayed in plain text. For more information, see
|
||||
[Sensitive Data in State](/docs/state/sensitive-data.html).
|
||||
[Sensitive Data in State](/docs/language/state/sensitive-data.html).
|
||||
|
||||
## JSON Output
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
The `terraform state` command is used for advanced state management.
|
||||
As your Terraform usage becomes more advanced, there are some cases where
|
||||
you may need to modify the [Terraform state](/docs/state/index.html).
|
||||
you may need to modify the [Terraform state](/docs/language/state/index.html).
|
||||
Rather than modify the state directly, the `terraform state` commands can
|
||||
be used in many cases instead.
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state list
|
||||
|
||||
The `terraform state list` command is used to list resources within a
|
||||
[Terraform state](/docs/state/index.html).
|
||||
[Terraform state](/docs/language/state/index.html).
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -30,7 +30,7 @@ in [resource addressing format](/docs/commands/state/addressing.html).
|
|||
The command-line flags are all optional. The list of available flags are:
|
||||
|
||||
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
* `-id=id` - ID of resources to show. Ignored when unset.
|
||||
|
||||
## Example: All Resources
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state mv
|
||||
|
||||
The `terraform state mv` command is used to move items in a
|
||||
[Terraform state](/docs/state/index.html). This command can move
|
||||
[Terraform state](/docs/language/state/index.html). This command can move
|
||||
single resources, single instances of a resource, entire modules, and more.
|
||||
This command can also move items to a completely different state file,
|
||||
enabling efficient refactoring.
|
||||
|
@ -100,7 +100,7 @@ $ terraform state mv -state-out=other.tfstate 'module.app' 'module.app'
|
|||
## Example: Move a Resource configured with count
|
||||
|
||||
The example below moves the first instance of a `packet_device` resource named `worker` configured with
|
||||
[`count`](/docs/configuration/meta-arguments/count.html) to
|
||||
[`count`](/docs/language/meta-arguments/count.html) to
|
||||
the first instance of a resource named `helper` also configured with `count`:
|
||||
|
||||
```shell
|
||||
|
@ -110,7 +110,7 @@ $ terraform state mv 'packet_device.worker[0]' 'packet_device.helper[0]'
|
|||
## Example: Move a Resource configured with for_each
|
||||
|
||||
The example below moves the `"example123"` instance of a `packet_device` resource named `worker` configured with
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
to the `"example456"` instance of a resource named `helper` also configuring `for_each`:
|
||||
|
||||
Linux, Mac OS, and UNIX:
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state pull
|
||||
|
||||
The `terraform state pull` command is used to manually download and output
|
||||
the state from [remote state](/docs/state/remote.html). This command also
|
||||
the state from [remote state](/docs/language/state/remote.html). This command also
|
||||
works with local state.
|
||||
|
||||
## Usage
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state push
|
||||
|
||||
The `terraform state push` command is used to manually upload a local
|
||||
state file to [remote state](/docs/state/remote.html). This command also
|
||||
state file to [remote state](/docs/language/state/remote.html). This command also
|
||||
works with local state.
|
||||
|
||||
This command should rarely be used. It is meant only as a utility in case
|
||||
|
@ -20,7 +20,7 @@ manual intervention is necessary with the remote state.
|
|||
Usage: `terraform state push [options] PATH`
|
||||
|
||||
This command will push the state specified by PATH to the currently
|
||||
configured [backend](/docs/configuration/blocks/backends/index.html).
|
||||
configured [backend](/docs/language/settings/backends/index.html).
|
||||
|
||||
If PATH is "-" then the state data to push is read from stdin. This data
|
||||
is loaded completely into memory and verified prior to being written to
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state replace-provider
|
||||
|
||||
The `terraform state replace-provider` command is used to replace the provider
|
||||
for resources in a [Terraform state](/docs/state/index.html).
|
||||
for resources in a [Terraform state](/docs/language/state/index.html).
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: state rm
|
||||
|
||||
The `terraform state rm` command is used to remove items from the
|
||||
[Terraform state](/docs/state/index.html). This command can remove
|
||||
[Terraform state](/docs/language/state/index.html). This command can remove
|
||||
single resources, single instances of a resource, entire modules,
|
||||
and more.
|
||||
|
||||
|
@ -83,7 +83,7 @@ $ terraform state rm 'module.foo.packet_device.worker'
|
|||
## Example: Remove a Resource configured with count
|
||||
|
||||
The example below removes the first instance of a `packet_device` resource named `worker` configured with
|
||||
[`count`](/docs/configuration/meta-arguments/count.html):
|
||||
[`count`](/docs/language/meta-arguments/count.html):
|
||||
|
||||
```shell
|
||||
$ terraform state rm 'packet_device.worker[0]'
|
||||
|
@ -92,7 +92,7 @@ $ terraform state rm 'packet_device.worker[0]'
|
|||
## Example: Remove a Resource configured with for_each
|
||||
|
||||
The example below removes the `"example"` instance of a `packet_device` resource named `worker` configured with
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html):
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html):
|
||||
|
||||
Linux, Mac OS, and UNIX:
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
The `terraform state show` command is used to show the attributes of a
|
||||
single resource in the
|
||||
[Terraform state](/docs/state/index.html).
|
||||
[Terraform state](/docs/language/state/index.html).
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -26,7 +26,7 @@ in [resource addressing format](/docs/commands/state/addressing.html).
|
|||
The command-line flags are all optional. The list of available flags are:
|
||||
|
||||
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
The output of `terraform state show` is intended for human consumption, not
|
||||
programmatic consumption. To extract state data for use in other software, use
|
||||
|
@ -61,7 +61,7 @@ $ terraform state show 'module.foo.packet_device.worker'
|
|||
## Example: Show a Resource configured with count
|
||||
|
||||
The example below shows the first instance of a `packet_device` resource named `worker` configured with
|
||||
[`count`](/docs/configuration/meta-arguments/count.html):
|
||||
[`count`](/docs/language/meta-arguments/count.html):
|
||||
|
||||
```shell
|
||||
$ terraform state show 'packet_device.worker[0]'
|
||||
|
@ -70,7 +70,7 @@ $ terraform state show 'packet_device.worker[0]'
|
|||
## Example: Show a Resource configured with for_each
|
||||
|
||||
The example below shows the `"example"` instance of a `packet_device` resource named `worker` configured with
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html):
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html):
|
||||
|
||||
Linux, Mac OS, and UNIX:
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ The command-line flags are all optional. The list of available flags are:
|
|||
* `-lock-timeout=0s` - Duration to retry a state lock.
|
||||
|
||||
* `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-state-out=path` - Path to write updated state file. By default, the
|
||||
`-state` path will be used. Ignored when
|
||||
[remote state](/docs/state/remote.html) is used.
|
||||
[remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-ignore-remote-version` - When using the enhanced remote backend with
|
||||
Terraform Cloud, continue even if remote and local Terraform versions differ.
|
||||
|
@ -104,7 +104,7 @@ Resource instance module.couchbase.aws_instance.cb_node[9] has been marked as ta
|
|||
```
|
||||
|
||||
Although we recommend that most configurations use only one level of nesting
|
||||
and employ [module composition](/docs/modules/composition.html), it's possible
|
||||
and employ [module composition](/docs/language/modules/develop/composition.html), it's possible
|
||||
to have multiple levels of nested modules. In that case the resource instance
|
||||
address must include all of the steps to the target instance, as in the
|
||||
following example:
|
||||
|
|
|
@ -52,11 +52,11 @@ certain cases, see above note). The list of available flags are:
|
|||
* `-no-color` - Disables output with coloring
|
||||
|
||||
* `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".
|
||||
Ignored when [remote state](/docs/state/remote.html) is used.
|
||||
Ignored when [remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-state-out=path` - Path to write updated state file. By default, the
|
||||
`-state` path will be used. Ignored when
|
||||
[remote state](/docs/state/remote.html) is used.
|
||||
[remote state](/docs/language/state/remote.html) is used.
|
||||
|
||||
* `-ignore-remote-version` - When using the enhanced remote backend with
|
||||
Terraform Cloud, continue even if remote and local Terraform versions differ.
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
# Command: workspace
|
||||
|
||||
The `terraform workspace` command is used to manage
|
||||
[workspaces](/docs/state/workspaces.html).
|
||||
[workspaces](/docs/language/state/workspaces.html).
|
||||
|
||||
This command is a container for further subcommands. These subcommands are
|
||||
listed in the navigation bar.
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Configuring Data Sources](../configuration/data-sources.html).
|
||||
[Configuration Language: Configuring Data Sources](/docs/language/data-sources/index.html).
|
||||
|
||||
*Data sources* allow data to be fetched or computed for use elsewhere
|
||||
in Terraform configuration. Use of data sources allows a Terraform
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language](../configuration/index.html).
|
||||
[Configuration Language](/docs/language/index.html).
|
||||
|
||||
Terraform uses text files to describe infrastructure and to set variables.
|
||||
These text files are called Terraform _configurations_ and end in
|
||||
|
|
|
@ -10,8 +10,8 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Expressions](/docs/configuration/expressions/index.html) and
|
||||
[Configuration Language: Functions](../configuration/functions.html).
|
||||
[Configuration Language: Expressions](/docs/language/expressions/index.html) and
|
||||
[Configuration Language: Functions](/docs/language/functions/index.html).
|
||||
|
||||
Embedded within strings in Terraform, whether you're using the
|
||||
Terraform syntax or JSON syntax, you can interpolate other values. These
|
||||
|
@ -77,7 +77,7 @@ syntax to get a list of all the attributes: `${data.aws_subnet.example.*.cidr_bl
|
|||
|
||||
The syntax is `module.<NAME>.<OUTPUT>`. For example `${module.foo.bar}` will
|
||||
interpolate the `bar` output from the `foo`
|
||||
[module](/docs/modules/index.html).
|
||||
[module](/docs/language/modules/develop/index.html).
|
||||
|
||||
#### Count information
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language](../configuration/index.html).
|
||||
[Configuration Language](/docs/language/index.html).
|
||||
|
||||
When invoking any command that loads the Terraform configuration,
|
||||
Terraform loads all configuration files within the directory
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Configuring Local Values](../configuration/locals.html).
|
||||
[Configuration Language: Configuring Local Values](/docs/language/values/locals.html).
|
||||
|
||||
Local values assign a name to an expression, that can then be used multiple
|
||||
times within a module.
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Modules](../configuration/modules.html).
|
||||
[Configuration Language: Modules](/docs/language/modules/index.html).
|
||||
|
||||
A _module_ is a container for multiple resources that are used together.
|
||||
|
||||
|
@ -27,7 +27,7 @@ and re-used.
|
|||
This page describes how to call one module from another. Other pages in this
|
||||
section of the documentation describe the different elements that make up
|
||||
modules, and there is further information about how modules can be used,
|
||||
created, and published in [the dedicated _Modules_ section](/docs/modules/index.html).
|
||||
created, and published in [the dedicated _Modules_ section](/docs/language/modules/develop/index.html).
|
||||
|
||||
## Calling a Child Module
|
||||
|
||||
|
@ -62,7 +62,7 @@ Terraform CLI. Its value is either the path to a local directory of the
|
|||
module's configuration files, or a remote module source that Terraform should
|
||||
download and use. This value must be a literal string with no template
|
||||
sequences; interpolations are not allowed. For more information on
|
||||
possible values for this argument, see [Module Sources](/docs/modules/sources.html).
|
||||
possible values for this argument, see [Module Sources](/docs/language/modules/sources.html).
|
||||
|
||||
The same source address can be specified in multiple `module` blocks to create
|
||||
multiple copies of the resources defined within, possibly with different
|
||||
|
@ -161,7 +161,7 @@ future features.
|
|||
|
||||
Since modules are a complex feature in their own right, further detail
|
||||
about how modules can be used, created, and published is included in
|
||||
[the dedicated section on modules](/docs/modules/index.html).
|
||||
[the dedicated section on modules](/docs/language/modules/develop/index.html).
|
||||
|
||||
## Providers within Modules
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Output Values](../configuration/outputs.html).
|
||||
[Configuration Language: Output Values](/docs/language/values/outputs.html).
|
||||
|
||||
Outputs define values that will be highlighted to the user
|
||||
when Terraform applies, and can be queried easily using the
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Override Files](../configuration/override.html).
|
||||
[Configuration Language: Override Files](/docs/language/files/override.html).
|
||||
|
||||
Terraform loads all configuration files within a directory and
|
||||
appends them together. Terraform also has a concept of _overrides_,
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Providers](../configuration/providers.html).
|
||||
[Configuration Language: Providers](/docs/language/providers/index.html).
|
||||
|
||||
Providers are responsible in Terraform for managing the lifecycle
|
||||
of a [resource](./resources.html): create,
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Resources](../configuration/resources.html).
|
||||
[Configuration Language: Resources](/docs/language/resources/index.html).
|
||||
|
||||
The most important thing you'll configure with Terraform are
|
||||
resources. Resources are a component of your infrastructure.
|
||||
|
@ -176,7 +176,7 @@ could automatically do this a better way.
|
|||
Within a resource, you can optionally have a **connection block**.
|
||||
Connection blocks describe to Terraform how to connect to the
|
||||
resource for
|
||||
[provisioning](/docs/provisioners/index.html). This block doesn't
|
||||
[provisioning](/docs/language/resources/provisioners/syntax.html). This block doesn't
|
||||
need to be present if you're using only local provisioners, or
|
||||
if you're not provisioning at all.
|
||||
|
||||
|
@ -184,13 +184,13 @@ Resources provide some data on their own, such as an IP address,
|
|||
but other data must be specified by the user.
|
||||
|
||||
The full list of settings that can be specified are listed on
|
||||
the [provisioner connection page](/docs/provisioners/connection.html).
|
||||
the [provisioner connection page](/docs/language/resources/provisioners/connection.html).
|
||||
|
||||
### Provisioners
|
||||
|
||||
Within a resource, you can specify zero or more **provisioner
|
||||
blocks**. Provisioner blocks configure
|
||||
[provisioners](/docs/provisioners/index.html).
|
||||
[provisioners](/docs/language/resources/provisioners/syntax.html).
|
||||
|
||||
Within the provisioner block is provisioner-specific configuration,
|
||||
much like resource-specific configuration.
|
||||
|
|
|
@ -14,7 +14,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Syntax](../configuration/syntax.html).
|
||||
[Configuration Language: Syntax](/docs/language/syntax/configuration.html).
|
||||
|
||||
The syntax of Terraform configurations is called [HashiCorp Configuration
|
||||
Language (HCL)](https://github.com/hashicorp/hcl). It is meant to strike a
|
||||
|
|
|
@ -10,7 +10,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Terraform Settings](../configuration/terraform.html).
|
||||
[Configuration Language: Terraform Settings](/docs/language/settings/index.html).
|
||||
|
||||
The `terraform` configuration section is used to configure Terraform itself,
|
||||
such as requiring a minimum Terraform version to execute a configuration.
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
|
||||
-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
|
||||
and later, see
|
||||
[Configuration Language: Input Variables](../configuration/variables.html).
|
||||
[Configuration Language: Input Variables](/docs/language/values/variables.html).
|
||||
|
||||
Input variables serve as parameters for a Terraform module.
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ is set to an empty list (`<ATTR> = []`).
|
|||
Most users do not need to know any further details of this "nested block or
|
||||
empty list" behavior. However, read further if you need to:
|
||||
|
||||
- Use Terraform's [JSON syntax](/docs/configuration/syntax-json.html) with this
|
||||
- Use Terraform's [JSON syntax](/docs/language/syntax/json.html) with this
|
||||
type of resource.
|
||||
- Create a reusable module that wraps this type of resource.
|
||||
|
||||
## Details
|
||||
|
||||
In Terraform v0.12 and later, the language makes a distinction between
|
||||
[argument syntax and nested block syntax](/docs/configuration/syntax.html#arguments-and-blocks)
|
||||
[argument syntax and nested block syntax](/docs/language/syntax/configuration.html#arguments-and-blocks)
|
||||
within blocks:
|
||||
|
||||
* Argument syntax sets a named argument for the containing object. If the
|
||||
|
@ -46,7 +46,7 @@ within blocks:
|
|||
merging in with any explicitly-defined arguments.
|
||||
|
||||
The distinction between these is particularly important for
|
||||
[JSON syntax](/docs/configuration/syntax-json.html)
|
||||
[JSON syntax](/docs/language/syntax/json.html)
|
||||
because the same primitive JSON constructs (lists and objects) will be
|
||||
interpreted differently depending on whether a particular name is an argument
|
||||
or a nested block type.
|
||||
|
@ -153,7 +153,7 @@ example = [
|
|||
|
||||
For the arguments that use the attributes-as-blocks usage mode, the above is
|
||||
a better pattern than using
|
||||
[`dynamic` blocks](/docs/configuration/expressions/dynamic-blocks.html)
|
||||
[`dynamic` blocks](/docs/language/expressions/dynamic-blocks.html)
|
||||
because the case where the
|
||||
caller provides an empty list will result in explicitly assigning an empty
|
||||
list value, rather than assigning no value at all and thus retaining and
|
||||
|
@ -163,7 +163,7 @@ dynamically-generating _normal_ nested blocks, though.
|
|||
## In JSON syntax
|
||||
|
||||
Arguments that use this special mode are specified in JSON syntax always using
|
||||
the [JSON expression mapping](/docs/configuration/syntax-json.html#expression-mapping)
|
||||
the [JSON expression mapping](/docs/language/syntax/json.html#expression-mapping)
|
||||
to produce a list of objects.
|
||||
|
||||
The interpretation of these values in JSON syntax is, therefore, equivalent
|
||||
|
|
|
@ -21,7 +21,7 @@ Terraform's types are `string`, `number`, `bool`, `list`, `tuple`, `map`,
|
|||
`object`, and `null`.
|
||||
|
||||
This information has moved to
|
||||
[Types and Values](/docs/configuration/expressions/types.html).
|
||||
[Types and Values](/docs/language/expressions/types.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -40,7 +40,7 @@ You can refer to certain values by name, like `var.some_variable` or
|
|||
`aws_instance.example.ami`.
|
||||
|
||||
This information has moved to
|
||||
[References to Values](/docs/configuration/expressions/references.html).
|
||||
[References to Values](/docs/language/expressions/references.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -57,7 +57,7 @@ Operators are expressions that transform other expressions, like adding two
|
|||
numbers (`+`) or comparing two values to get a bool (`==`, `>=`, etc.).
|
||||
|
||||
This information has moved to
|
||||
[Operators](/docs/configuration/expressions/references.html).
|
||||
[Operators](/docs/language/expressions/references.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -69,7 +69,7 @@ The `condition ? true_val : false_val` expression chooses between two
|
|||
expressions based on a bool condition.
|
||||
|
||||
This information has moved to
|
||||
[Conditional Expressions](/docs/configuration/expressions/conditionals.html).
|
||||
[Conditional Expressions](/docs/language/expressions/conditionals.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -83,7 +83,7 @@ This information has moved to
|
|||
Terraform's functions can be called like `function_name(arg1, arg2)`.
|
||||
|
||||
This information has moved to
|
||||
[Function Calls](/docs/configuration/expressions/function-calls.html).
|
||||
[Function Calls](/docs/language/expressions/function-calls.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -97,7 +97,7 @@ Expressions like `[for s in var.list : upper(s)]` can transform a complex type
|
|||
value into another complex type value.
|
||||
|
||||
This information has moved to
|
||||
[For Expressions](/docs/configuration/expressions/for.html).
|
||||
[For Expressions](/docs/language/expressions/for.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -112,7 +112,7 @@ Expressions like `var.list[*].id` can extract simpler collections from complex
|
|||
collections.
|
||||
|
||||
This information has moved to
|
||||
[Splat Expressions](/docs/configuration/expressions/splat.html).
|
||||
[Splat Expressions](/docs/language/expressions/splat.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -127,7 +127,7 @@ The special `dynamic` block type serves the same purpose as a `for` expression,
|
|||
except it creates multiple repeatable nested blocks instead of a complex value.
|
||||
|
||||
This information has moved to
|
||||
[Dynamic Blocks](/docs/configuration/expressions/dynamic-blocks.html).
|
||||
[Dynamic Blocks](/docs/language/expressions/dynamic-blocks.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -152,6 +152,6 @@ Strings can also include escape sequences like `\n`, interpolation sequences
|
|||
(`${ ... }`), and template sequences (`%{ ... }`).
|
||||
|
||||
This information has moved to
|
||||
[Strings and Templates](/docs/configuration/expressions/strings.html).
|
||||
[Strings and Templates](/docs/language/expressions/strings.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
|
|
@ -18,7 +18,7 @@ pages.
|
|||
## Syntax and Elements of Module Blocks
|
||||
|
||||
This information has moved to
|
||||
[Module Blocks](/docs/configuration/blocks/modules/syntax.html).
|
||||
[Module Blocks](/docs/language/modules/syntax.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -29,8 +29,8 @@ This information has moved to
|
|||
## Multiple Instances with `count` and `for_each`
|
||||
|
||||
This information has moved to
|
||||
[`count`](/docs/configuration/meta-arguments/count.html) and
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html).
|
||||
[`count`](/docs/language/meta-arguments/count.html) and
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -46,9 +46,9 @@ This information has moved to
|
|||
## Handling Provider Configurations in Re-usable Modules
|
||||
|
||||
This information has moved to
|
||||
[The `providers` Meta-Argument](/docs/configuration/meta-arguments/module-providers.html)
|
||||
[The `providers` Meta-Argument](/docs/language/meta-arguments/module-providers.html)
|
||||
(for users of re-usable modules) and
|
||||
[Providers Within Modules](/docs/modules/providers.html)
|
||||
[Providers Within Modules](/docs/language/modules/develop/providers.html)
|
||||
(for module developers).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
|
|
@ -20,7 +20,7 @@ pages.
|
|||
## Syntax and Elements of Resource Blocks
|
||||
|
||||
This information has moved to
|
||||
[Resource Blocks](/docs/configuration/blocks/resources/syntax.html).
|
||||
[Resource Blocks](/docs/language/resources/syntax.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -34,7 +34,7 @@ This information has moved to
|
|||
## Details of Resource Behavior
|
||||
|
||||
This information has moved to
|
||||
[Resource Behavior](/docs/configuration/blocks/resources/behavior.html).
|
||||
[Resource Behavior](/docs/language/resources/behavior.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -44,12 +44,12 @@ This information has moved to
|
|||
|
||||
Each resource meta-argument has moved to its own page:
|
||||
|
||||
- [`depends_on`](/docs/configuration/meta-arguments/depends_on.html)
|
||||
- [`count`](/docs/configuration/meta-arguments/count.html)
|
||||
- [`for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
- [`provider`](/docs/configuration/meta-arguments/resource-provider.html)
|
||||
- [`lifecycle`](/docs/configuration/meta-arguments/lifecycle.html)
|
||||
- [Provisioners](/docs/configuration/blocks/resources/provisioners/index.html)
|
||||
- [`depends_on`](/docs/language/meta-arguments/depends_on.html)
|
||||
- [`count`](/docs/language/meta-arguments/count.html)
|
||||
- [`for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
- [`provider`](/docs/language/meta-arguments/resource-provider.html)
|
||||
- [`lifecycle`](/docs/language/meta-arguments/lifecycle.html)
|
||||
- [Provisioners](/docs/language/resources/provisioners/index.html)
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -60,7 +60,7 @@ Each resource meta-argument has moved to its own page:
|
|||
### `depends_on`
|
||||
|
||||
This information has moved to
|
||||
[`depends_on`](/docs/configuration/meta-arguments/depends_on.html).
|
||||
[`depends_on`](/docs/language/meta-arguments/depends_on.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -77,7 +77,7 @@ This information has moved to
|
|||
### `count`
|
||||
|
||||
This information has moved to
|
||||
[`count`](/docs/configuration/meta-arguments/count.html).
|
||||
[`count`](/docs/language/meta-arguments/count.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -94,7 +94,7 @@ This information has moved to
|
|||
### `for_each`
|
||||
|
||||
This information has moved to
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html).
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -105,7 +105,7 @@ This information has moved to
|
|||
### `provider`
|
||||
|
||||
This information has moved to
|
||||
[`provider`](/docs/configuration/meta-arguments/resource-provider.html).
|
||||
[`provider`](/docs/language/meta-arguments/resource-provider.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -119,7 +119,7 @@ This information has moved to
|
|||
### `lifecycle`
|
||||
|
||||
This information has moved to
|
||||
[`lifecycle`](/docs/configuration/meta-arguments/lifecycle.html).
|
||||
[`lifecycle`](/docs/language/meta-arguments/lifecycle.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
||||
|
@ -130,6 +130,6 @@ This information has moved to
|
|||
### Provisioners
|
||||
|
||||
This information has moved to
|
||||
[Provisioners](/docs/configuration/blocks/resources/provisioners/index.html).
|
||||
[Provisioners](/docs/language/resources/provisioners/index.html).
|
||||
|
||||
<div style="height: 100vh; margin: 0; padding: 0;"></div>
|
||||
|
|
|
@ -26,12 +26,12 @@ itself having created all objects. If you import existing objects into Terraform
|
|||
be careful to import each remote object to only one Terraform resource address.
|
||||
If you import the same object multiple times, Terraform may exhibit unwanted
|
||||
behavior. For more information on this assumption, see
|
||||
[the State section](/docs/state/).
|
||||
[the State section](/docs/language/state/index.html).
|
||||
|
||||
## Currently State Only
|
||||
|
||||
The current implementation of Terraform import can only import resources
|
||||
into the [state](/docs/state/). It does not generate configuration. A future
|
||||
into the [state](/docs/language/state/index.html). It does not generate configuration. A future
|
||||
version of Terraform will also generate configuration.
|
||||
|
||||
Because of this, prior to running `terraform import` it is necessary to write
|
||||
|
@ -44,7 +44,7 @@ importing existing resources.
|
|||
## Remote Backends
|
||||
|
||||
When using Terraform import on the command line with a [remote
|
||||
backend](/docs/backends/types/remote.html), such as Terraform Cloud, the import
|
||||
backend](/docs/language/settings/backends/remote.html), such as Terraform Cloud, the import
|
||||
command runs locally, unlike commands such as apply, which run inside your
|
||||
Terraform Cloud environment. Because of this, the import command will not have
|
||||
access to information from the remote backend, such as workspace variables.
|
||||
|
|
|
@ -23,7 +23,7 @@ itself having created all objects. If you import existing objects into Terraform
|
|||
be careful to import each remote object to only one Terraform resource address.
|
||||
If you import the same object multiple times, Terraform may exhibit unwanted
|
||||
behavior. For more information on this assumption, see
|
||||
[the State section](/docs/state/).
|
||||
[the State section](/docs/language/state/index.html).
|
||||
|
||||
To import a resource, first write a resource block for it in your
|
||||
configuration, establishing the name by which it will be known to Terraform:
|
||||
|
|
|
@ -244,7 +244,7 @@ The following example illustrates the structure of a `<values-representation>`:
|
|||
}
|
||||
```
|
||||
|
||||
The translation of attribute and output values is the same intuitive mapping from HCL types to JSON types used by Terraform's [`jsonencode`](/docs/configuration/functions/jsonencode.html) function. This mapping does lose some information: lists, sets, and tuples all lower to JSON arrays while maps and objects both lower to JSON objects. Unknown values and null values are both treated as absent or null.
|
||||
The translation of attribute and output values is the same intuitive mapping from HCL types to JSON types used by Terraform's [`jsonencode`](/docs/language/functions/jsonencode.html) function. This mapping does lose some information: lists, sets, and tuples all lower to JSON arrays while maps and objects both lower to JSON objects. Unknown values and null values are both treated as absent or null.
|
||||
|
||||
Only the "current" object for each resource instance is described. "Deposed" objects are not reflected in this structure at all; in plan representations, you can refer to the change representations for further details.
|
||||
|
||||
|
|
|
@ -213,10 +213,10 @@ A successful response has no body, and includes the location from which the
|
|||
module version's source can be downloaded in the `X-Terraform-Get` header.
|
||||
The value of this header accepts the same values as the `source` argument
|
||||
in a `module` block in Terraform configuration, as described in
|
||||
[Module Sources](https://www.terraform.io/docs/modules/sources.html),
|
||||
[Module Sources](https://www.terraform.io/docs/language/modules/sources.html),
|
||||
except that it may not recursively refer to another module registry address.
|
||||
|
||||
The value of `X-Terraform-Get` may instead be a relative URL, indicated by
|
||||
beginning with `/`, `./` or `../`, in which case it is resolved relative to
|
||||
the full URL of the download endpoint to produce
|
||||
[an HTTP URL module source](/docs/modules/sources.html#http-urls).
|
||||
[an HTTP URL module source](/docs/language/modules/sources.html#http-urls).
|
||||
|
|
|
@ -36,7 +36,7 @@ instead.
|
|||
Each Terraform provider has an associated address which uniquely identifies it
|
||||
within Terraform. A provider address has the syntax `hostname/namespace/type`,
|
||||
which is described in more detail in
|
||||
[the Provider Requirements documentation](/docs/configuration/provider-requirements.html).
|
||||
[the Provider Requirements documentation](/docs/language/providers/requirements.html).
|
||||
|
||||
By default, the `hostname` portion of a provider address serves both as part
|
||||
of its unique identifier _and_ as the location of the registry to retrieve it
|
||||
|
|
|
@ -13,8 +13,8 @@ in Terraform configuration. Use of data sources allows a Terraform
|
|||
configuration to make use of information defined outside of Terraform,
|
||||
or defined by another separate Terraform configuration.
|
||||
|
||||
Each [provider](./providers.html) may offer data sources
|
||||
alongside its set of [resource](/docs/configuration/blocks/resources/index.html)
|
||||
Each [provider](/docs/language/providers/index.html) may offer data sources
|
||||
alongside its set of [resource](/docs/language/resources/index.html)
|
||||
types.
|
||||
|
||||
## Using Data Sources
|
||||
|
@ -61,14 +61,14 @@ Each data resource is associated with a single data source, which determines
|
|||
the kind of object (or objects) it reads and what query constraint arguments
|
||||
are available.
|
||||
|
||||
Each data source in turn belongs to a [provider](./providers.html),
|
||||
Each data source in turn belongs to a [provider](/docs/language/providers/index.html),
|
||||
which is a plugin for Terraform that offers a collection of resource types and
|
||||
data sources that most often belong to a single cloud or on-premises
|
||||
infrastructure platform.
|
||||
|
||||
Most of the items within the body of a `data` block are defined by and
|
||||
specific to the selected data source, and these arguments can make full
|
||||
use of [expressions](/docs/configuration/expressions/index.html) and other dynamic
|
||||
use of [expressions](/docs/language/expressions/index.html) and other dynamic
|
||||
Terraform language features.
|
||||
|
||||
However, there are some "meta-arguments" that are defined by Terraform itself
|
||||
|
@ -110,7 +110,7 @@ operation, and is re-calculated each time a new plan is created.
|
|||
## Data Resource Dependencies
|
||||
|
||||
Data resources have the same dependency resolution behavior
|
||||
[as defined for managed resources](/docs/configuration/blocks/resources/behavior.html#resource-dependencies).
|
||||
[as defined for managed resources](/docs/language/resources/behavior.html#resource-dependencies).
|
||||
Setting the `depends_on` meta-argument within `data` blocks defers reading of
|
||||
the data source until after all changes to the dependencies have been applied.
|
||||
|
||||
|
@ -125,8 +125,8 @@ referencing the managed resource values through a `local` value.
|
|||
|
||||
## Multiple Resource Instances
|
||||
|
||||
Data resources support [`count`](/docs/configuration/meta-arguments/count.html)
|
||||
and [`for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
Data resources support [`count`](/docs/language/meta-arguments/count.html)
|
||||
and [`for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
meta-arguments as defined for managed resources, with the same syntax and behavior.
|
||||
|
||||
As with managed resources, when `count` or `for_each` is present it is important to
|
||||
|
@ -136,7 +136,7 @@ own variant of the constraint arguments, producing an indexed result.
|
|||
|
||||
## Selecting a Non-default Provider Configuration
|
||||
|
||||
Data resources support [the `provider` meta-argument](/docs/configuration/meta-arguments/resource-provider.html)
|
||||
Data resources support [the `provider` meta-argument](/docs/language/meta-arguments/resource-provider.html)
|
||||
as defined for managed resources, with the same syntax and behavior.
|
||||
|
||||
## Lifecycle Customizations
|
||||
|
@ -190,13 +190,13 @@ resource "aws_instance" "web" {
|
|||
## Meta-Arguments
|
||||
|
||||
As data sources are essentially a read only subset of resources, they also
|
||||
support the same [meta-arguments](/docs/configuration/blocks/resources/syntax.html#meta-arguments) of resources
|
||||
support the same [meta-arguments](/docs/language/resources/syntax.html#meta-arguments) of resources
|
||||
with the exception of the
|
||||
[`lifecycle` configuration block](/docs/configuration/meta-arguments/lifecycle.html).
|
||||
[`lifecycle` configuration block](/docs/language/meta-arguments/lifecycle.html).
|
||||
|
||||
### Non-Default Provider Configurations
|
||||
|
||||
Similarly to [resources](/docs/configuration/blocks/resources/index.html), when
|
||||
Similarly to [resources](/docs/language/resources/index.html), when
|
||||
a module has multiple configurations for the same provider you can specify which
|
||||
configuration to use with the `provider` meta-argument:
|
||||
|
||||
|
@ -209,7 +209,7 @@ data "aws_ami" "web" {
|
|||
```
|
||||
|
||||
See
|
||||
[The Resource `provider` Meta-Argument](/docs/configuration/meta-arguments/resource-provider.html)
|
||||
[The Resource `provider` Meta-Argument](/docs/language/meta-arguments/resource-provider.html)
|
||||
for more information.
|
||||
|
||||
## Data Source Lifecycle
|
||||
|
|
|
@ -14,9 +14,9 @@ information here is not relevant to those versions.
|
|||
A Terraform configuration may refer to two different kinds of external
|
||||
dependency that come from outside of its own codebase:
|
||||
|
||||
* [Providers](./provider-requirements.html), which are plugins for Terraform
|
||||
* [Providers](/docs/language/providers/requirements.html), which are plugins for Terraform
|
||||
that extend it with support for interacting with various external systems.
|
||||
* [Modules](/docs/configuration/blocks/modules/index.html), which allow
|
||||
* [Modules](/docs/language/modules/index.html), which allow
|
||||
splitting out groups of Terraform configuration constructs (written in the
|
||||
Terraform language) into reusable abstractions.
|
||||
|
||||
|
@ -26,7 +26,7 @@ reason, Terraform must determine which versions of those dependencies are
|
|||
potentially compatible with the current configuration and which versions are
|
||||
currently selected for use.
|
||||
|
||||
[Version constraints](./version-constraints.html) within the configuration
|
||||
[Version constraints](/docs/language/expressions/version-constraints.html) within the configuration
|
||||
itself determine which versions of dependencies are _potentially_ compatible,
|
||||
but after selecting a specific version of each dependency Terraform remembers
|
||||
the decisions it made in a _dependency lock file_ so that it can (by default)
|
||||
|
@ -157,7 +157,7 @@ propsed changes. The following sections will describe these common situations.
|
|||
### Dependency on a new provider
|
||||
|
||||
If you add a new entry to the
|
||||
[provider requirements](./provider-requirements.html) for any module in your
|
||||
[provider requirements](/docs/language/providers/requirements.html) for any module in your
|
||||
configuration, or if you add an external module that includes a new provider
|
||||
dependency itself, `terraform init` will respond to that by selecting the
|
||||
newest version of that provider which meets all of the version constraints
|
||||
|
|
|
@ -60,7 +60,7 @@ be some uncertainty about the expected result type.
|
|||
|
||||
The following example is contrived because it would be easier to write the
|
||||
constant `"12"` instead of the type conversion in this case, but shows how to
|
||||
use [`tostring`](../functions/tostring.html) to explicitly convert a number to
|
||||
use [`tostring`](/docs/language/functions/tostring.html) to explicitly convert a number to
|
||||
a string.
|
||||
|
||||
```hcl
|
||||
|
|
|
@ -83,9 +83,9 @@ nested block. If you need to declare resource instances based on a nested
|
|||
data structure or combinations of elements from multiple data structures you
|
||||
can use Terraform expressions and functions to derive a suitable value.
|
||||
For some common examples of such situations, see the
|
||||
[`flatten`](/docs/configuration/functions/flatten.html)
|
||||
[`flatten`](/docs/language/functions/flatten.html)
|
||||
and
|
||||
[`setproduct`](/docs/configuration/functions/setproduct.html)
|
||||
[`setproduct`](/docs/language/functions/setproduct.html)
|
||||
functions.
|
||||
|
||||
## Multi-level Nested Block Structures
|
||||
|
@ -150,5 +150,5 @@ nested blocks using directly-corresponding attributes from an input variable
|
|||
then that might suggest that your module is not creating a useful abstraction.
|
||||
It may be better for the calling module to define the resource itself then
|
||||
pass information about it into your module. For more information on this design
|
||||
tradeoff, see [When to Write a Module](/docs/modules/#when-to-write-a-module)
|
||||
and [Module Composition](/docs/modules/composition.html).
|
||||
tradeoff, see [When to Write a Module](/docs/language/modules/develop/index.html#when-to-write-a-module)
|
||||
and [Module Composition](/docs/language/modules/develop/composition.html).
|
||||
|
|
|
@ -129,7 +129,7 @@ For sets of other types, Terraform uses an arbitrary ordering that may change
|
|||
in future versions of Terraform. For that reason, we recommend converting the
|
||||
result of such an expression to itself be a set so that it's clear elsewhere
|
||||
in the configuration that the result is unordered. You can use
|
||||
[the `toset` function](../functions/toset.html)
|
||||
[the `toset` function](/docs/language/functions/toset.html)
|
||||
to concisely convert a `for` expression result to be of a set type.
|
||||
|
||||
```hcl
|
||||
|
|
|
@ -8,7 +8,7 @@ page_title: "Function Calls - Configuration Language"
|
|||
> **Hands-on:** Try the [Perform Dynamic Operations with Functions](https://learn.hashicorp.com/tutorials/terraform/functions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn.
|
||||
|
||||
The Terraform language has a number of
|
||||
[built-in functions](/docs/configuration/functions.html) that can be used
|
||||
[built-in functions](/docs/language/functions/index.html) that can be used
|
||||
in expressions to transform and combine values. These
|
||||
are similar to the operators but all follow a common syntax:
|
||||
|
||||
|
@ -33,7 +33,7 @@ A function call expression evaluates to the function's return value.
|
|||
## Available Functions
|
||||
|
||||
For a full list of available functions, see
|
||||
[the function reference](/docs/configuration/functions.html).
|
||||
[the function reference](/docs/language/functions/index.html).
|
||||
|
||||
## Expanding Function Arguments
|
||||
|
||||
|
@ -50,8 +50,8 @@ The expansion symbol is three periods (`...`), not a Unicode ellipsis character
|
|||
|
||||
## Using Sensitive Data as Function Arguments
|
||||
|
||||
When using sensitive data, such as [an input variable](https://www.terraform.io/docs/configuration/variables.html#suppressing-values-in-cli-output)
|
||||
or [an output defined](https://www.terraform.io/docs/configuration/outputs.html#sensitive-suppressing-values-in-cli-output) as sensitive
|
||||
When using sensitive data, such as [an input variable](https://www.terraform.io/docs/language/values/variables.html#suppressing-values-in-cli-output)
|
||||
or [an output defined](https://www.terraform.io/docs/language/values/outputs.html#sensitive-suppressing-values-in-cli-output) as sensitive
|
||||
as function arguments, the result of the function call will be marked as sensitive.
|
||||
|
||||
This is a conservative behavior that is true irrespective of the function being
|
||||
|
@ -80,10 +80,10 @@ those it can be helpful to know when Terraform will call them in relation to
|
|||
other events that occur in a Terraform run.
|
||||
|
||||
The small set of special functions includes
|
||||
[`file`](../functions/file.html),
|
||||
[`templatefile`](../functions/templatefile.html),
|
||||
[`timestamp`](../functions/timestamp.html),
|
||||
and [`uuid`](../functions/uuid.html).
|
||||
[`file`](/docs/language/functions/file.html),
|
||||
[`templatefile`](/docs/language/functions/templatefile.html),
|
||||
[`timestamp`](/docs/language/functions/timestamp.html),
|
||||
and [`uuid`](/docs/language/functions/uuid.html).
|
||||
If you are not working with these functions then you don't need
|
||||
to read this section, although the information here may still be interesting
|
||||
background information.
|
||||
|
|
|
@ -16,7 +16,7 @@ and a number of built-in functions.
|
|||
Expressions can be used in a number of places in the Terraform language,
|
||||
but some contexts limit which expression constructs are allowed,
|
||||
such as requiring a literal value of a particular type or forbidding
|
||||
[references to resource attributes](/docs/configuration/expressions/references.html#references-to-resource-attributes).
|
||||
[references to resource attributes](/docs/language/expressions/references.html#references-to-resource-attributes).
|
||||
Each language feature's documentation describes any restrictions it places on
|
||||
expressions.
|
||||
|
||||
|
@ -27,43 +27,43 @@ the Terraform expression console, by running
|
|||
The other pages in this section describe the features of Terraform's
|
||||
expression syntax.
|
||||
|
||||
- [Types and Values](/docs/configuration/expressions/types.html)
|
||||
- [Types and Values](/docs/language/expressions/types.html)
|
||||
documents the data types that Terraform expressions can resolve to, and the
|
||||
literal syntaxes for values of those types.
|
||||
|
||||
- [Strings and Templates](/docs/configuration/expressions/strings.html)
|
||||
- [Strings and Templates](/docs/language/expressions/strings.html)
|
||||
documents the syntaxes for string literals, including interpolation sequences
|
||||
and template directives.
|
||||
|
||||
- [References to Values](/docs/configuration/expressions/references.html)
|
||||
- [References to Values](/docs/language/expressions/references.html)
|
||||
documents how to refer to named values like variables and resource attributes.
|
||||
|
||||
- [Operators](/docs/configuration/expressions/operators.html)
|
||||
- [Operators](/docs/language/expressions/operators.html)
|
||||
documents the arithmetic, comparison, and logical operators.
|
||||
|
||||
- [Function Calls](/docs/configuration/expressions/function-calls.html)
|
||||
- [Function Calls](/docs/language/expressions/function-calls.html)
|
||||
documents the syntax for calling Terraform's built-in functions.
|
||||
|
||||
- [Conditional Expressions](/docs/configuration/expressions/conditionals.html)
|
||||
- [Conditional Expressions](/docs/language/expressions/conditionals.html)
|
||||
documents the `<CONDITION> ? <TRUE VAL> : <FALSE VAL>` expression, which
|
||||
chooses between two values based on a bool condition.
|
||||
|
||||
- [For Expressions](/docs/configuration/expressions/for.html)
|
||||
- [For Expressions](/docs/language/expressions/for.html)
|
||||
documents expressions like `[for s in var.list : upper(s)]`, which can
|
||||
transform a complex type value into another complex type value.
|
||||
|
||||
- [Splat Expressions](/docs/configuration/expressions/splat.html)
|
||||
- [Splat Expressions](/docs/language/expressions/splat.html)
|
||||
documents expressions like `var.list[*].id`, which can extract simpler
|
||||
collections from more complicated expressions.
|
||||
|
||||
- [Dynamic Blocks](/docs/configuration/expressions/dynamic-blocks.html)
|
||||
- [Dynamic Blocks](/docs/language/expressions/dynamic-blocks.html)
|
||||
documents a way to create multiple repeatable nested blocks within a resource
|
||||
or other construct.
|
||||
|
||||
- [Type Constraints](/docs/configuration/types.html)
|
||||
- [Type Constraints](/docs/language/expressions/type-constraints.html)
|
||||
documents the syntax for referring to a type, rather than a value of that
|
||||
type. Input variables expect this syntax in their `type` argument.
|
||||
|
||||
- [Version Constraints](/docs/configuration/version-constraints.html)
|
||||
- [Version Constraints](/docs/language/expressions/version-constraints.html)
|
||||
documents the syntax of special strings that define a set of allowed software
|
||||
versions. Terraform uses version constraints in several places.
|
||||
|
|
|
@ -56,7 +56,7 @@ as results:
|
|||
Terraform supports some other less-common numeric operations as
|
||||
[functions](function-calls.html). For example, you can calculate exponents
|
||||
using
|
||||
[the `pow` function](../functions/pow.html).
|
||||
[the `pow` function](/docs/language/functions/pow.html).
|
||||
|
||||
## Equality Operators
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ instance resource.
|
|||
|
||||
### Resources
|
||||
|
||||
`<RESOURCE TYPE>.<NAME>` represents a [managed resource](/docs/configuration/blocks/resources/index.html) of
|
||||
`<RESOURCE TYPE>.<NAME>` represents a [managed resource](/docs/language/resources/index.html) of
|
||||
the given type and name.
|
||||
|
||||
The value of a resource reference can vary, depending on whether the resource
|
||||
|
@ -58,7 +58,7 @@ For more information about how to use resource references, see
|
|||
|
||||
### Input Variables
|
||||
|
||||
`var.<NAME>` is the value of the [input variable](/docs/configuration/variables.html) of the given name.
|
||||
`var.<NAME>` is the value of the [input variable](/docs/language/values/variables.html) of the given name.
|
||||
|
||||
If the variable has a type constraint (`type` argument) as part of its
|
||||
declaration, Terraform will automatically convert the caller's given value
|
||||
|
@ -76,7 +76,7 @@ constraint all of the attributes you intend to use elsewhere in your module.
|
|||
|
||||
### Local Values
|
||||
|
||||
`local.<NAME>` is the value of the [local value](/docs/configuration/locals.html) of the given name.
|
||||
`local.<NAME>` is the value of the [local value](/docs/language/values/locals.html) of the given name.
|
||||
|
||||
Local values can refer to other local values, even within the same `locals`
|
||||
block, as long as you don't introduce circular dependencies.
|
||||
|
@ -84,12 +84,12 @@ block, as long as you don't introduce circular dependencies.
|
|||
### Child Module Outputs
|
||||
|
||||
`module.<MODULE NAME>` is an value representing the results of
|
||||
[a `module` block](../blocks/modules/).
|
||||
[a `module` block](/docs/language/modules/syntax.html).
|
||||
|
||||
If the corresponding `module` block does not have either `count` nor `for_each`
|
||||
set then the value will be an object with one attribute for each output value
|
||||
defined in the child module. To access one of the module's
|
||||
[output values](../outputs.html), use `module.<MODULE NAME>.<OUTPUT NAME>`.
|
||||
[output values](/docs/language/values/outputs.html), use `module.<MODULE NAME>.<OUTPUT NAME>`.
|
||||
|
||||
If the corresponding `module` uses `for_each` then the value will be a map
|
||||
of objects whose keys correspond with the keys in the `for_each` expression,
|
||||
|
@ -103,7 +103,7 @@ elements, each one representing one module instance.
|
|||
### Data Sources
|
||||
|
||||
`data.<DATA TYPE>.<NAME>` is an object representing a
|
||||
[data resource](/docs/configuration/data-sources.html) of the given data
|
||||
[data resource](/docs/language/data-sources/index.html) of the given data
|
||||
source type and name. If the resource has the `count` argument set, the value
|
||||
is a list of objects representing its instances. If the resource has the `for_each`
|
||||
argument set, the value is a map of objects representing its instances.
|
||||
|
@ -123,7 +123,7 @@ to mark the reference as for a data resource.
|
|||
uses of Terraform run it from a directory other than the root module
|
||||
directory, causing these paths to be different.
|
||||
* `terraform.workspace` is the name of the currently selected
|
||||
[workspace](/docs/state/workspaces.html).
|
||||
[workspace](/docs/language/state/workspaces.html).
|
||||
|
||||
Use the values in this section carefully, because they include information
|
||||
about the context in which a configuration is being applied and so may
|
||||
|
@ -163,15 +163,15 @@ These local names are described in the documentation for the specific contexts
|
|||
where they appear. Some of most common local names are:
|
||||
|
||||
- `count.index`, in resources that use
|
||||
[the `count` meta-argument](/docs/configuration/meta-arguments/count.html).
|
||||
[the `count` meta-argument](/docs/language/meta-arguments/count.html).
|
||||
- `each.key` / `each.value`, in resources that use
|
||||
[the `for_each` meta-argument](/docs/configuration/meta-arguments/for_each.html).
|
||||
- `self`, in [provisioner](/docs/provisioners/index.html) and
|
||||
[connection](/docs/provisioners/connection.html) blocks.
|
||||
[the `for_each` meta-argument](/docs/language/meta-arguments/for_each.html).
|
||||
- `self`, in [provisioner](/docs/language/resources/provisioners/syntax.html) and
|
||||
[connection](/docs/language/resources/provisioners/connection.html) blocks.
|
||||
|
||||
-> **Note:** Local names are often referred to as _variables_ or
|
||||
_temporary variables_ in their documentation. These are not [input
|
||||
variables](/docs/configuration/variables.html); they are just arbitrary names
|
||||
variables](/docs/language/values/variables.html); they are just arbitrary names
|
||||
that temporarily represent a value.
|
||||
|
||||
The names in this section relate to top-level configuration blocks only.
|
||||
|
@ -254,7 +254,7 @@ for use in references, as follows:
|
|||
`{for k, device in aws_instance.example.device : k => device.size}`.
|
||||
|
||||
When a resource has the
|
||||
[`count`](/docs/configuration/meta-arguments/count.html)
|
||||
[`count`](/docs/language/meta-arguments/count.html)
|
||||
argument set, the resource itself becomes a _list_ of instance objects rather than
|
||||
a single object. In that case, access the attributes of the instances using
|
||||
either [splat expressions](./splat.html) or index syntax:
|
||||
|
@ -264,7 +264,7 @@ either [splat expressions](./splat.html) or index syntax:
|
|||
* `aws_instance.example[0].id` returns just the id of the first instance.
|
||||
|
||||
When a resource has the
|
||||
[`for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
[`for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
argument set, the resource itself becomes a _map_ of instance objects rather than
|
||||
a single object, and attributes of instances must be specified by key, or can
|
||||
be accessed using a [`for` expression](./for.html).
|
||||
|
@ -327,9 +327,9 @@ a plan involving that attribute.
|
|||
|
||||
The treatment of these particular sensitive values is currently different than
|
||||
for values in
|
||||
[input variables](/docs/configuration/variables.html)
|
||||
[input variables](/docs/language/values/variables.html)
|
||||
and
|
||||
[output values](/docs/configuration/outputs.html)
|
||||
[output values](/docs/language/values/outputs.html)
|
||||
that have `sensitive = true` set. Sensitive resource attributes will be
|
||||
obscured in the plan when they appear directly, but other values that you
|
||||
_derive_ from a sensitive resource attribute will not themselves be considered
|
||||
|
@ -337,7 +337,7 @@ sensitive, and so Terraform will include those derived values in its output
|
|||
without redacting them.
|
||||
|
||||
Terraform v0.14.0 and later has an
|
||||
[experimental feature](/docs/configuration/terraform.html#experimental-language-features)
|
||||
[experimental feature](/docs/language/settings/index.html#experimental-language-features)
|
||||
to treat resource attributes that are marked as sensitive in the same way as
|
||||
sensitive input variables and output values, so that Terraform will consider
|
||||
any derived values as sensitive too. You can activate that experiment for your
|
||||
|
|
|
@ -48,7 +48,7 @@ tuples. To get a similar result with a map or object value you must use
|
|||
Resources that use the `for_each` argument will appear in expressions as a map
|
||||
of objects, so you can't use splat expressions with those resources.
|
||||
For more information, see
|
||||
[Referring to Resource Instances](/docs/configuration/meta-arguments/for_each.html#referring-to-instances).
|
||||
[Referring to Resource Instances](/docs/language/meta-arguments/for_each.html#referring-to-instances).
|
||||
|
||||
## Single Values as Lists
|
||||
|
||||
|
|
|
@ -75,8 +75,8 @@ allowed, but conventionally this identifier is in all-uppercase and begins with
|
|||
### Generating JSON or YAML
|
||||
|
||||
Don't use "heredoc" strings to generate JSON or YAML. Instead, use
|
||||
[the `jsonencode` function](../functions/jsonencode.html) or
|
||||
[the `yamlencode` function](../functions/yamlencode.html) so that Terraform
|
||||
[the `jsonencode` function](/docs/language/functions/jsonencode.html) or
|
||||
[the `yamlencode` function](/docs/language/functions/yamlencode.html) so that Terraform
|
||||
can be responsible for guaranteeing valid JSON or YAML syntax.
|
||||
|
||||
```hcl
|
||||
|
|
|
@ -27,9 +27,9 @@ function-like constructs called _type constructors._
|
|||
represent a type; instead, it represents a _kind_ of similar types.
|
||||
|
||||
Type constraints look like other kinds of Terraform
|
||||
[expressions](/docs/configuration/expressions/index.html), but are a special syntax. Within the
|
||||
[expressions](/docs/language/expressions/index.html), but are a special syntax. Within the
|
||||
Terraform language, they are only valid in the `type` argument of an
|
||||
[input variable](./variables.html).
|
||||
[input variable](/docs/language/values/variables.html).
|
||||
|
||||
## Primitive Types
|
||||
|
||||
|
@ -155,7 +155,7 @@ like the following:
|
|||
|
||||
The Terraform language has literal expressions for creating tuple and object
|
||||
values, which are described in
|
||||
[Expressions: Literal Expressions](/docs/configuration/expressions/types.html#literal-expressions) as
|
||||
[Expressions: Literal Expressions](/docs/language/expressions/types.html#literal-expressions) as
|
||||
"list/tuple" literals and "map/object" literals, respectively.
|
||||
|
||||
Terraform does _not_ provide any way to directly represent lists, maps, or sets.
|
||||
|
|
|
@ -93,7 +93,7 @@ The values in a map
|
|||
can be arbitrary expressions.
|
||||
|
||||
The keys in a map must be strings; they can be left unquoted if
|
||||
they are a valid [identifier](/docs/configuration/syntax.html#identifiers), but must be quoted
|
||||
they are a valid [identifier](/docs/language/syntax/configuration.html#identifiers), but must be quoted
|
||||
otherwise. You can use a non-literal string expression as a key by wrapping it in
|
||||
parentheses, like `(var.business_unit_tag_name) = "SRE"`.
|
||||
|
||||
|
@ -124,7 +124,7 @@ offer different ways to restrict the allowed values for input variables and
|
|||
resource arguments.
|
||||
|
||||
For complete details about these types (and an explanation of why the difference
|
||||
usually doesn't matter), see [Type Constraints](/docs/configuration/types.html).
|
||||
usually doesn't matter), see [Type Constraints](/docs/language/expressions/type-constraints.html).
|
||||
|
||||
## Type Conversion
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ Anywhere that Terraform lets you specify a range of acceptable versions for
|
|||
something, it expects a specially formatted string known as a version
|
||||
constraint. Version constraints are used when configuring:
|
||||
|
||||
- [Modules](/docs/configuration/blocks/modules/index.html)
|
||||
- [Provider requirements](./provider-requirements.html)
|
||||
- [The `required_version` setting](./terraform.html#specifying-a-required-terraform-version) in the `terraform` block.
|
||||
- [Modules](/docs/language/modules/index.html)
|
||||
- [Provider requirements](/docs/language/providers/requirements.html)
|
||||
- [The `required_version` setting](/docs/language/settings/index.html#specifying-a-required-terraform-version) in the `terraform` block.
|
||||
|
||||
## Version Constraint Syntax
|
||||
|
||||
|
@ -22,7 +22,7 @@ other dependency management systems like Bundler and NPM.
|
|||
version = ">= 1.2.0, < 2.0.0"
|
||||
```
|
||||
|
||||
A version constraint is a [string literal](/docs/configuration/expressions/strings.html)
|
||||
A version constraint is a [string literal](/docs/language/expressions/strings.html)
|
||||
containing one or more conditions, which are separated by commas.
|
||||
|
||||
Each condition consists of an operator and a version number.
|
||||
|
|
|
@ -9,7 +9,7 @@ page_title: "Files and Directories - Configuration Language"
|
|||
|
||||
Code in the Terraform language is stored in plain text files with the `.tf` file
|
||||
extension. There is also
|
||||
[a JSON-based variant of the language](/docs/configuration/syntax-json.html) that is named with
|
||||
[a JSON-based variant of the language](/docs/language/syntax/json.html) that is named with
|
||||
the `.tf.json` file extension.
|
||||
|
||||
Files containing Terraform code are often called _configuration files._
|
||||
|
@ -34,7 +34,7 @@ treating the entire module as a single document. Separating various blocks into
|
|||
different files is purely for the convenience of readers and maintainers, and
|
||||
has no effect on the module's behavior.
|
||||
|
||||
A Terraform module can use [module calls](/docs/configuration/blocks/modules/index.html) to
|
||||
A Terraform module can use [module calls](/docs/language/modules/index.html) to
|
||||
explicitly include other modules into the configuration. These child modules can
|
||||
come from local directories (nested in the parent module's directory, or
|
||||
anywhere else on disk), or from external sources like the
|
||||
|
|
|
@ -19,7 +19,7 @@ fallback values for failing expressions.
|
|||
|
||||
The primary purpose of `can` is to turn an error condition into a boolean
|
||||
validation result when writing
|
||||
[custom variable validation rules](../variables.html#custom-validation-rules).
|
||||
[custom variable validation rules](/docs/language/values/variables.html#custom-validation-rules).
|
||||
For example:
|
||||
|
||||
```
|
||||
|
|
|
@ -66,7 +66,7 @@ platforms.
|
|||
```
|
||||
|
||||
You can use nested `cidrsubnets` calls with
|
||||
[`for` expressions](/docs/configuration/expressions/for.html)
|
||||
[`for` expressions](/docs/language/expressions/for.html)
|
||||
to concisely allocate groups of network address blocks:
|
||||
|
||||
```
|
||||
|
|
|
@ -42,7 +42,7 @@ number of fields, or this function will produce an error.
|
|||
## Use with the `for_each` meta-argument
|
||||
|
||||
You can use the result of `csvdecode` with
|
||||
[the `for_each` meta-argument](/docs/configuration/meta-arguments/for_each.html)
|
||||
[the `for_each` meta-argument](/docs/language/meta-arguments/for_each.html)
|
||||
to describe a collection of similar objects whose differences are
|
||||
described by the rows in the given CSV file.
|
||||
|
||||
|
@ -90,7 +90,7 @@ create or destroy associated instances as appropriate.
|
|||
|
||||
If there is no reasonable value you can use as a unique identifier in your CSV
|
||||
then you could instead use
|
||||
[the `count` meta-argument](/docs/configuration/meta-arguments/count.html)
|
||||
[the `count` meta-argument](/docs/language/meta-arguments/count.html)
|
||||
to define an object for each CSV row, with each one identified by its index into
|
||||
the list returned by `csvdecode`. However, in that case any future updates to
|
||||
the CSV may be disruptive if they change the positions of particular objects in
|
||||
|
|
|
@ -11,7 +11,7 @@ description: |-
|
|||
-> **Note:** This function is available only in Terraform 0.15 and later.
|
||||
|
||||
~> **Experimental:** This function is part of
|
||||
[the optional attributes experiment](../types.html#experimental-optional-object-type-attributes)
|
||||
[the optional attributes experiment](/docs/language/expressions/type-constraints.html#experimental-optional-object-type-attributes)
|
||||
and is only available in modules where the `module_variable_optional_attrs`
|
||||
experiment is explicitly enabled.
|
||||
|
||||
|
@ -30,7 +30,7 @@ defaults(input_value, defaults)
|
|||
```
|
||||
|
||||
The `defaults` function expects that the `input_value` argument will be the
|
||||
value of an input variable with an exact [type constraint](../types.html)
|
||||
value of an input variable with an exact [type constraint](/docs/language/expressions/types.html)
|
||||
(not containing `any`). The function will then visit every attribute in
|
||||
the data structure, including attributes of nested objects, and apply the
|
||||
default values given in the defaults object.
|
||||
|
|
|
@ -65,7 +65,7 @@ before Terraform takes any actions.
|
|||
```
|
||||
|
||||
A common use of `fileset` is to create one resource instance per matched file, using
|
||||
[the `for_each` meta-argument](/docs/configuration/meta-arguments/for_each.html):
|
||||
[the `for_each` meta-argument](/docs/language/meta-arguments/for_each.html):
|
||||
|
||||
```hcl
|
||||
resource "example_thing" "example" {
|
||||
|
|
|
@ -31,9 +31,9 @@ Indirectly-nested lists, such as those in maps, are _not_ flattened.
|
|||
## Flattening nested structures for `for_each`
|
||||
|
||||
The
|
||||
[resource `for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
[resource `for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
and
|
||||
[`dynamic` block](/docs/configuration/expressions/dynamic-blocks.html)
|
||||
[`dynamic` block](/docs/language/expressions/dynamic-blocks.html)
|
||||
language features both require a collection value that has one element for
|
||||
each repetition.
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ max(5, 12, 9)
|
|||
```
|
||||
|
||||
For more details on syntax, see
|
||||
[_Function Calls_](/docs/configuration/expressions/function-calls.html)
|
||||
[_Function Calls_](/docs/language/expressions/function-calls.html)
|
||||
in the Expressions section.
|
||||
|
||||
The Terraform language does not support user-defined functions, and so only
|
||||
|
|
|
@ -15,7 +15,7 @@ of the result of decoding that string.
|
|||
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).
|
||||
|
||||
This function maps JSON values to
|
||||
[Terraform language values](/docs/configuration/expressions/types.html)
|
||||
[Terraform language values](/docs/language/expressions/types.html)
|
||||
in the following way:
|
||||
|
||||
| JSON type | Terraform type |
|
||||
|
|
|
@ -13,7 +13,7 @@ description: |-
|
|||
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).
|
||||
|
||||
This function maps
|
||||
[Terraform language values](/docs/configuration/expressions/types.html)
|
||||
[Terraform language values](/docs/language/expressions/types.html)
|
||||
to JSON values in the following way:
|
||||
|
||||
| Terraform type | JSON type |
|
||||
|
|
|
@ -20,7 +20,7 @@ tolist([a, b, c])
|
|||
|
||||
The `[ ... ]` brackets construct a tuple value, and then the `tolist` function
|
||||
then converts it to a list. For more information on the value types in the
|
||||
Terraform language, see [Type Constraints](../types.html).
|
||||
Terraform language, see [Type Constraints](/docs/language/expressions/types.html).
|
||||
|
||||
## Related Functions
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ tomap({
|
|||
|
||||
The `{ ... }` braces construct an object value, and then the `tomap` function
|
||||
then converts it to a map. For more information on the value types in the
|
||||
Terraform language, see [Type Constraints](../types.html).
|
||||
Terraform language, see [Type Constraints](/docs/language/expressions/types.html).
|
||||
|
||||
## Related Functions
|
||||
|
||||
|
|
|
@ -117,9 +117,9 @@ elements all have a consistent type:
|
|||
## Finding combinations for `for_each`
|
||||
|
||||
The
|
||||
[resource `for_each`](/docs/configuration/meta-arguments/for_each.html)
|
||||
[resource `for_each`](/docs/language/meta-arguments/for_each.html)
|
||||
and
|
||||
[`dynamic` block](/docs/configuration/expressions/dynamic-blocks.html)
|
||||
[`dynamic` block](/docs/language/expressions/dynamic-blocks.html)
|
||||
language features both require a collection value that has one element for
|
||||
each repetition.
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ templatefile(path, vars)
|
|||
```
|
||||
|
||||
The template syntax is the same as for
|
||||
[string templates](/docs/configuration/expressions/strings.html#string-templates)
|
||||
[string templates](/docs/language/expressions/strings.html#string-templates)
|
||||
in the main Terraform language, including interpolation sequences delimited with
|
||||
`${` ... `}`. This function just allows longer template sequences to be factored
|
||||
out into a separate file for readability.
|
||||
|
@ -98,7 +98,7 @@ interpolation sequences and directives.
|
|||
Instead, you can write a template that consists only of a single interpolated
|
||||
call to either [`jsonencode`](./jsonencode.html) or
|
||||
[`yamlencode`](./yamlencode.html), specifying the value to encode using
|
||||
[normal Terraform expression syntax](/docs/configuration/expressions/index.html)
|
||||
[normal Terraform expression syntax](/docs/language/expressions/index.html)
|
||||
as in the following examples:
|
||||
|
||||
```
|
||||
|
@ -118,9 +118,9 @@ this will produce a valid JSON or YAML representation of the given data
|
|||
structure, without the need to manually handle escaping or delimiters.
|
||||
In the latest examples above, the repetition based on elements of `ip_addrs` is
|
||||
achieved by using a
|
||||
[`for` expression](/docs/configuration/expressions/for.html)
|
||||
[`for` expression](/docs/language/expressions/for.html)
|
||||
rather than by using
|
||||
[template directives](/docs/configuration/expressions/strings.html#directives).
|
||||
[template directives](/docs/language/expressions/strings.html#directives).
|
||||
|
||||
```json
|
||||
{"backends":["10.0.0.1:8080","10.0.0.2:8080"]}
|
||||
|
|
|
@ -20,7 +20,7 @@ The result of this function will change every second, so using this function
|
|||
directly with resource attributes will cause a diff to be detected on every
|
||||
Terraform run. We do not recommend using this function in resource attributes,
|
||||
but in rare cases it can be used in conjunction with
|
||||
[the `ignore_changes` lifecycle meta-argument](/docs/configuration/meta-arguments/lifecycle.html#ignore_changes)
|
||||
[the `ignore_changes` lifecycle meta-argument](/docs/language/meta-arguments/lifecycle.html#ignore_changes)
|
||||
to take the timestamp only on initial creation of the resource. For more stable
|
||||
time handling, see the [Time Provider](https://registry.terraform.io/providers/hashicorp/time/).
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ This function produces a new value each time it is called, and so using it
|
|||
directly in resource arguments will result in spurious diffs. We do not
|
||||
recommend using the `uuid` function in resource configurations, but it can
|
||||
be used with care in conjunction with
|
||||
[the `ignore_changes` lifecycle meta-argument](/docs/configuration/meta-arguments/lifecycle.html#ignore_changes).
|
||||
[the `ignore_changes` lifecycle meta-argument](/docs/language/meta-arguments/lifecycle.html#ignore_changes).
|
||||
|
||||
In most cases we recommend using [the `random` provider](https://registry.terraform.io/providers/hashicorp/random/latest/docs)
|
||||
instead, since it allows the one-time generation of random values that are
|
||||
then retained in the Terraform [state](/docs/state/index.html) for use by
|
||||
then retained in the Terraform [state](/docs/language/state/index.html) for use by
|
||||
future operations. In particular,
|
||||
[`random_id`](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) can generate results with
|
||||
equivalent randomness to the `uuid` function.
|
||||
|
|
|
@ -16,7 +16,7 @@ This function supports a subset of [YAML 1.2](https://yaml.org/spec/1.2/spec.htm
|
|||
as described below.
|
||||
|
||||
This function maps YAML values to
|
||||
[Terraform language values](/docs/configuration/expressions/types.html)
|
||||
[Terraform language values](/docs/language/expressions/types.html)
|
||||
in the following way:
|
||||
|
||||
| YAML type | Terraform type |
|
||||
|
|
|
@ -29,7 +29,7 @@ results are also valid YAML because YAML is a JSON superset.
|
|||
-->
|
||||
|
||||
This function maps
|
||||
[Terraform language values](/docs/configuration/expressions/types.html)
|
||||
[Terraform language values](/docs/language/expressions/types.html)
|
||||
to YAML tags in the following way:
|
||||
|
||||
| Terraform type | YAML type |
|
||||
|
|
|
@ -19,7 +19,7 @@ heart of the workflow.
|
|||
## About the Terraform Language
|
||||
|
||||
The main purpose of the Terraform language is declaring
|
||||
[resources](/docs/configuration/blocks/resources/index.html), which represent infrastructure objects. All other
|
||||
[resources](/docs/language/resources/index.html), which represent infrastructure objects. All other
|
||||
language features exist only to make the definition of resources more flexible
|
||||
and convenient.
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ previous versions can only use it with resources.
|
|||
|
||||
> **Hands-on:** Try the [Manage Similar Resources With Count](https://learn.hashicorp.com/tutorials/terraform/count?in=terraform/0-13&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn.
|
||||
|
||||
By default, a [resource block](/docs/configuration/blocks/resources/syntax.html) configures one real
|
||||
By default, a [resource block](/docs/language/resources/syntax.html) configures one real
|
||||
infrastructure object. (Similarly, a
|
||||
[module block](/docs/configuration/blocks/modules/syntax.html) includes a
|
||||
[module block](/docs/language/modules/syntax.html) includes a
|
||||
child module's contents into the configuration one time.)
|
||||
However, sometimes you want to manage several similar objects (like a fixed
|
||||
pool of compute instances) without writing a separate block for each one.
|
||||
Terraform has two ways to do this:
|
||||
`count` and [`for_each`](/docs/configuration/meta-arguments/for_each.html).
|
||||
`count` and [`for_each`](/docs/language/meta-arguments/for_each.html).
|
||||
|
||||
If a resource or module block includes a `count` argument whose value is a whole number,
|
||||
Terraform will create that many instances.
|
||||
|
@ -58,7 +58,7 @@ This object has one attribute:
|
|||
|
||||
## Using Expressions in `count`
|
||||
|
||||
The `count` meta-argument accepts numeric [expressions](/docs/configuration/expressions/index.html).
|
||||
The `count` meta-argument accepts numeric [expressions](/docs/language/expressions/index.html).
|
||||
However, unlike most arguments, the `count` value must be known
|
||||
_before_ Terraform performs any remote resource actions. This means `count`
|
||||
can't refer to any resource attributes that aren't known until after a
|
||||
|
|
|
@ -13,14 +13,14 @@ it with resources.
|
|||
|
||||
> **Hands-on:** Try the [Manage Similar Resources With For Each](https://learn.hashicorp.com/tutorials/terraform/for-each?in=terraform/0-13&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn.
|
||||
|
||||
By default, a [resource block](/docs/configuration/blocks/resources/syntax.html) configures one real
|
||||
By default, a [resource block](/docs/language/resources/syntax.html) configures one real
|
||||
infrastructure object (and similarly, a
|
||||
[module block](/docs/configuration/blocks/modules/syntax.html) includes a
|
||||
[module block](/docs/language/modules/syntax.html) includes a
|
||||
child module's contents into the configuration one time).
|
||||
However, sometimes you want to manage several similar objects (like a fixed
|
||||
pool of compute instances) without writing a separate block for each one.
|
||||
Terraform has two ways to do this:
|
||||
[`count`](/docs/configuration/meta-arguments/count.html) and `for_each`.
|
||||
[`count`](/docs/language/meta-arguments/count.html) and `for_each`.
|
||||
|
||||
If a resource or module block includes a `for_each` argument whose value is a map or
|
||||
a set of strings, Terraform will create one instance for each member of
|
||||
|
@ -107,16 +107,16 @@ that cannot be determined before apply, and a `-target` may be needed.
|
|||
including `uuid`, `bcrypt`, or `timestamp`, as their evaluation is deferred during the
|
||||
main evaluation step.
|
||||
|
||||
Sensitive values, such as [sensitive input variables](https://www.terraform.io/docs/configuration/variables.html#suppressing-values-in-cli-output),
|
||||
[sensitive outputs](https://www.terraform.io/docs/configuration/outputs.html#sensitive-suppressing-values-in-cli-output),
|
||||
or [sensitive resource attributes](https://www.terraform.io/docs/configuration/expressions/references.html#sensitive-resource-attributes)
|
||||
Sensitive values, such as [sensitive input variables](https://www.terraform.io/docs/language/values/variables.html#suppressing-values-in-cli-output),
|
||||
[sensitive outputs](https://www.terraform.io/docs/language/values/outputs.html#sensitive-suppressing-values-in-cli-output),
|
||||
or [sensitive resource attributes](https://www.terraform.io/docs/language/expressions/references.html#sensitive-resource-attributes)
|
||||
(if the `provider_sensitive_attrs` experiment is enabled), cannot be used as arguments
|
||||
to `for_each`. The value used in `for_each` is used to identify the resource instance
|
||||
and will always be disclosed in UI output, which is why sensitive values are not allowed.
|
||||
Attempts to use sensitive values as `for_each` arguments will result in an error.
|
||||
|
||||
If you transform a value containing sensitive data into an argument to be used in `for_each`, be aware that
|
||||
[most functions in Terraform will return a sensitive result if given an argument with any sensitive content](https://www.terraform.io/docs/configuration/expressions/function-calls.html#using-sensitive-data-as-function-arguments).
|
||||
[most functions in Terraform will return a sensitive result if given an argument with any sensitive content](https://www.terraform.io/docs/language/expressions/function-calls.html#using-sensitive-data-as-function-arguments).
|
||||
In many cases, you can achieve similar results to a function used for this purpose by
|
||||
using a `for` expression. For example, if you would like to call `keys(local.map)`, where
|
||||
`local.map` is an object with sensitive values (but non-sensitive keys), you can create a
|
||||
|
@ -124,7 +124,7 @@ value to pass to `for_each` with `toset([for k,v in local.map : k])`.
|
|||
|
||||
## Using Expressions in `for_each`
|
||||
|
||||
The `for_each` meta-argument accepts map or set [expressions](/docs/configuration/expressions/index.html).
|
||||
The `for_each` meta-argument accepts map or set [expressions](/docs/language/expressions/index.html).
|
||||
However, unlike most arguments, the `for_each` value must be known
|
||||
_before_ Terraform performs any remote resource actions. This means `for_each`
|
||||
can't refer to any resource attributes that aren't known until after a
|
||||
|
@ -133,7 +133,7 @@ an object is created).
|
|||
|
||||
The `for_each` value must be a map or set with one element per desired
|
||||
resource instance. When providing a set, you must use an expression that
|
||||
explicitly returns a set value, like the [`toset`](/docs/configuration/functions/toset.html)
|
||||
explicitly returns a set value, like the [`toset`](/docs/language/functions/toset.html)
|
||||
function; to prevent unwanted surprises during conversion, the `for_each`
|
||||
argument does not implicitly convert lists or tuples to sets.
|
||||
If you need to declare resource instances based on a nested
|
||||
|
@ -142,10 +142,10 @@ can use Terraform expressions and functions to derive a suitable value.
|
|||
For example:
|
||||
|
||||
* Transform a multi-level nested structure into a flat list by
|
||||
[using nested `for` expressions with the `flatten` function](/docs/configuration/functions/flatten.html#flattening-nested-structures-for-for_each).
|
||||
[using nested `for` expressions with the `flatten` function](/docs/language/functions/flatten.html#flattening-nested-structures-for-for_each).
|
||||
* Produce an exhaustive list of combinations of elements from two or more
|
||||
collections by
|
||||
[using the `setproduct` function inside a `for` expression](/docs/configuration/functions/setproduct.html#finding-combinations-for-for_each).
|
||||
[using the `setproduct` function inside a `for` expression](/docs/language/functions/setproduct.html#finding-combinations-for-for_each).
|
||||
|
||||
## Referring to Instances
|
||||
|
||||
|
@ -172,7 +172,7 @@ as a whole.
|
|||
## Using Sets
|
||||
|
||||
The Terraform language doesn't have a literal syntax for
|
||||
[set values](/docs/configuration/types.html#collection-types), but you can use the `toset`
|
||||
[set values](/docs/language/expressions/type-constraints.html#collection-types), but you can use the `toset`
|
||||
function to explicitly convert a list of strings to a set:
|
||||
|
||||
```hcl
|
||||
|
@ -201,7 +201,7 @@ removes any duplicate elements. `toset(["b", "a", "b"])` will produce a set
|
|||
containing only `"a"` and `"b"` in no particular order; the second `"b"` is
|
||||
discarded.
|
||||
|
||||
If you are writing a module with an [input variable](/docs/configuration/variables.html) that
|
||||
If you are writing a module with an [input variable](/docs/language/values/variables.html) that
|
||||
will be used as a set of strings for `for_each`, you can set its type to
|
||||
`set(string)` to avoid the need for an explicit type conversion:
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ page_title: "The lifecycle Meta-Argument - Configuration Language"
|
|||
# The `lifecycle` Meta-Argument
|
||||
|
||||
The general lifecycle for resources is described in the
|
||||
[Resource Behavior](/docs/configuration/blocks/resources/behavior.html) page. Some details of
|
||||
[Resource Behavior](/docs/language/resources/behavior.html) page. Some details of
|
||||
that behavior can be customized using the special nested `lifecycle` block
|
||||
within a resource block body:
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ page_title: "The Module providers Meta-Argument - Configuration Language"
|
|||
|
||||
# The Module `providers` Meta-Argument
|
||||
|
||||
In a [module call](/docs/configuration/blocks/modules/syntax.html) block, the
|
||||
In a [module call](/docs/language/modules/syntax.html) block, the
|
||||
optional `providers` meta-argument specifies which
|
||||
[provider configurations](/docs/configuration/providers.html) from the parent
|
||||
[provider configurations](/docs/language/providers/configuration.html) from the parent
|
||||
module will be available inside the child module.
|
||||
|
||||
```hcl
|
||||
|
@ -120,4 +120,4 @@ names it needs.
|
|||
|
||||
For more details and guidance about working with providers inside a re-usable
|
||||
child module, see
|
||||
[Module Development: Providers Within Modules](/docs/modules/providers.html).
|
||||
[Module Development: Providers Within Modules](/docs/language/modules/develop/providers.html).
|
||||
|
|
|
@ -9,7 +9,7 @@ The `provider` meta-argument specifies which provider configuration to use for a
|
|||
overriding Terraform's default behavior of selecting one based on the resource
|
||||
type name. Its value should be an unquoted `<PROVIDER>.<ALIAS>` reference.
|
||||
|
||||
As described in [Provider Configuration](/docs/configuration/providers.html), you can optionally
|
||||
As described in [Provider Configuration](/docs/language/providers/configuration.html), you can optionally
|
||||
create multiple configurations for a single provider (usually to manage
|
||||
resources in different regions of multi-region services). Each provider can have
|
||||
one default configuration, and any number of alternate configurations that
|
||||
|
@ -51,7 +51,7 @@ ensure that the provider is fully configured before any resource actions
|
|||
are taken.
|
||||
|
||||
The `provider` meta-argument expects
|
||||
[a `<PROVIDER>.<ALIAS>` reference](/docs/configuration/providers.html#referring-to-alternate-provider-configurations),
|
||||
[a `<PROVIDER>.<ALIAS>` reference](/docs/language/providers/configuration.html#referring-to-alternate-provider-configurations),
|
||||
which does not need to be quoted. Arbitrary expressions are not permitted for
|
||||
`provider` because it must be resolved while Terraform is constructing the
|
||||
dependency graph, before it is safe to evaluate expressions.
|
||||
|
|
|
@ -310,7 +310,7 @@ Most modules contain `resource` blocks and thus describe infrastructure to be
|
|||
created and managed. It may sometimes be useful to write modules that do not
|
||||
describe any new infrastructure at all, but merely retrieve information about
|
||||
existing infrastructure that was created elsewhere using
|
||||
[data sources](/docs/configuration/data-sources.html).
|
||||
[data sources](/docs/language/data-sources/index.html).
|
||||
|
||||
As with conventional modules, we suggest using this technique only when the
|
||||
module raises the level of abstraction in some way, in this case by
|
||||
|
@ -346,7 +346,7 @@ data sources, or it could read saved information from a Consul cluster using
|
|||
[`consul_keys`](https://registry.terraform.io/providers/hashicorp/consul/latest/docs/data-sources/keys),
|
||||
or it might read the outputs directly from the state of the configuration that
|
||||
manages the network using
|
||||
[`terraform_remote_state`](https://www.terraform.io/docs/providers/terraform/d/remote_state.html).
|
||||
[`terraform_remote_state`](https://www.terraform.io/docs/language/state/remote-state-data.html).
|
||||
|
||||
The key benefit of this approach is that the source of this information can
|
||||
change over time without updating every configuration that depends on it.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue