diff --git a/README.md b/README.md index 900577641..c14a3fef4 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Show off your Terraform knowledge by passing a certification exam. Visit the [ce Developing Terraform -------------------- -This repository contains only Terraform core, which includes the command line interface and the main graph engine. Providers are implemented as plugins that each have their own repository in [the `terraform-providers` organization](https://github.com/terraform-providers) on GitHub. Instructions for developing each provider are in the associated README file. For more information, see [the provider development overview](https://www.terraform.io/docs/plugins/provider.html). +This repository contains only Terraform core, which includes the command line interface and the main graph engine. Providers are implemented as plugins, and Terraform can automatically download providers that are published on [the Terraform Registry](https://registry.terraform.io). HashiCorp develops some providers, and others are developed by other organizations. For more information, see [Extending Terraform](https://www.terraform.io/docs/extend/index.html). To learn more about compiling Terraform and contributing suggested changes, please refer to [the contributing guide](.github/CONTRIBUTING.md). diff --git a/backend/remote-state/s3/backend.go b/backend/remote-state/s3/backend.go index 525c28b81..90570d8e6 100644 --- a/backend/remote-state/s3/backend.go +++ b/backend/remote-state/s3/backend.go @@ -327,7 +327,7 @@ func (b *Backend) configure(ctx context.Context) error { AssumeRoleExternalID: data.Get("external_id").(string), AssumeRolePolicy: data.Get("assume_role_policy").(string), AssumeRoleSessionName: data.Get("session_name").(string), - CallerDocumentationURL: "https://www.terraform.io/docs/backends/types/s3.html", + CallerDocumentationURL: "https://www.terraform.io/docs/language/settings/backends/s3.html", CallerName: "S3 Backend", CredsFilename: data.Get("shared_credentials_file").(string), DebugLogging: logging.IsDebugOrHigher(), diff --git a/command/import.go b/command/import.go index 5623141f4..d58960d0b 100644 --- a/command/import.go +++ b/command/import.go @@ -343,7 +343,7 @@ func (c *ImportCommand) Synopsis() string { } const importCommandInvalidAddressReference = `For information on valid syntax, see: -https://www.terraform.io/docs/internals/resource-addressing.html` +https://www.terraform.io/docs/cli/state/resource-addressing.html` const importCommandMissingResourceFmt = `[reset][bold][red]Error:[reset][bold] resource address %q does not exist in the configuration.[reset] diff --git a/command/init.go b/command/init.go index 9b6f7dd0a..14a86dc1b 100644 --- a/command/init.go +++ b/command/init.go @@ -714,7 +714,7 @@ func (c *InitCommand) getProviders(config *configs.Config, state *states.State, if thirdPartySigned { c.Ui.Info(fmt.Sprintf("\nPartner and community providers are signed by their developers.\n" + "If you'd like to know more about provider signing, you can read about it here:\n" + - "https://www.terraform.io/docs/plugins/signing.html")) + "https://www.terraform.io/docs/cli/plugins/signing.html")) } }, HashPackageFailure: func(provider addrs.Provider, version getproviders.Version, err error) { @@ -968,7 +968,7 @@ Options: -no-color If specified, output won't contain any color. -plugin-dir Directory containing plugin binaries. This overrides all - default search paths for plugins, and prevents the + default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times. diff --git a/command/testdata/013upgrade-implicit-not-found/expected/versions.tf b/command/testdata/013upgrade-implicit-not-found/expected/versions.tf index 795fe47ef..a95ff090f 100644 --- a/command/testdata/013upgrade-implicit-not-found/expected/versions.tf +++ b/command/testdata/013upgrade-implicit-not-found/expected/versions.tf @@ -10,7 +10,7 @@ terraform { # # For more information, see the provider source documentation: # - # https://www.terraform.io/docs/configuration/providers.html#provider-source + # https://www.terraform.io/docs/language/providers/requirements.html } } required_version = ">= 0.13" diff --git a/command/testdata/013upgrade-provider-not-found/expected/main.tf b/command/testdata/013upgrade-provider-not-found/expected/main.tf index 951db47d7..e3aa388c8 100644 --- a/command/testdata/013upgrade-provider-not-found/expected/main.tf +++ b/command/testdata/013upgrade-provider-not-found/expected/main.tf @@ -16,7 +16,7 @@ terraform { # # For more information, see the provider source documentation: # - # https://www.terraform.io/docs/configuration/providers.html#provider-source + # https://www.terraform.io/docs/language/providers/requirements.html version = "~> 2.0.0" } foo = { diff --git a/commands.go b/commands.go index 569c3e8ed..7c692bd65 100644 --- a/commands.go +++ b/commands.go @@ -103,7 +103,7 @@ func initCommands( // The command list is included in the terraform -help // output, which is in turn included in the docs at - // website/docs/commands/index.html.markdown; if you + // website/docs/cli/commands/index.html.markdown; if you // add, remove or reclassify commands then consider updating // that to match. diff --git a/docs/README.md b/docs/README.md index 76e365990..2ed0af4b4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ This directory contains some documentation about the Terraform Core codebase, aimed at readers who are interested in making code contributions. If you're looking for information on _using_ Terraform, please instead refer -to [the main Terraform CLI documentation](https://www.terraform.io/docs/cli-index.html). +to [the main Terraform CLI documentation](https://www.terraform.io/docs/cli/index.html). ## Terraform Core Architecture Documents diff --git a/help.go b/help.go index 64eb03273..16bc32095 100644 --- a/help.go +++ b/help.go @@ -41,7 +41,7 @@ func helpFunc(commands map[string]cli.CommandFactory) string { sort.Strings(otherCommands) // The output produced by this is included in the docs at - // website/source/docs/commands/index.html.markdown; if you + // website/source/docs/cli/commands/index.html.markdown; if you // change this then consider updating that to match. helpText := fmt.Sprintf(` Usage: terraform [global options] [args] diff --git a/internal/legacy/terraform/resource_address.go b/internal/legacy/terraform/resource_address.go index 4acf122b3..39dc7c30c 100644 --- a/internal/legacy/terraform/resource_address.go +++ b/internal/legacy/terraform/resource_address.go @@ -92,7 +92,7 @@ func (r *ResourceAddress) String() string { // HasResourceSpec returns true if the address has a resource spec, as // defined in the documentation: -// https://www.terraform.io/docs/internals/resource-addressing.html +// https://www.terraform.io/docs/cli/state/resource-addressing.html // In particular, this returns false if the address contains only // a module path, thus addressing the entire module. func (r *ResourceAddress) HasResourceSpec() bool { diff --git a/website/docs/backends/config.html.md b/website/docs/backends/config.html.md deleted file mode 100644 index 5940a82d0..000000000 --- a/website/docs/backends/config.html.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -layout: "language" -page_title: "Backends: Configuration" -sidebar_current: "docs-backends-config" -description: |- - Backends are configured directly in Terraform files in the `terraform` section. ---- - -# Backend Configuration - -Backends are configured directly in Terraform files in the `terraform` -section. After configuring a backend, it has to be -[initialized](/docs/backends/init.html). - -Below, we show a complete example configuring the "consul" backend: - -```hcl -terraform { - backend "consul" { - address = "demo.consul.io" - scheme = "https" - path = "example_app/terraform_state" - } -} -``` - -You specify the backend type as a key to the `backend` stanza. Within the -stanza are backend-specific configuration keys. The list of supported backends -and their configuration details can be found [here](/docs/backends/types/index.html). - -Only one backend may be specified and the configuration **may not contain -interpolations**. Terraform will validate this. - -## First Time Configuration - -When configuring a backend for the first time (moving from no defined backend -to explicitly configuring one), Terraform will give you the option to migrate -your state to the new backend. This lets you adopt backends without losing -any existing state. - -To be extra careful, we always recommend manually backing up your state -as well. You can do this by simply copying your `terraform.tfstate` file -to another location. The initialization process should create a backup -as well, but it never hurts to be safe! - -Configuring a backend for the first time is no different than changing -a configuration in the future: create the new configuration and run -`terraform init`. Terraform will guide you the rest of the way. - -## Partial Configuration - -You do not need to specify every required argument in the backend configuration. -Omitting certain arguments may be desirable to avoid storing secrets, such as -access keys, within the main configuration. When some or all of the arguments -are omitted, we call this a _partial configuration_. - -With a partial configuration, the remaining configuration arguments must be -provided as part of -[the initialization process](/docs/backends/init.html#backend-initialization). -There are several ways to supply the remaining arguments: - - * **Interactively**: Terraform will interactively ask you for the required - values, unless interactive input is disabled. Terraform will not prompt for - optional values. - - * **File**: A [backend configuration file](#backend-configuration-file) may be specified via the - `init` command line. To specify a file, use the `-backend-config=PATH` - option when running `terraform init`. If the file contains secrets it may be - kept in a secure data store, such as [Vault](https://www.vaultproject.io/), - in which case it must be downloaded to the local disk before running - Terraform. - - * **Command-line key/value pairs**: Key/value pairs can be specified via the - `init` command line. Note that many shells retain command-line flags in a - history file, so this isn't recommended for secrets. To specify a single - key/value pair, use the `-backend-config="KEY=VALUE"` option when running - `terraform init`. - -If backend settings are provided in multiple locations, the top-level -settings are merged such that any command-line options override the settings -in the main configuration and then the command-line options are processed -in order, with later options overriding values set by earlier options. - -The final, merged configuration is stored on disk in the `.terraform` -directory, which should be ignored from version control. This means that -sensitive information can be omitted from version control, but it will be -present in plain text on local disk when running Terraform. - -When using partial configuration, Terraform requires at a minimum that -an empty backend configuration is specified in one of the root Terraform -configuration files, to specify the backend type. For example: - -```hcl -terraform { - backend "consul" {} -} -``` - -## Backend Configuration File -A backend configuration file has the contents of the `backend` block as -top-level attributes, without the need to wrap it in another `terraform` -or `backend` block: - -```hcl -address = "demo.consul.io" -path = "example_app/terraform_state" -scheme = "https" -``` - -The same settings can alternatively be specified on the command line as -follows: - -``` -$ terraform init \ - -backend-config="address=demo.consul.io" \ - -backend-config="path=example_app/terraform_state" \ - -backend-config="scheme=https" -``` - -## Changing Configuration - -You can change your backend configuration at any time. You can change -both the configuration itself as well as the type of backend (for example -from "consul" to "s3"). - -Terraform will automatically detect any changes in your configuration -and request a [reinitialization](/docs/backends/init.html). As part of -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), -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. - -If you're just reconfiguring the same backend, Terraform will still ask if you -want to migrate your state. You can respond "no" in this scenario. - -## Unconfiguring a Backend - -If you no longer want to use any backend, you can simply remove the -configuration from the file. Terraform will detect this like any other -change and prompt you to [reinitialize](/docs/backends/init.html). - -As part of the reinitialization, Terraform will ask if you'd like to migrate -your state back down to normal local state. Once this is complete then -Terraform is back to behaving as it does by default. diff --git a/website/docs/backends/index.html.md b/website/docs/backends/index.html.md deleted file mode 100644 index e6bb09b5b..000000000 --- a/website/docs/backends/index.html.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -layout: "language" -page_title: "Backends" -sidebar_current: "docs-backends-index" -description: |- - A "backend" in Terraform determines how state is loaded and how an operation such as `apply` is executed. This abstraction enables non-local file state storage, remote execution, etc. ---- - -# Backends - -A "backend" in Terraform determines how state is loaded and how an operation -such as `apply` is executed. This abstraction enables non-local file state -storage, remote execution, etc. - -By default, Terraform uses the "local" backend, which is the normal behavior -of Terraform you're used to. This is the backend that was being invoked -throughout the [introduction](/intro/index.html). - -Here are some of the benefits of backends: - - * **Working in a team**: Backends can store their state remotely and - protect that state with locks to prevent corruption. Some backends - such as Terraform Cloud even automatically store a history of - all state revisions. - - * **Keeping sensitive information off disk**: State is retrieved from - backends on demand and only stored in memory. If you're using a backend - such as Amazon S3, the only location the state ever is persisted is in - S3. - - * **Remote operations**: For larger infrastructures or certain changes, - `terraform apply` can take a long, long time. Some backends support - remote operations which enable the operation to execute remotely. You can - then turn off your computer and your operation will still complete. Paired - with remote state storage and locking above, this also helps in team - environments. - -**Backends are completely optional**. You can successfully use Terraform without -ever having to learn or use backends. However, they do solve pain points that -afflict teams at a certain scale. If you're an individual, you can likely -get away with never using backends. - -Even if you only intend to use the "local" backend, it may be useful to -learn about backends since you can also change the behavior of the local -backend. diff --git a/website/docs/backends/init.html.md b/website/docs/backends/init.html.md deleted file mode 100644 index 7346db392..000000000 --- a/website/docs/backends/init.html.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -layout: "language" -page_title: "Backends: Init" -sidebar_current: "docs-backends-init" -description: |- - Terraform must initialize any configured backend before use. This can be done by simply running `terraform init`. ---- - -# Backend Initialization - -Terraform must initialize any configured backend before use. This can be -done by simply running `terraform init`. - -The `terraform init` command should be run by any member of your team on -any Terraform configuration as a first step. It is safe to execute multiple -times and performs all the setup actions required for a Terraform environment, -including initializing the backend. - -The `init` command must be called: - - * On any new environment that configures a backend - * On any change of the backend configuration (including type of backend) - * On removing backend configuration completely - -You don't need to remember these exact cases. Terraform will detect when -initialization is required and error in that situation. Terraform doesn't -auto-initialize because it may require additional information from the user, -perform state migrations, etc. - -The `init` command will do more than just initialize the backend. Please see -the [init documentation](/docs/commands/init.html) for more information. diff --git a/website/docs/backends/operations.html.md b/website/docs/backends/operations.html.md deleted file mode 100644 index 755d2c9e9..000000000 --- a/website/docs/backends/operations.html.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -layout: "language" -page_title: "Backends: Remote Operations (plan, apply, etc.)" -sidebar_current: "docs-backends-operations" -description: |- - Some backends support the ability to run operations (`refresh`, `plan`, `apply`, etc.) remotely. Terraform will continue to look and behave as if they're running locally while they in fact run on a remote machine. ---- - -# Remote Operations (plan, apply, etc.) - -Most backends run all operations on the local system — although Terraform stores -its state remotely with these backends, it still executes its logic locally and -makes API requests directly from the system where it was invoked. - -This is simple to understand and work with, but when many people are -collaborating on the same Terraform configurations, it requires everyone's -execution environment to be similar. This includes sharing access to -infrastructure provider credentials, keeping Terraform versions in sync, -keeping Terraform variables in sync, and installing any extra software required -by Terraform providers. This becomes more burdensome as teams get larger. - -Some backends can run operations (`plan`, `apply`, etc.) on a remote machine, -while appearing to execute locally. This enables a more consistent execution -environment and more powerful access controls, without disrupting workflows -for users who are already comfortable with running Terraform. - -Currently, [the `remote` backend](./types/remote.html) is the only backend to -support remote operations, and [Terraform Cloud](/docs/cloud/index.html) -is the only remote execution environment that supports it. For more information, see: - -- [The `remote` backend](./types/remote.html) -- [Terraform Cloud's CLI-driven run workflow](/docs/cloud/run/cli.html) diff --git a/website/docs/backends/types/index.html.md b/website/docs/backends/types/index.html.md deleted file mode 100644 index 5ec60ee6f..000000000 --- a/website/docs/backends/types/index.html.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: "language" -page_title: "Backend: Supported Backend Types" -sidebar_current: "docs-backends-types-index" -description: |- - Terraform can store the state remotely, making it easier to version and work with in a team. ---- - -# Backend Types - -This section documents the various backend types supported by Terraform. -If you're not familiar with backends, please -[read the sections about backends](/docs/backends/index.html) first. - -Backends may support differing levels of features in Terraform. We differentiate -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) - - * **Enhanced**: Everything in standard plus - [remote operations](/docs/backends/operations.html). - -The backends are separated in the left by standard and enhanced. diff --git a/website/docs/cli/auth/index.html.md b/website/docs/cli/auth/index.html.md index 0400da546..794f23119 100644 --- a/website/docs/cli/auth/index.html.md +++ b/website/docs/cli/auth/index.html.md @@ -25,5 +25,5 @@ Terraform Cloud user account. For details, see: -- [The `terraform login` command](/docs/commands/login.html) -- [The `terraform logout` command](/docs/commands/logout.html) +- [The `terraform login` command](/docs/cli/commands/login.html) +- [The `terraform logout` command](/docs/cli/commands/logout.html) diff --git a/website/docs/cli/code/index.html.md b/website/docs/cli/code/index.html.md index 3c72083c4..01dba636c 100644 --- a/website/docs/cli/code/index.html.md +++ b/website/docs/cli/code/index.html.md @@ -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. @@ -13,18 +13,18 @@ Terraform CLI includes several commands to make Terraform code more convenient to work with. Integrating these commands into your editing workflow can potentially save you time and effort. -- [The `terraform console` command](/docs/commands/console.html) starts an +- [The `terraform console` command](/docs/cli/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. -- [The `terraform fmt` command](/docs/commands/fmt.html) rewrites Terraform +- [The `terraform fmt` command](/docs/cli/commands/fmt.html) rewrites Terraform configuration files to a canonical format and style, so you don't have to waste time making minor adjustments for readability and consistency. It works well as a pre-commit hook in your version control system. -- [The `terraform validate` command](/docs/commands/validate.html) validates the +- [The `terraform validate` command](/docs/cli/commands/validate.html) validates the syntax and arguments of the Terraform configuration files in a directory, including argument and attribute names and types for resources and modules. The `plan` and `apply` commands automatically validate a configuration before @@ -32,8 +32,8 @@ potentially save you time and effort. workflow, but it can be very useful as a pre-commit hook or as part of a continuous integration pipeline. -- [The `0.13upgrade` command](/docs/commands/0.13upgrade.html) and - [the `0.12upgrade` command](/docs/commands/0.12upgrade.html) can automatically +- [The `0.13upgrade` command](/docs/cli/commands/0.13upgrade.html) and + [the `0.12upgrade` command](/docs/cli/commands/0.12upgrade.html) can automatically modify the configuration files in a Terraform module to help deal with major syntax changes that occurred in the 0.13 and 0.12 releases of Terraform. Both of these commands are only available in the Terraform version they are diff --git a/website/docs/commands/0.12upgrade.html.markdown b/website/docs/cli/commands/0.12upgrade.html.md similarity index 96% rename from website/docs/commands/0.12upgrade.html.markdown rename to website/docs/cli/commands/0.12upgrade.html.md index d5354d82a..59ff0de44 100644 --- a/website/docs/commands/0.12upgrade.html.markdown +++ b/website/docs/cli/commands/0.12upgrade.html.md @@ -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: diff --git a/website/docs/commands/0.13upgrade.html.markdown b/website/docs/cli/commands/0.13upgrade.html.md similarity index 98% rename from website/docs/commands/0.13upgrade.html.markdown rename to website/docs/cli/commands/0.13upgrade.html.md index 28d948155..52ff42067 100644 --- a/website/docs/commands/0.13upgrade.html.markdown +++ b/website/docs/cli/commands/0.13upgrade.html.md @@ -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. diff --git a/website/docs/commands/apply.html.markdown b/website/docs/cli/commands/apply.html.md similarity index 88% rename from website/docs/commands/apply.html.markdown rename to website/docs/cli/commands/apply.html.md index fe15702fc..3e1430f33 100644 --- a/website/docs/commands/apply.html.markdown +++ b/website/docs/cli/commands/apply.html.md @@ -56,27 +56,27 @@ 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 + Address](/docs/cli/state/resource-addressing.html) to target. For more information, see - [the targeting docs from `terraform plan`](/docs/commands/plan.html#resource-targeting). + [the targeting docs from `terraform plan`](/docs/cli/commands/plan.html#resource-targeting). * `-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 @@ -100,6 +100,6 @@ current working directory. If your previous use of this legacy pattern was also relying on Terraform writing the `.terraform` subdirectory into the current working directory even though the root module directory was overridden, use -[the `TF_DATA_DIR` environment variable](environment-variables.html#tf_data_dir) +[the `TF_DATA_DIR` environment variable](/docs/cli/config/environment-variables.html#tf_data_dir) to direct Terraform to write the `.terraform` directory to a location other than the current working directory. diff --git a/website/docs/commands/console.html.markdown b/website/docs/cli/commands/console.html.md similarity index 77% rename from website/docs/commands/console.html.markdown rename to website/docs/cli/commands/console.html.md index 5e146c791..7d300078c 100644 --- a/website/docs/commands/console.html.markdown +++ b/website/docs/cli/commands/console.html.md @@ -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. diff --git a/website/docs/commands/destroy.html.markdown b/website/docs/cli/commands/destroy.html.md similarity index 87% rename from website/docs/commands/destroy.html.markdown rename to website/docs/cli/commands/destroy.html.md index f07c357a4..dd490aa63 100644 --- a/website/docs/commands/destroy.html.markdown +++ b/website/docs/cli/commands/destroy.html.md @@ -19,13 +19,13 @@ Infrastructure managed by Terraform will be destroyed. This will ask for confirmation before destroying. This command accepts all the arguments and options that the [apply -command](/docs/commands/apply.html) accepts, with the exception of a plan file +command](/docs/cli/commands/apply.html) accepts, with the exception of a plan file argument. If `-auto-approve` is set, then the destroy confirmation will not be shown. The `-target` flag, instead of affecting "dependencies" will instead also -destroy any resources that _depend on_ the target(s) specified. For more information, see [the targeting docs from `terraform plan`](/docs/commands/plan.html#resource-targeting). +destroy any resources that _depend on_ the target(s) specified. For more information, see [the targeting docs from `terraform plan`](/docs/cli/commands/plan.html#resource-targeting). The behavior of any `terraform destroy` command can be previewed at any time with an equivalent `terraform plan -destroy` command. diff --git a/website/docs/commands/env.html.markdown b/website/docs/cli/commands/env.html.md similarity index 78% rename from website/docs/commands/env.html.markdown rename to website/docs/cli/commands/env.html.md index e1ec830e7..3d1183d29 100644 --- a/website/docs/commands/env.html.markdown +++ b/website/docs/cli/commands/env.html.md @@ -9,5 +9,5 @@ description: |- # Command: env The `terraform env` command is deprecated. -[The `terraform workspace` command](/docs/commands/workspace/) +[The `terraform workspace` command](/docs/cli/commands/workspace/index.html) should be used instead. diff --git a/website/docs/commands/fmt.html.markdown b/website/docs/cli/commands/fmt.html.md similarity index 97% rename from website/docs/commands/fmt.html.markdown rename to website/docs/cli/commands/fmt.html.md index 5003fe9d3..b07a97df7 100644 --- a/website/docs/commands/fmt.html.markdown +++ b/website/docs/cli/commands/fmt.html.md @@ -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 diff --git a/website/docs/commands/force-unlock.html.markdown b/website/docs/cli/commands/force-unlock.html.md similarity index 100% rename from website/docs/commands/force-unlock.html.markdown rename to website/docs/cli/commands/force-unlock.html.md diff --git a/website/docs/commands/get.html.markdown b/website/docs/cli/commands/get.html.md similarity index 89% rename from website/docs/commands/get.html.markdown rename to website/docs/cli/commands/get.html.md index 80cbf4a5e..b847fecd6 100644 --- a/website/docs/commands/get.html.markdown +++ b/website/docs/cli/commands/get.html.md @@ -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 diff --git a/website/docs/commands/graph.html.markdown b/website/docs/cli/commands/graph.html.md similarity index 100% rename from website/docs/commands/graph.html.markdown rename to website/docs/cli/commands/graph.html.md diff --git a/website/docs/commands/import.html.md b/website/docs/cli/commands/import.html.md similarity index 93% rename from website/docs/commands/import.html.md rename to website/docs/cli/commands/import.html.md index 5a8e1b72f..1406404eb 100644 --- a/website/docs/commands/import.html.md +++ b/website/docs/cli/commands/import.html.md @@ -11,7 +11,7 @@ description: |- > **Hands-on:** Try the [Import Terraform Configuration](https://learn.hashicorp.com/tutorials/terraform/state-import?in=terraform/state&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. The `terraform import` command is used to -[import existing resources](/docs/import/index.html) +[import existing resources](/docs/cli/import/index.html) into Terraform. ## Usage @@ -21,7 +21,7 @@ Usage: `terraform import [options] ADDRESS ID` Import will find the existing resource from ID and import it into your Terraform state at the given ADDRESS. -ADDRESS must be a valid [resource address](/docs/internals/resource-addressing.html). +ADDRESS must be a valid [resource address](/docs/cli/state/resource-addressing.html). Because any resource address is valid, the import command can import resources into modules as well as directly into the root of your state. @@ -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: diff --git a/website/docs/commands/index.html.markdown b/website/docs/cli/commands/index.html.md similarity index 97% rename from website/docs/commands/index.html.markdown rename to website/docs/cli/commands/index.html.md index 2374d71d8..d579a951c 100644 --- a/website/docs/commands/index.html.markdown +++ b/website/docs/cli/commands/index.html.md @@ -101,7 +101,7 @@ will be read or written in the given directory instead. There are two exceptions where Terraform will use the original working directory even when you specify `-chdir=...`: -* Settings in the [CLI Configuration](cli-config.html) are not for a specific +* Settings in the [CLI Configuration](/docs/cli/config/config-file.html) are not for a specific subcommand and Terraform processes them before acting on the `-chdir` option. @@ -154,7 +154,7 @@ Checkpoint itself can be entirely disabled for all HashiCorp products by setting the environment variable `CHECKPOINT_DISABLE` to any non-empty value. Alternatively, settings in -[the CLI configuration file](/docs/commands/cli-config.html) can be used to +[the CLI configuration file](/docs/cli/config/config-file.html) can be used to disable checkpoint features. The following checkpoint-related settings are supported in this file: diff --git a/website/docs/commands/init.html.markdown b/website/docs/cli/commands/init.html.md similarity index 89% rename from website/docs/commands/init.html.markdown rename to website/docs/cli/commands/init.html.md index 3863f3ce2..21ef20470 100644 --- a/website/docs/commands/init.html.markdown +++ b/website/docs/cli/commands/init.html.md @@ -75,7 +75,7 @@ activating credentials) before running `terraform init`. ## Backend Initialization During init, the root configuration directory is consulted for -[backend configuration](/docs/backends/config.html) and the chosen backend +[backend configuration](/docs/language/settings/backends/configuration.html) and the chosen backend is initialized using the given configuration settings. Re-running init with an already-initialized backend will update the working @@ -91,14 +91,14 @@ when the working directory was already previously initialized for a particular backend. The `-backend-config=...` option can be used for -[partial backend configuration](/docs/backends/config.html#partial-configuration), +[partial backend configuration](/docs/language/settings/backends/configuration.html#partial-configuration), in situations where the backend settings are dynamic or sensitive and so cannot 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 @@ -123,13 +123,13 @@ third-party provider registry, `terraform init` will automatically find, download, and install the necessary provider plugins. If you cannot or do not wish to install providers from their origin registries, you can customize how Terraform installs providers using -[the provider installation settings in the CLI configuration](./cli-config.html#provider-installation). +[the provider installation settings in the CLI configuration](/docs/cli/config/config-file.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 @@ -145,15 +145,15 @@ You can modify `terraform init`'s plugin behavior with the following options: - `-get-plugins=false` — Skip plugin installation. -> Note: Since Terraform 0.13, this option has been superseded by the - [`provider_installation`](./cli-config.html#provider-installation) and - [`plugin_cache_dir`](./cli-config.html#plugin_cache_dir) settings. + [`provider_installation`](/docs/cli/config/config-file.html#provider-installation) and + [`plugin_cache_dir`](/docs/cli/config/config-file.html#plugin_cache_dir) settings. It should not be used in Terraform versions 0.13+, and this option was removed in Terraform 0.15. - `-plugin-dir=PATH` — Force plugin installation to read plugins _only_ from the specified directory, as if it had been configured as a `filesystem_mirror` in the CLI configuration. If you intend to routinely use a particular filesystem mirror then we recommend - [configuring Terraform's installation methods globally](./cli-config.html#provider-installation). + [configuring Terraform's installation methods globally](/docs/cli/config/config-file.html#provider-installation). You can use `-plugin-dir` as a one-time override for exceptional situations, such as if you are testing a local build of a provider plugin you are currently developing. @@ -187,6 +187,6 @@ current working directory. If your previous use of this legacy pattern was also relying on Terraform writing the `.terraform` subdirectory into the current working directory even though the root module directory was overridden, use -[the `TF_DATA_DIR` environment variable](environment-variables.html#tf_data_dir) +[the `TF_DATA_DIR` environment variable](/docs/cli/config/environment-variables.html#tf_data_dir) to direct Terraform to write the `.terraform` directory to a location other than the current working directory. diff --git a/website/docs/commands/login.html.markdown b/website/docs/cli/commands/login.html.md similarity index 91% rename from website/docs/commands/login.html.markdown rename to website/docs/cli/commands/login.html.md index 085781f54..8af1ef7a4 100644 --- a/website/docs/commands/login.html.markdown +++ b/website/docs/cli/commands/login.html.md @@ -15,7 +15,7 @@ API token for Terraform Cloud, Terraform Enterprise, or any other host that offe where it is possible to launch a web browser on the same host where Terraform is running. If you are running Terraform in an unattended automation scenario, you can -[configure credentials manually in the CLI configuration](https://www.terraform.io/docs/commands/cli-config.html#credentials). +[configure credentials manually in the CLI configuration](https://www.terraform.io/docs/cli/config/config-file.html#credentials). ## Usage @@ -34,7 +34,7 @@ not as desired. If you don't wish to store your API token in the default location, you can optionally configure a -[credentials helper program](cli-config.html#credentials-helpers) which knows +[credentials helper program](/docs/cli/config/config-file.html#credentials-helpers) which knows how to store and later retrieve credentials in some other system, such as your organization's existing secrets management system. diff --git a/website/docs/commands/logout.html.markdown b/website/docs/cli/commands/logout.html.md similarity index 91% rename from website/docs/commands/logout.html.markdown rename to website/docs/cli/commands/logout.html.md index 644ff5171..15656fba9 100644 --- a/website/docs/commands/logout.html.markdown +++ b/website/docs/cli/commands/logout.html.md @@ -26,5 +26,5 @@ the remote server, so it will remain valid until manually revoked. By default, Terraform will remove the token stored in plain text in a local CLI configuration file called `credentials.tfrc.json`. If you have configured a -[credentials helper program](cli-config.html#credentials-helpers), Terraform +[credentials helper program](/docs/cli/config/config-file.html#credentials-helpers), Terraform will use the helper's `forget` command to remove it. diff --git a/website/docs/commands/output.html.markdown b/website/docs/cli/commands/output.html.md similarity index 97% rename from website/docs/commands/output.html.markdown rename to website/docs/cli/commands/output.html.md index 8d58e6515..1a828612d 100644 --- a/website/docs/commands/output.html.markdown +++ b/website/docs/cli/commands/output.html.md @@ -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 diff --git a/website/docs/commands/plan.html.markdown b/website/docs/cli/commands/plan.html.md similarity index 92% rename from website/docs/commands/plan.html.markdown rename to website/docs/cli/commands/plan.html.md index 8f7f9ebe7..647bedd34 100644 --- a/website/docs/commands/plan.html.markdown +++ b/website/docs/cli/commands/plan.html.md @@ -70,19 +70,19 @@ 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 + Address](/docs/cli/state/resource-addressing.html) to target. This flag can be used multiple times. See below for more information. * `-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 @@ -93,7 +93,7 @@ The available options are: The `-target` option can be used to focus Terraform's attention on only a subset of resources. -[Resource Address](/docs/internals/resource-addressing.html) syntax is used +[Resource Address](/docs/cli/state/resource-addressing.html) syntax is used to specify the constraint. The resource address is interpreted as follows: * If the given address has a _resource spec_, only the specified resource @@ -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. @@ -150,6 +150,6 @@ current working directory. If your previous use of this legacy pattern was also relying on Terraform writing the `.terraform` subdirectory into the current working directory even though the root module directory was overridden, use -[the `TF_DATA_DIR` environment variable](environment-variables.html#tf_data_dir) +[the `TF_DATA_DIR` environment variable](/docs/cli/config/environment-variables.html#tf_data_dir) to direct Terraform to write the `.terraform` directory to a location other than the current working directory. diff --git a/website/docs/commands/providers.html.markdown b/website/docs/cli/commands/providers.html.md similarity index 87% rename from website/docs/commands/providers.html.markdown rename to website/docs/cli/commands/providers.html.md index 4da6a4e3b..3c3bb7d0b 100644 --- a/website/docs/commands/providers.html.markdown +++ b/website/docs/cli/commands/providers.html.md @@ -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. diff --git a/website/docs/commands/providers/lock.html.md b/website/docs/cli/commands/providers/lock.html.md similarity index 93% rename from website/docs/commands/providers/lock.html.md rename to website/docs/cli/commands/providers/lock.html.md index 0a570a1b4..b9a48fae7 100644 --- a/website/docs/commands/providers/lock.html.md +++ b/website/docs/cli/commands/providers/lock.html.md @@ -11,15 +11,15 @@ 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 -[`terraform init`](../init.html), but there are several situations where that +[`terraform init`](/docs/cli/commands/init.html), but there are several situations where that automatic approach may not be sufficient: * If you are running Terraform in an environment that uses - [alternative provider installation methods](../cli-config.html#provider-installation), + [alternative provider installation methods](/docs/cli/config/config-file.html#provider-installation), such as filesystem or network mirrors, normal provider installation will not access the origin registry for a provider and therefore Terraform will not be able to populate all of the possible package checksums for the selected @@ -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. @@ -150,7 +150,7 @@ multiple times and specify a different subset of your providers each time. The `-fs-mirror` and `-net-mirror` options have the same meaning as `filesystem_mirror` and `network_mirror` blocks in -[the provider installation methods configuration](../cli-config.html#provider-installation), +[the provider installation methods configuration](/docs/cli/config/config-file.html#provider-installation), but specify only a single method in order to be explicit about where you intend to derive the package checksum information from. diff --git a/website/docs/commands/providers/mirror.html.md b/website/docs/cli/commands/providers/mirror.html.md similarity index 95% rename from website/docs/commands/providers/mirror.html.md rename to website/docs/cli/commands/providers/mirror.html.md index 829508d2f..b0827837e 100644 --- a/website/docs/commands/providers/mirror.html.md +++ b/website/docs/cli/commands/providers/mirror.html.md @@ -19,7 +19,7 @@ from provider registries as part of initializing the current working directory. Sometimes Terraform is running in an environment where that isn't possible, such as on an isolated network without access to the Terraform Registry. In that case, -[explicit installation method configuration](../cli-config.html#explicit-installation-method-configuration) +[explicit installation method configuration](/docs/cli/config/config-file.html#explicit-installation-method-configuration) allows you to configure Terraform, when running on a particular system, to consult only a local filesystem directory where you've created a local mirror of the necessary plugins, and to skip accessing the upstream registry at all. diff --git a/website/docs/commands/providers/schema.html.md b/website/docs/cli/commands/providers/schema.html.md similarity index 100% rename from website/docs/commands/providers/schema.html.md rename to website/docs/cli/commands/providers/schema.html.md diff --git a/website/docs/commands/push.html.markdown b/website/docs/cli/commands/push.html.md similarity index 75% rename from website/docs/commands/push.html.markdown rename to website/docs/cli/commands/push.html.md index 927920b35..bc093a85c 100644 --- a/website/docs/commands/push.html.markdown +++ b/website/docs/cli/commands/push.html.md @@ -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. diff --git a/website/docs/commands/refresh.html.markdown b/website/docs/cli/commands/refresh.html.md similarity index 87% rename from website/docs/commands/refresh.html.markdown rename to website/docs/cli/commands/refresh.html.md index d8f44c8d7..517b76f00 100644 --- a/website/docs/commands/refresh.html.markdown +++ b/website/docs/cli/commands/refresh.html.md @@ -43,24 +43,24 @@ 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 + Address](/docs/cli/state/resource-addressing.html) to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times. * `-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 diff --git a/website/docs/commands/show.html.markdown b/website/docs/cli/commands/show.html.md similarity index 96% rename from website/docs/commands/show.html.markdown rename to website/docs/cli/commands/show.html.md index bb0cd7c41..3c78d6d00 100644 --- a/website/docs/commands/show.html.markdown +++ b/website/docs/cli/commands/show.html.md @@ -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 diff --git a/website/docs/commands/state/index.html.md b/website/docs/cli/commands/state/index.html.md similarity index 91% rename from website/docs/commands/state/index.html.md rename to website/docs/cli/commands/state/index.html.md index e3faf2460..38e2028d9 100644 --- a/website/docs/commands/state/index.html.md +++ b/website/docs/cli/commands/state/index.html.md @@ -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. @@ -35,7 +35,7 @@ written to disk and the CLI usage is the same as if it were local state. All `terraform state` subcommands that modify the state write backup files. The path of these backup file can be controlled with `-backup`. -Subcommands that are read-only (such as [list](/docs/commands/state/list.html)) +Subcommands that are read-only (such as [list](/docs/cli/commands/state/list.html)) do not write any backup files since they aren't modifying the state. Note that backups for state modification _can not be disabled_. Due to diff --git a/website/docs/commands/state/list.html.md b/website/docs/cli/commands/state/list.html.md similarity index 90% rename from website/docs/commands/state/list.html.md rename to website/docs/cli/commands/state/list.html.md index 23d637128..a7b78c94b 100644 --- a/website/docs/commands/state/list.html.md +++ b/website/docs/cli/commands/state/list.html.md @@ -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 @@ -25,12 +25,12 @@ within modules are listed last. For complex infrastructures, the state can contain thousands of resources. To filter these, provide one or more patterns to the command. Patterns are -in [resource addressing format](/docs/commands/state/addressing.html). +in [resource addressing format](/docs/cli/state/resource-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 diff --git a/website/docs/commands/state/mv.html.md b/website/docs/cli/commands/state/mv.html.md similarity index 94% rename from website/docs/commands/state/mv.html.md rename to website/docs/cli/commands/state/mv.html.md index 683bbcbc6..66fcbb764 100644 --- a/website/docs/commands/state/mv.html.md +++ b/website/docs/cli/commands/state/mv.html.md @@ -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. @@ -36,7 +36,7 @@ for each state file. This command requires a source and destination address of the item to move. Addresses are -in [resource addressing format](/docs/commands/state/addressing.html). +in [resource addressing format](/docs/cli/state/resource-addressing.html). The command-line flags are all optional. The list of available flags are: @@ -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: diff --git a/website/docs/commands/state/pull.html.md b/website/docs/cli/commands/state/pull.html.md similarity index 89% rename from website/docs/commands/state/pull.html.md rename to website/docs/cli/commands/state/pull.html.md index f6aa69b97..af2122668 100644 --- a/website/docs/commands/state/pull.html.md +++ b/website/docs/cli/commands/state/pull.html.md @@ -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 diff --git a/website/docs/commands/state/push.html.md b/website/docs/cli/commands/state/push.html.md similarity index 92% rename from website/docs/commands/state/push.html.md rename to website/docs/cli/commands/state/push.html.md index bbd295d60..1481e6bfe 100644 --- a/website/docs/commands/state/push.html.md +++ b/website/docs/cli/commands/state/push.html.md @@ -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 diff --git a/website/docs/commands/state/replace-provider.html.md b/website/docs/cli/commands/state/replace-provider.html.md similarity index 96% rename from website/docs/commands/state/replace-provider.html.md rename to website/docs/cli/commands/state/replace-provider.html.md index f950943d2..e98373729 100644 --- a/website/docs/commands/state/replace-provider.html.md +++ b/website/docs/cli/commands/state/replace-provider.html.md @@ -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 diff --git a/website/docs/commands/state/rm.html.md b/website/docs/cli/commands/state/rm.html.md similarity index 92% rename from website/docs/commands/state/rm.html.md rename to website/docs/cli/commands/state/rm.html.md index 60f88f337..556a99d58 100644 --- a/website/docs/commands/state/rm.html.md +++ b/website/docs/cli/commands/state/rm.html.md @@ -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. @@ -39,7 +39,7 @@ of this command, backups are required. This command requires one or more addresses that point to a resources in the state. Addresses are -in [resource addressing format](/docs/commands/state/addressing.html). +in [resource addressing format](/docs/cli/state/resource-addressing.html). The command-line flags are all optional. The list of available flags are: @@ -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: diff --git a/website/docs/commands/state/show.html.md b/website/docs/cli/commands/state/show.html.md similarity index 84% rename from website/docs/commands/state/show.html.md rename to website/docs/cli/commands/state/show.html.md index 85f53d95c..2c665ba64 100644 --- a/website/docs/commands/state/show.html.md +++ b/website/docs/cli/commands/state/show.html.md @@ -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 @@ -21,16 +21,16 @@ state file that matches the given address. This command requires an address that points to a single resource in the state. Addresses are -in [resource addressing format](/docs/commands/state/addressing.html). +in [resource addressing format](/docs/cli/state/resource-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 -[`terraform show -json`](../show.html#json-output) and decode the result +[`terraform show -json`](/docs/cli/commands/show.html#json-output) and decode the result using the documented structure. ## Example: Show a Resource @@ -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: diff --git a/website/docs/commands/taint.html.markdown b/website/docs/cli/commands/taint.html.md similarity index 89% rename from website/docs/commands/taint.html.markdown rename to website/docs/cli/commands/taint.html.md index 14dbf039c..9ef2982fa 100644 --- a/website/docs/commands/taint.html.markdown +++ b/website/docs/cli/commands/taint.html.md @@ -14,9 +14,9 @@ as tainted, forcing it to be destroyed and recreated on the next apply. This command _will not_ modify infrastructure, but does modify the state file in order to mark a resource as tainted. Once a resource is marked as tainted, the next -[plan](/docs/commands/plan.html) will show that the resource will +[plan](/docs/cli/commands/plan.html) will show that the resource will be destroyed and recreated and the next -[apply](/docs/commands/apply.html) will implement this change. +[apply](/docs/cli/commands/apply.html) will implement this change. Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. @@ -28,7 +28,7 @@ Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially new IP address of a tainted server. The -[plan command](/docs/commands/plan.html) will show this if this is +[plan command](/docs/cli/commands/plan.html) will show this if this is the case. ## Usage @@ -37,7 +37,7 @@ Usage: `terraform taint [options] address` The `address` argument is the address of the resource to mark as tainted. The address is in -[the resource address syntax](/docs/internals/resource-addressing.html) syntax, +[the resource address syntax](/docs/cli/state/resource-addressing.html) syntax, as shown in the output from other commands, such as: * `aws_instance.foo` @@ -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: diff --git a/website/docs/commands/untaint.html.markdown b/website/docs/cli/commands/untaint.html.md similarity index 95% rename from website/docs/commands/untaint.html.markdown rename to website/docs/cli/commands/untaint.html.md index 520795fc6..85aab17d8 100644 --- a/website/docs/commands/untaint.html.markdown +++ b/website/docs/cli/commands/untaint.html.md @@ -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. diff --git a/website/docs/commands/validate.html.markdown b/website/docs/cli/commands/validate.html.md similarity index 100% rename from website/docs/commands/validate.html.markdown rename to website/docs/cli/commands/validate.html.md diff --git a/website/docs/commands/version.html.markdown b/website/docs/cli/commands/version.html.md similarity index 92% rename from website/docs/commands/version.html.markdown rename to website/docs/cli/commands/version.html.md index 5ee38419e..713bfb6e3 100644 --- a/website/docs/commands/version.html.markdown +++ b/website/docs/cli/commands/version.html.md @@ -17,7 +17,7 @@ Usage: `terraform version [options]` With no additional arguments, `version` will display the version of Terraform, the platform it's installed on, installed providers, and the results of upgrade -and security checks [unless disabled](/docs/commands/index.html#upgrade-and-security-bulletin-checks). +and security checks [unless disabled](/docs/cli/commands/index.html#upgrade-and-security-bulletin-checks). This command has one optional flag: diff --git a/website/docs/commands/workspace/delete.html.md b/website/docs/cli/commands/workspace/delete.html.md similarity index 100% rename from website/docs/commands/workspace/delete.html.md rename to website/docs/cli/commands/workspace/delete.html.md diff --git a/website/docs/commands/workspace/index.html.md b/website/docs/cli/commands/workspace/index.html.md similarity index 90% rename from website/docs/commands/workspace/index.html.md rename to website/docs/cli/commands/workspace/index.html.md index 354d96e25..cf60ded67 100644 --- a/website/docs/commands/workspace/index.html.md +++ b/website/docs/cli/commands/workspace/index.html.md @@ -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. diff --git a/website/docs/commands/workspace/list.html.md b/website/docs/cli/commands/workspace/list.html.md similarity index 100% rename from website/docs/commands/workspace/list.html.md rename to website/docs/cli/commands/workspace/list.html.md diff --git a/website/docs/commands/workspace/new.html.md b/website/docs/cli/commands/workspace/new.html.md similarity index 100% rename from website/docs/commands/workspace/new.html.md rename to website/docs/cli/commands/workspace/new.html.md diff --git a/website/docs/commands/workspace/select.html.md b/website/docs/cli/commands/workspace/select.html.md similarity index 100% rename from website/docs/commands/workspace/select.html.md rename to website/docs/cli/commands/workspace/select.html.md diff --git a/website/docs/commands/workspace/show.html.md b/website/docs/cli/commands/workspace/show.html.md similarity index 100% rename from website/docs/commands/workspace/show.html.md rename to website/docs/cli/commands/workspace/show.html.md diff --git a/website/docs/commands/cli-config.html.markdown b/website/docs/cli/config/config-file.html.md similarity index 98% rename from website/docs/commands/cli-config.html.markdown rename to website/docs/cli/config/config-file.html.md index d2c4aeaaf..97ba3a7d6 100644 --- a/website/docs/commands/cli-config.html.markdown +++ b/website/docs/cli/config/config-file.html.md @@ -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 @@ -33,7 +33,7 @@ as just `terraform.rc`. Use `dir` from PowerShell or Command Prompt to confirm the filename. The location of the Terraform CLI configuration file can also be specified -using the `TF_CLI_CONFIG_FILE` [environment variable](/docs/commands/environment-variables.html). +using the `TF_CLI_CONFIG_FILE` [environment variable](/docs/cli/config/environment-variables.html). ## Configuration File Syntax @@ -60,7 +60,7 @@ The following settings can be set in the CLI configuration file: See [Credentials Helpers](#credentials-helpers) below for more information. - `disable_checkpoint` — when set to `true`, disables - [upgrade and security bulletin checks](/docs/commands/index.html#upgrade-and-security-bulletin-checks) + [upgrade and security bulletin checks](/docs/cli/commands/index.html#upgrade-and-security-bulletin-checks) that require reaching out to HashiCorp-provided network services. - `disable_checkpoint_signature` — when set to `true`, allows the upgrade and @@ -93,7 +93,7 @@ credentials "app.terraform.io" { } ``` -If you are running the Terraform CLI interactively on a computer with a web browser, you can use [the `terraform login` command](./login.html) +If you are running the Terraform CLI interactively on a computer with a web browser, you can use [the `terraform login` command](/docs/cli/commands/login.html) to get credentials and automatically save them in the CLI configuration. If not, you can manually write `credentials` blocks. @@ -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 diff --git a/website/docs/commands/environment-variables.html.md b/website/docs/cli/config/environment-variables.html.md similarity index 94% rename from website/docs/commands/environment-variables.html.md rename to website/docs/cli/config/environment-variables.html.md index ed003332e..891f8d231 100644 --- a/website/docs/commands/environment-variables.html.md +++ b/website/docs/cli/config/environment-variables.html.md @@ -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 @@ -145,7 +145,7 @@ export TF_REGISTRY_CLIENT_TIMEOUT=15 ## TF_CLI_CONFIG_FILE -The location of the [Terraform CLI configuration file](/docs/commands/cli-config.html). +The location of the [Terraform CLI configuration file](/docs/cli/config/config-file.html). ```shell export TF_CLI_CONFIG_FILE="$HOME/.terraformrc-custom" @@ -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). diff --git a/website/docs/cli/config/index.html.md b/website/docs/cli/config/index.html.md index deb63b59b..dbac33b53 100644 --- a/website/docs/cli/config/index.html.md +++ b/website/docs/cli/config/index.html.md @@ -14,9 +14,9 @@ most of the global settings relate to advanced or automated workflows, or unusual environmental conditions like running Terraform on an airgapped instance. -- The [CLI config file](/docs/commands/cli-config.html) configures provider +- The [CLI config file](/docs/cli/config/config-file.html) configures provider installation and security features. -- Several [environment variables](/docs/commands/environment-variables.html) can +- Several [environment variables](/docs/cli/config/environment-variables.html) can configure Terraform's inputs and outputs; this includes some alternate ways to provide information that is usually passed on the command line or read from the state of the shell. diff --git a/website/docs/import/importability.html.md b/website/docs/cli/import/importability.html.md similarity index 88% rename from website/docs/import/importability.html.md rename to website/docs/cli/import/importability.html.md index dde7cb682..79d78d90a 100644 --- a/website/docs/import/importability.html.md +++ b/website/docs/cli/import/importability.html.md @@ -20,5 +20,5 @@ Converting a resource to be importable is also relatively simple, so if you're interested in contributing that functionality, the Terraform team would be grateful. -To make a resource importable, please see the -[plugin documentation on writing a resource](/docs/plugins/provider.html). +To make a resource importable, please see +[Extending Terraform: Resources — Import](/docs/extend/resources/import.html). diff --git a/website/docs/import/index.html.md b/website/docs/cli/import/index.html.md similarity index 90% rename from website/docs/import/index.html.md rename to website/docs/cli/import/index.html.md index 5127e076c..10eb64fb6 100644 --- a/website/docs/import/index.html.md +++ b/website/docs/cli/import/index.html.md @@ -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. diff --git a/website/docs/import/usage.html.md b/website/docs/cli/import/usage.html.md similarity index 95% rename from website/docs/import/usage.html.md rename to website/docs/cli/import/usage.html.md index 57fdb4d76..4fdc5452d 100644 --- a/website/docs/import/usage.html.md +++ b/website/docs/cli/import/usage.html.md @@ -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: @@ -57,7 +57,7 @@ Terraform state. It is also possible to import to resources in child modules, using their paths, and to single instances of a resource with `count` or `for_each` set. See -[_Resource Addressing_](/docs/internals/resource-addressing.html) for more +[_Resource Addressing_](/docs/cli/state/resource-addressing.html) for more details on how to specify a target resource. The syntax of the given ID is dependent on the resource type being imported. @@ -83,4 +83,4 @@ a `resource` block in configuration for each secondary resource. If this is not done, Terraform will plan to destroy the imported objects on the next run. If you want to rename or otherwise move the imported resources, the -[state management commands](/docs/commands/state/index.html) can be used. +[state management commands](/docs/cli/commands/state/index.html) can be used. diff --git a/website/docs/cli-index.html.md b/website/docs/cli/index.html.md similarity index 92% rename from website/docs/cli-index.html.md rename to website/docs/cli/index.html.md index 43854ee7d..6d66974e5 100644 --- a/website/docs/cli-index.html.md +++ b/website/docs/cli/index.html.md @@ -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). diff --git a/website/docs/cli/init/index.html.md b/website/docs/cli/init/index.html.md index f72a0921b..ee6372b0f 100644 --- a/website/docs/cli/init/index.html.md +++ b/website/docs/cli/init/index.html.md @@ -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. @@ -47,7 +47,7 @@ plugins, and downloading modules. Under some conditions (usually when changing from one backend to another), it might ask the user for guidance or confirmation. -For details, see [the `terraform init` command](/docs/commands/init.html). +For details, see [the `terraform init` command](/docs/cli/commands/init.html). ## Reinitialization diff --git a/website/docs/cli/inspect/index.html.md b/website/docs/cli/inspect/index.html.md index de6899107..f704c0398 100644 --- a/website/docs/cli/inspect/index.html.md +++ b/website/docs/cli/inspect/index.html.md @@ -15,19 +15,19 @@ Terraform CLI includes some commands for inspecting or transforming this data. You can use these to integrate other tools with Terraform's infrastructure data, or just to gain a deeper or more holistic understanding of your infrastructure. -- [The `terraform graph` command](/docs/commands/graph.html) creates a visual +- [The `terraform graph` command](/docs/cli/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 +- [The `terraform output` command](/docs/cli/commands/output.html) can get the + 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 +- [The `terraform show` command](/docs/cli/commands/show.html) can generate human-readable versions of a state file or plan file, or generate machine-readable versions that can be integrated with other tools. -- [The `terraform state list` command](/docs/commands/state/list.html) can list +- [The `terraform state list` command](/docs/cli/commands/state/list.html) can list the resources being managed by the current working directory and workspace, providing a complete or filtered list. -- [The `terraform state show` command](/docs/commands/state/show.html) can print +- [The `terraform state show` command](/docs/cli/commands/state/show.html) can print all of the attributes of a given resource being managed by the current working directory and workspace, including generated read-only attributes like the unique ID assigned by the cloud provider. diff --git a/website/docs/cli/plugins/index.html.md b/website/docs/cli/plugins/index.html.md index bae835eea..c1ac5e1e6 100644 --- a/website/docs/cli/plugins/index.html.md +++ b/website/docs/cli/plugins/index.html.md @@ -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. @@ -30,29 +30,29 @@ environments. Terraform's configuration file includes options for caching downloaded plugins, or explicitly specifying a local or HTTPS mirror to install plugins from. For -more information, see [CLI Config File](/docs/commands/cli-config.html). +more information, see [CLI Config File](/docs/cli/config/config-file.html). ## Getting Plugin Information -Use the [`terraform providers`](/docs/commands/providers.html) command to get information +Use the [`terraform providers`](/docs/cli/commands/providers.html) command to get information about the providers required by the current working directory's configuration. -Use the [`terraform version`](/docs/commands/version.html) command (or +Use the [`terraform version`](/docs/cli/commands/version.html) command (or `terraform -version`) to show the specific provider versions installed for the current working directory. -Use the [`terraform providers schema`](/docs/commands/providers/schema.html) command to +Use the [`terraform providers schema`](/docs/cli/commands/providers/schema.html) command to get machine-readable information about the resources and configuration options offered by each provider. ## Managing Plugin Installation -Use the [`terraform providers mirror`](/docs/commands/providers/mirror.html) command to +Use the [`terraform providers mirror`](/docs/cli/commands/providers/mirror.html) command to download local copies of every provider required by the current working directory's configuration. This directory will use the nested directory layout that Terraform expects when installing plugins from a local source, so you can transfer it directly to an airgapped system that runs Terraform. -Use the [`terraform providers lock`](/docs/commands/providers/lock.html) command +Use the [`terraform providers lock`](/docs/cli/commands/providers/lock.html) command to update the lock file that Terraform uses to ensure predictable runs when using ambiguous provider version constraints. diff --git a/website/docs/plugins/signing.html.md b/website/docs/cli/plugins/signing.html.md similarity index 93% rename from website/docs/plugins/signing.html.md rename to website/docs/cli/plugins/signing.html.md index ad2d9b5f6..95c8e935f 100644 --- a/website/docs/plugins/signing.html.md +++ b/website/docs/cli/plugins/signing.html.md @@ -1,7 +1,6 @@ --- -layout: "registry" +layout: "docs" page_title: "Plugin Signing" -sidebar_current: "docs-plugins-signing" description: |- Terraform plugin signing trust levels --- @@ -15,7 +14,7 @@ description: |- Terraform providers installed from the Registry are cryptographically signed, and the signature is verified at time of installation. There are three types of provider signatures, each with different trust implications: * **Signed by HashiCorp** - are built, signed, and supported by HashiCorp. -* **Signed by Trusted Partners** - are built, signed, and supported by a third party. HashiCorp has +* **Signed by Trusted Partners** - are built, signed, and supported by a third party. HashiCorp has verified the ownership of the private key and we provide a chain of trust to the CLI to verify this programatically. * **Self-signed** - are built, signed, and supported by a third party. HashiCorp does not provide a diff --git a/website/docs/cli/run/index.html.md b/website/docs/cli/run/index.html.md index d7fec11ce..579c9d81b 100644 --- a/website/docs/cli/run/index.html.md +++ b/website/docs/cli/run/index.html.md @@ -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 @@ -38,7 +38,7 @@ resulting actions are as expected. However, `terraform plan` can also save its plan as a runnable artifact, which `terraform apply` can use to carry out those exact changes. -For details, see [the `terraform plan` command](/docs/commands/plan.html). +For details, see [the `terraform plan` command](/docs/cli/commands/plan.html). ## Applying @@ -54,7 +54,7 @@ running a new plan. You can use this to reliably perform an exact set of pre-approved changes, even if the configuration or the state of the real infrastructure has changed in the minutes since the original plan was created. -For details, see [the `terraform apply` command](/docs/commands/apply.html). +For details, see [the `terraform apply` command](/docs/cli/commands/apply.html). ## Destroying @@ -68,4 +68,4 @@ and then running an apply, except that it doesn't require editing the configuration. This is more convenient if you intend to provision similar resources at a later date. -For details, see [the `terraform destroy` command](/docs/commands/destroy.html). +For details, see [the `terraform destroy` command](/docs/cli/commands/destroy.html). diff --git a/website/docs/cli/state/index.html.md b/website/docs/cli/state/index.html.md index 3a35e4fe5..8448de795 100644 --- a/website/docs/cli/state/index.html.md +++ b/website/docs/cli/state/index.html.md @@ -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. @@ -21,7 +21,7 @@ Terraform CLI supports several workflows for interacting with state: - [Forcing Re-creation (Tainting)](/docs/cli/state/taint.html) - [Moving Resources](/docs/cli/state/move.html) - Importing Pre-existing Resources (documented in the - [Importing Infrastructure](/docs/import/index.html) section) + [Importing Infrastructure](/docs/cli/import/index.html) section) - [Disaster Recovery](/docs/cli/state/recover.html) ~> **Important:** Modifying state data outside a normal plan or apply can cause diff --git a/website/docs/cli/state/inspect.html.md b/website/docs/cli/state/inspect.html.md index eb9792236..53ccc6f95 100644 --- a/website/docs/cli/state/inspect.html.md +++ b/website/docs/cli/state/inspect.html.md @@ -8,14 +8,14 @@ page_title: "Inspecting State - Terraform CLI" Terraform includes some commands for reading and updating state without taking any other actions. -- [The `terraform state list` command](/docs/commands/state/list.html) +- [The `terraform state list` command](/docs/cli/commands/state/list.html) shows the resource addresses for every resource Terraform knows about in a configuration, optionally filtered by partial resource address. -- [The `terraform state show` command](/docs/commands/state/show.html) +- [The `terraform state show` command](/docs/cli/commands/state/show.html) displays detailed state data about one resource. -- [The `terraform refresh` command](/docs/commands/refresh.html) updates +- [The `terraform refresh` command](/docs/cli/commands/refresh.html) updates state data to match the real-world condition of the managed resources. This is done automatically during plans and applies, but not when interacting with state directly. diff --git a/website/docs/cli/state/move.html.md b/website/docs/cli/state/move.html.md index b4cd62d90..87bb7198d 100644 --- a/website/docs/cli/state/move.html.md +++ b/website/docs/cli/state/move.html.md @@ -6,7 +6,7 @@ page_title: "Moving Resources - Terraform CLI" # Moving Resources Terraform's state associates each real-world object with a configured resource -at a specific [resource address](/docs/internals/resource-addressing.html). This +at a specific [resource address](/docs/cli/state/resource-addressing.html). This is seamless when changing a resource's attributes, but Terraform will lose track of a resource if you change its name, move it to a different module, or change its provider. @@ -19,17 +19,17 @@ In cases where it's important to preserve an existing infrastructure object, you can explicitly tell Terraform to associate it with a different configured resource. -- [The `terraform state mv` command](/docs/commands/state/mv.html) changes +- [The `terraform state mv` command](/docs/cli/commands/state/mv.html) changes which resource address in your configuration is associated with a particular real-world object. Use this to preserve an object when renaming a resource, or when moving a resource into or out of a child module. -- [The `terraform state rm` command](/docs/commands/state/rm.html) tells +- [The `terraform state rm` command](/docs/cli/commands/state/rm.html) tells Terraform to stop managing a resource as part of the current working directory and workspace, _without_ destroying the corresponding real-world object. (You can later use `terraform import` to start managing that resource in a different workspace or a different Terraform configuration.) -- [The `terraform state replace-provider` command](/docs/commands/state/replace-provider.html) +- [The `terraform state replace-provider` command](/docs/cli/commands/state/replace-provider.html) transfers existing resources to a new provider without requiring them to be re-created. diff --git a/website/docs/cli/state/recover.html.md b/website/docs/cli/state/recover.html.md index a8e55f3f6..5b45b8f6f 100644 --- a/website/docs/cli/state/recover.html.md +++ b/website/docs/cli/state/recover.html.md @@ -9,7 +9,7 @@ If something has gone horribly wrong (possibly due to accidents when performing other state manipulation actions), you might need to take drastic actions with your state data. -- [The `terraform force-unlock` command](/docs/commands/force-unlock.html) can +- [The `terraform force-unlock` command](/docs/cli/commands/force-unlock.html) can override the protections Terraform uses to prevent two processes from modifying state at the same time. You might need this if a Terraform process (like a normal apply) is unexpectedly terminated (like by the complete @@ -17,8 +17,8 @@ your state data. state backend. Do not run this until you are completely certain what happened to the process that caused the lock to get stuck. -- [The `terraform state pull` command](/docs/commands/state/pull.html) and - [the `terraform state push` command](/docs/commands/state/push.html) can +- [The `terraform state pull` command](/docs/cli/commands/state/pull.html) and + [the `terraform state push` command](/docs/cli/commands/state/push.html) can directly read and write entire state files from and to the configured backend. You might need this for obtaining or restoring a state backup. diff --git a/website/docs/internals/resource-addressing.html.markdown b/website/docs/cli/state/resource-addressing.html.md similarity index 100% rename from website/docs/internals/resource-addressing.html.markdown rename to website/docs/cli/state/resource-addressing.html.md diff --git a/website/docs/cli/state/taint.html.md b/website/docs/cli/state/taint.html.md index 433e80591..12162c36d 100644 --- a/website/docs/cli/state/taint.html.md +++ b/website/docs/cli/state/taint.html.md @@ -16,10 +16,10 @@ happen during creation; for example, a virtual machine that configures itself with `cloud-init` on startup might no longer meet your needs if the cloud-init configuration changes. -- [The `terraform taint` command](/docs/commands/taint.html) tells Terraform to +- [The `terraform taint` command](/docs/cli/commands/taint.html) tells Terraform to destroy and re-create a particular resource during the next apply, regardless of whether its resource arguments would normally require that. -- [The `terraform untaint` command](/docs/commands/untaint.html) undoes a +- [The `terraform untaint` command](/docs/cli/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). diff --git a/website/docs/cli/workspaces/index.html.md b/website/docs/cli/workspaces/index.html.md index afb7d164c..f6a76a0e6 100644 --- a/website/docs/cli/workspaces/index.html.md +++ b/website/docs/cli/workspaces/index.html.md @@ -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. @@ -17,11 +17,11 @@ resources with the same configuration. - Most Terraform commands (including [provisioning](/docs/cli/run/index.html) and [state manipulation](/docs/cli/state/index.html) commands) only interact with the currently selected workspace. -- Use [the `terraform workspace select` command](/docs/commands/workspace/select.html) +- Use [the `terraform workspace select` command](/docs/cli/commands/workspace/select.html) to change the currently selected workspace. -- Use the [`terraform workspace list`](/docs/commands/workspace/list.html), - [`terraform workspace new`](/docs/commands/workspace/new.html), and - [`terraform workspace delete`](/docs/commands/workspace/delete.html) commands +- Use the [`terraform workspace list`](/docs/cli/commands/workspace/list.html), + [`terraform workspace new`](/docs/cli/commands/workspace/new.html), and + [`terraform workspace delete`](/docs/cli/commands/workspace/delete.html) commands to manage the available workspaces in the current working directory. -> **Note:** Terraform Cloud and Terraform CLI both have features called @@ -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. diff --git a/website/docs/commands/state/addressing.html.md b/website/docs/commands/state/addressing.html.md deleted file mode 100644 index 323b58839..000000000 --- a/website/docs/commands/state/addressing.html.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: "docs" -page_title: "Command: state resource addressing" -sidebar_current: "docs-commands-state-address" -description: |- - The `terraform state` command is used for advanced state management. ---- - -# Resource Addressing - -The `terraform state` subcommands use -[standard address syntax](/docs/internals/resource-addressing.html) to refer -to individual resources, resource instances, and modules. This is the same -syntax used for the `-target` option to the `apply` and `plan` commands. - -Most state commands allow referring to individual resource instances, whole -resources (which may have multiple instances if `count` or `for_each` is used), -or even whole modules. - -For more information on the syntax, see [Resource Addressing](/docs/internals/resource-addressing.html). diff --git a/website/docs/configuration-0-11/data-sources.html.md b/website/docs/configuration-0-11/data-sources.html.md index 908a24d4b..90f3463e3 100644 --- a/website/docs/configuration-0-11/data-sources.html.md +++ b/website/docs/configuration-0-11/data-sources.html.md @@ -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 diff --git a/website/docs/configuration-0-11/environment-variables.html.md b/website/docs/configuration-0-11/environment-variables.html.md index 85a5468ec..979980884 100644 --- a/website/docs/configuration-0-11/environment-variables.html.md +++ b/website/docs/configuration-0-11/environment-variables.html.md @@ -10,7 +10,7 @@ description: |- -> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12 and later, see -[Commands: Environment Variables](../commands/environment-variables.html). +[Commands: Environment Variables](/docs/cli/config/environment-variables.html). ## TF_LOG @@ -48,7 +48,7 @@ export TF_INPUT=0 ## TF_MODULE_DEPTH -When given a value, causes terraform commands to behave as if the `-module-depth=VALUE` flag was specified. By setting this to 0, for example, you enable commands such as [plan](/docs/commands/plan.html) and [graph](/docs/commands/graph.html) to display more compressed information. +When given a value, causes terraform commands to behave as if the `-module-depth=VALUE` flag was specified. By setting this to 0, for example, you enable commands such as [plan](/docs/cli/commands/plan.html) and [graph](/docs/cli/commands/graph.html) to display more compressed information. ```shell export TF_MODULE_DEPTH=0 diff --git a/website/docs/configuration-0-11/index.html.md b/website/docs/configuration-0-11/index.html.md index f804ba11d..35982822a 100644 --- a/website/docs/configuration-0-11/index.html.md +++ b/website/docs/configuration-0-11/index.html.md @@ -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 diff --git a/website/docs/configuration-0-11/interpolation.html.md b/website/docs/configuration-0-11/interpolation.html.md index aac18e5af..9ec65d8aa 100644 --- a/website/docs/configuration-0-11/interpolation.html.md +++ b/website/docs/configuration-0-11/interpolation.html.md @@ -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..`. 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 @@ -98,7 +98,7 @@ path of the root module. In general, you probably want the The syntax is `terraform.`. This variable type contains metadata about the currently executing Terraform run. FIELD can currently only be `env` to -reference the currently active [state environment](/docs/state/environments.html). +reference the currently active workspace. ## Conditionals @@ -560,7 +560,7 @@ Operator precedences is the standard mathematical order of operations: "${2 * (4 + 3) * 3}" # computes to 42 ``` -You can use the [terraform console](/docs/commands/console.html) command to +You can use the [terraform console](/docs/cli/commands/console.html) command to try the math operations. -> **Note:** Since Terraform allows hyphens in resource and variable names, diff --git a/website/docs/configuration-0-11/load.html.md b/website/docs/configuration-0-11/load.html.md index b2831c471..b95adffab 100644 --- a/website/docs/configuration-0-11/load.html.md +++ b/website/docs/configuration-0-11/load.html.md @@ -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 diff --git a/website/docs/configuration-0-11/locals.html.md b/website/docs/configuration-0-11/locals.html.md index a72f6a79a..b23a5b3a1 100644 --- a/website/docs/configuration-0-11/locals.html.md +++ b/website/docs/configuration-0-11/locals.html.md @@ -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. diff --git a/website/docs/configuration-0-11/modules.html.md b/website/docs/configuration-0-11/modules.html.md index 180f88571..25f2984d7 100644 --- a/website/docs/configuration-0-11/modules.html.md +++ b/website/docs/configuration-0-11/modules.html.md @@ -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 @@ -386,7 +386,7 @@ giving each instance a unique name -- here `module "assets_bucket"` and Resources from child modules are prefixed with `module.` when displayed in plan output and elsewhere in the UI. For example, the `./publish_bucket` module contains `aws_s3_bucket.example`, and so the two -instances of this module produce S3 bucket resources with [_resource addresses_](/docs/internals/resource-addressing.html) +instances of this module produce S3 bucket resources with [_resource addresses_](/docs/cli/state/resource-addressing.html) `module.assets_bucket.aws_s3_bucket.example` and `module.media_bucket.aws_s3_bucket.example` respectively. These full addresses are used within the UI and on the command line, but are not valid within interpolation expressions due to the @@ -405,7 +405,7 @@ several regions or datacenters. ## Tainting resources within a module -The [taint command](/docs/commands/taint.html) can be used to _taint_ specific +The [taint command](/docs/cli/commands/taint.html) can be used to _taint_ specific resources within a module: ```shell diff --git a/website/docs/configuration-0-11/outputs.html.md b/website/docs/configuration-0-11/outputs.html.md index 565f1b6f8..cf9e8b434 100644 --- a/website/docs/configuration-0-11/outputs.html.md +++ b/website/docs/configuration-0-11/outputs.html.md @@ -10,11 +10,11 @@ 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 -[output command](/docs/commands/output.html). +[output command](/docs/cli/commands/output.html). Terraform knows a lot about the infrastructure it manages. Most resources have attributes associated with them, and diff --git a/website/docs/configuration-0-11/override.html.md b/website/docs/configuration-0-11/override.html.md index 7ae4036d1..83411f592 100644 --- a/website/docs/configuration-0-11/override.html.md +++ b/website/docs/configuration-0-11/override.html.md @@ -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_, diff --git a/website/docs/configuration-0-11/providers.html.md b/website/docs/configuration-0-11/providers.html.md index 5fbcecbec..2450f38e6 100644 --- a/website/docs/configuration-0-11/providers.html.md +++ b/website/docs/configuration-0-11/providers.html.md @@ -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, @@ -79,7 +79,7 @@ distributed by HashiCorp. See [Third-party Plugins](#third-party-plugins) below for installation instructions. For more information, see -[the `terraform init` command](/docs/commands/init.html). +[the `terraform init` command](/docs/cli/commands/init.html). ## Provider Versions @@ -118,7 +118,7 @@ provider "aws" { ``` This special argument applies to _all_ providers. -[`terraform providers`](/docs/commands/providers.html) can be used to +[`terraform providers`](/docs/cli/commands/providers.html) can be used to view the specified version constraints for all providers used in the current configuration. @@ -295,7 +295,7 @@ use of a local directory as a shared plugin cache, which then allows each distinct plugin binary to be downloaded only once. To enable the plugin cache, use the `plugin_cache_dir` setting in -[the CLI configuration file](https://www.terraform.io/docs/commands/cli-config.html). +[the CLI configuration file](https://www.terraform.io/docs/cli/config/config-file.html). For example: ```hcl diff --git a/website/docs/configuration-0-11/resources.html.md b/website/docs/configuration-0-11/resources.html.md index db0172781..8b31603f4 100644 --- a/website/docs/configuration-0-11/resources.html.md +++ b/website/docs/configuration-0-11/resources.html.md @@ -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. diff --git a/website/docs/configuration-0-11/syntax.html.md b/website/docs/configuration-0-11/syntax.html.md index c40ee1713..8c0e57d31 100644 --- a/website/docs/configuration-0-11/syntax.html.md +++ b/website/docs/configuration-0-11/syntax.html.md @@ -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 diff --git a/website/docs/configuration-0-11/terraform-enterprise.html.md b/website/docs/configuration-0-11/terraform-enterprise.html.md index f42005b11..8c5ee7f38 100644 --- a/website/docs/configuration-0-11/terraform-enterprise.html.md +++ b/website/docs/configuration-0-11/terraform-enterprise.html.md @@ -13,9 +13,9 @@ feature that was removed in Terraform 0.12. ~> **Important:** The `terraform push` command is deprecated, and only works with the legacy version of Terraform Enterprise. In the current version of Terraform Cloud, you can upload configurations using the API. See [the docs about API-driven runs](/docs/cloud/run/api.html) for more details. -The [`terraform push` command](/docs/commands/push.html) uploads a configuration to a Terraform Enterprise (legacy) environment. The name of the environment (and the organization it's in) can be specified on the command line, or as part of the Terraform configuration in an `atlas` block. +The [`terraform push` command](/docs/cli/commands/push.html) uploads a configuration to a Terraform Enterprise (legacy) environment. The name of the environment (and the organization it's in) can be specified on the command line, or as part of the Terraform configuration in an `atlas` block. -The `atlas` block does not configure remote state; it only configures the push command. For remote state, [use a `terraform { backend "" {...} }` block](/docs/backends/config.html). +The `atlas` block does not configure remote state; it only configures the push command. For remote state, use a `terraform { backend "" {...} }` block. This page assumes you're familiar with the [configuration syntax](./syntax.html) @@ -40,7 +40,7 @@ Enterprise**. While this transition is in progress, you may see references to ## Description The `atlas` block configures the settings when Terraform is -[pushed](/docs/commands/push.html) to Terraform Enterprise. Only one `atlas` block +[pushed](/docs/cli/commands/push.html) to Terraform Enterprise. Only one `atlas` block is allowed. Within the block (the `{ }`) is configuration for Atlas uploading. @@ -50,7 +50,7 @@ No keys are required, but the key typically set is `name`. to the nature of this configuration, interpolations are not possible. If you want to parameterize these settings, use the Atlas block to set defaults, then use the command-line flags of the -[push command](/docs/commands/push.html) to override. +[push command](/docs/cli/commands/push.html) to override. ## Syntax diff --git a/website/docs/configuration-0-11/terraform.html.md b/website/docs/configuration-0-11/terraform.html.md index 42cc563d4..e7911ffee 100644 --- a/website/docs/configuration-0-11/terraform.html.md +++ b/website/docs/configuration-0-11/terraform.html.md @@ -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. @@ -41,7 +41,7 @@ that must be met to perform operations on this configuration. If the running Terraform version doesn't meet these constraints, an error is shown. See the section below dedicated to this option. -See [backends](/docs/backends/index.html) for more detail on the `backend` +See [backends](/docs/language/settings/backends/configuration.html) for more detail on the `backend` configuration. **No value within the `terraform` block can use interpolations.** The diff --git a/website/docs/configuration-0-11/variables.html.md b/website/docs/configuration-0-11/variables.html.md index cc2f4aa86..6fbcf5451 100644 --- a/website/docs/configuration-0-11/variables.html.md +++ b/website/docs/configuration-0-11/variables.html.md @@ -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. diff --git a/website/docs/configuration/expressions.html.md b/website/docs/configuration/expressions.html.md index c9e9afd04..9aa59acde 100644 --- a/website/docs/configuration/expressions.html.md +++ b/website/docs/configuration/expressions.html.md @@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
diff --git a/website/docs/configuration/modules.html.md b/website/docs/configuration/modules.html.md index d5575436b..1dbcf06a1 100644 --- a/website/docs/configuration/modules.html.md +++ b/website/docs/configuration/modules.html.md @@ -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).
@@ -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).
@@ -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).
diff --git a/website/docs/configuration/resources.html.md b/website/docs/configuration/resources.html.md index 013b9c115..87ae1bf5f 100644 --- a/website/docs/configuration/resources.html.md +++ b/website/docs/configuration/resources.html.md @@ -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).
@@ -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).
@@ -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)
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -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).
diff --git a/website/docs/internals/credentials-helpers.html.md b/website/docs/internals/credentials-helpers.html.md index c7572484e..8e8b71aa0 100644 --- a/website/docs/internals/credentials-helpers.html.md +++ b/website/docs/internals/credentials-helpers.html.md @@ -12,7 +12,7 @@ For Terraform-specific features that interact with remote network services, such as [module registries](/docs/registry/) and [remote operations](/docs/cloud/run/cli.html), Terraform by default looks for API credentials to use in these calls in -[the CLI configuration](/docs/commands/cli-config.html). +[the CLI configuration](/docs/cli/config/config-file.html). Credentials helpers offer an alternative approach that allows you to customize how Terraform obtains credentials using an external program, which can then @@ -20,7 +20,7 @@ directly access an existing secrets management system in your organization. This page is about how to write and install a credentials helper. To learn how to configure a credentials helper that was already installed, see -[the CLI config Credentials Helpers section](/docs/commands/cli-config.html#credentials-helpers). +[the CLI config Credentials Helpers section](/docs/cli/config/config-file.html#credentials-helpers). ## How Terraform finds Credentials Helpers @@ -57,7 +57,7 @@ The current set of verbs are: To represent credentials, the credentials helper protocol uses a JSON object whose contents correspond with the contents of -[`credentials` blocks in the CLI configuration](/docs/commands/cli-config.html#credentials). +[`credentials` blocks in the CLI configuration](/docs/cli/config/config-file.html#credentials). To represent an API token, the object contains a property called "token" whose value is the token string: diff --git a/website/docs/internals/graph.html.md b/website/docs/internals/graph.html.md index e2de628f5..56ec892fa 100644 --- a/website/docs/internals/graph.html.md +++ b/website/docs/internals/graph.html.md @@ -108,8 +108,8 @@ The amount of parallelism is limited using a semaphore to prevent too many concurrent operations from overwhelming the resources of the machine running Terraform. By default, up to 10 nodes in the graph will be processed concurrently. This number can be set using the `-parallelism` flag on the -[plan](/docs/commands/plan.html), [apply](/docs/commands/apply.html), and -[destroy](/docs/commands/destroy.html) commands. +[plan](/docs/cli/commands/plan.html), [apply](/docs/cli/commands/apply.html), and +[destroy](/docs/cli/commands/destroy.html) commands. Setting `-parallelism` is considered an advanced operation and should not be necessary for normal usage of Terraform. It may be helpful in certain special diff --git a/website/docs/internals/json-format.html.md b/website/docs/internals/json-format.html.md index 48a7b28e0..88d3e0e75 100644 --- a/website/docs/internals/json-format.html.md +++ b/website/docs/internals/json-format.html.md @@ -14,7 +14,7 @@ When Terraform plans to make changes, it prints a human-readable summary to the Since the format of plan files isn't suited for use with external tools (and likely never will be), Terraform can output a machine-readable JSON representation of a plan file's changes. It can also convert state files to the same format, to simplify data loading and provide better long-term compatibility. -Use `terraform show -json ` to generate a JSON representation of a plan or state file. See [the `terraform show` documentation](/docs/commands/show.html) for more details. +Use `terraform show -json ` to generate a JSON representation of a plan or state file. See [the `terraform show` documentation](/docs/cli/commands/show.html) for more details. -> **Note:** The output includes a `format_version` key, which currently has major version zero to indicate that the format is experimental and subject to change. A future version will assign a non-zero major version and make stronger promises about compatibility. We do not anticipate any significant breaking changes to the format before its first major version, however. @@ -244,7 +244,7 @@ The following example illustrates the structure of a ``: } ``` -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. diff --git a/website/docs/internals/login-protocol.html.markdown b/website/docs/internals/login-protocol.html.markdown index 560a471be..59e3a39a3 100644 --- a/website/docs/internals/login-protocol.html.markdown +++ b/website/docs/internals/login-protocol.html.markdown @@ -9,7 +9,7 @@ description: |- # Server-side Login Protocol ~> **Note:** You don't need to read these docs to _use_ -[`terraform login`](/docs/commands/login.html). The information below is for +[`terraform login`](/docs/cli/commands/login.html). The information below is for anyone intending to implement the server side of `terraform login` in order to offer Terraform-native services in a third-party system. diff --git a/website/docs/internals/module-registry-protocol.html.md b/website/docs/internals/module-registry-protocol.html.md index 3d8f17d22..4da947214 100644 --- a/website/docs/internals/module-registry-protocol.html.md +++ b/website/docs/internals/module-registry-protocol.html.md @@ -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). diff --git a/website/docs/internals/provider-network-mirror-protocol.html.md b/website/docs/internals/provider-network-mirror-protocol.html.md index 3ad4895bb..9520f8298 100644 --- a/website/docs/internals/provider-network-mirror-protocol.html.md +++ b/website/docs/internals/provider-network-mirror-protocol.html.md @@ -18,7 +18,7 @@ implement to provide an alternative installation source for Terraform providers, regardless of their origin registries. Terraform uses network mirrors only if you activate them explicitly in -[the CLI configuration's `provider_installation` block](/docs/commands/cli-config.html#provider-installation). +[the CLI configuration's `provider_installation` block](/docs/cli/config/config-file.html#provider-installation). When enabled, a network mirror can serve providers belonging to any registry hostname, which can allow an organization to serve all of the Terraform providers they intend to use from an internal server, rather than from each @@ -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 @@ -96,7 +96,7 @@ base URL from the above CLI configuration example. ### Authentication If the CLI configuration includes -[credentials](/docs/commands/cli-config.html#credentials) for the hostname +[credentials](/docs/cli/config/config-file.html#credentials) for the hostname given in the network mirror base URL, Terraform will include those credentials in its requests for operations described below. @@ -264,7 +264,7 @@ in the appropriate nested subdirectories, and ensure that your system is configured to serve `.json` files with the `application/json` media type. As a convenience, Terraform CLI includes -[the `terraform providers mirror` subcommand](https://www.terraform.io/docs/commands/providers/mirror.html), +[the `terraform providers mirror` subcommand](https://www.terraform.io/docs/cli/commands/providers/mirror.html), which will analyze the current configuration for the providers it requires, download the packages for those providers from their origin registries, and place them into a local directory suitable for use as a mirror. diff --git a/website/docs/internals/provider-registry-protocol.html.md b/website/docs/internals/provider-registry-protocol.html.md index b81dead37..8dd4c543e 100644 --- a/website/docs/internals/provider-registry-protocol.html.md +++ b/website/docs/internals/provider-registry-protocol.html.md @@ -42,7 +42,7 @@ where: * `hostname` is the registry host that the provider is considered to have originated from, and the default location Terraform will consult for information about the provider - [unless overridden in the CLI configuration](/docs/commands/cli-config.html#provider-installation). + [unless overridden in the CLI configuration](/docs/cli/config/config-file.html#provider-installation). * `namespace` is the name of a namespace, unique on a particular hostname, that can contain one or more providers that are somehow related. On the public Terraform Registry the "namespace" represents the organization that is @@ -78,7 +78,7 @@ to see it as an entirely separate provider that will _not_ be usable by modules that declare a dependency on `hashicorp/azurerm`. If your goal is to create an alternative local distribution source for an existing provider -- that is, a _mirror_ of the provider -- refer to -[the provider installation method configuration](/docs/commands/cli-config.html#provider-installation) +[the provider installation method configuration](/docs/cli/config/config-file.html#provider-installation) instead. ## Provider Versions diff --git a/website/docs/internals/remote-service-discovery.html.md b/website/docs/internals/remote-service-discovery.html.md index 4ae3dfc8d..f82617e7a 100644 --- a/website/docs/internals/remote-service-discovery.html.md +++ b/website/docs/internals/remote-service-discovery.html.md @@ -85,14 +85,14 @@ version 1 of the module registry protocol: At present, the following service identifiers are in use: -* `login.v1`: [login protocol version 1](/docs/commands/login.html) +* `login.v1`: [login protocol version 1](/docs/cli/commands/login.html) * `modules.v1`: [module registry API version 1](module-registry-protocol.html) * `providers.v1`: [provider registry API version 1](provider-registry-protocol.html) ## Authentication If credentials for the given hostname are available in -[the CLI config](/docs/commands/cli-config.html) then they will be included +[the CLI config](/docs/cli/config/config-file.html) then they will be included in the request for the discovery document. The credentials may also be provided to endpoints declared in the discovery diff --git a/website/docs/configuration/attr-as-blocks.html.md b/website/docs/language/attr-as-blocks.html.md similarity index 94% rename from website/docs/configuration/attr-as-blocks.html.md rename to website/docs/language/attr-as-blocks.html.md index de4778675..ad7759a25 100644 --- a/website/docs/configuration/attr-as-blocks.html.md +++ b/website/docs/language/attr-as-blocks.html.md @@ -25,14 +25,14 @@ is set to an empty list (` = []`). 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 diff --git a/website/docs/configuration/data-sources.html.md b/website/docs/language/data-sources/index.html.md similarity index 87% rename from website/docs/configuration/data-sources.html.md rename to website/docs/language/data-sources/index.html.md index 8cb59014f..a7caf83b6 100644 --- a/website/docs/configuration/data-sources.html.md +++ b/website/docs/language/data-sources/index.html.md @@ -8,17 +8,13 @@ description: |- # Data Sources --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Data Sources](../configuration-0-11/data-sources.html). - _Data sources_ allow data to be fetched or computed for use elsewhere 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 @@ -65,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 @@ -114,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. @@ -129,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 @@ -140,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 @@ -194,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: @@ -213,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 diff --git a/website/docs/configuration/dependency-lock.html.md b/website/docs/language/dependency-lock.html.md similarity index 96% rename from website/docs/configuration/dependency-lock.html.md rename to website/docs/language/dependency-lock.html.md index 5b0248647..4f30a68ce 100644 --- a/website/docs/configuration/dependency-lock.html.md +++ b/website/docs/language/dependency-lock.html.md @@ -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) @@ -51,7 +51,7 @@ to signify that it is a lock file for various items that Terraform caches in the `.terraform` subdirectory of your working directory. Terraform automatically creates or updates the dependency lock file each time -you run [the `terraform init` command](/docs/commands/init.html). You should +you run [the `terraform init` command](/docs/cli/commands/init.html). You should include this file in your version control repository so that you can discuss potential changes to your external dependencies via code review, just as you would discuss potential changes to your configuration itself. @@ -139,7 +139,7 @@ There are two special considerations with the "trust on first use" model: To avoid this problem you can pre-populate checksums for a variety of different platforms in your lock file using - [the `terraform providers lock` command](/docs/commands/providers/lock.html), + [the `terraform providers lock` command](/docs/cli/commands/providers/lock.html), which will then allow future calls to `terraform init` to verify that the packages available in your chosen mirror match the official packages from the provider's origin registry. @@ -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 @@ -304,7 +304,7 @@ The two hashing schemes currently supported are: packages indexed in the origin registry. This is an effective scheme for verifying the official release packages when installed from a registry, but it's not suitable for verifying packages that come from other - [provider installation methods](/docs/commands/cli-config.html#provider-installation), + [provider installation methods](/docs/cli/config/config-file.html#provider-installation), such as filesystem mirrors using the unpacked directory layout. * `h1:`: a mnemonic for "hash scheme 1", which is the current preferred hashing @@ -345,7 +345,7 @@ your configuration on new target platforms, or if you are installing providers from a mirror that therefore can't provide official signed checksums, you can ask Terraform to pre-populate hashes for a chosen set of platforms using -[the `terraform providers lock` command](/docs/commands/providers/lock.html): +[the `terraform providers lock` command](/docs/cli/commands/providers/lock.html): ``` terraform providers lock \ diff --git a/website/docs/configuration/expressions/conditionals.html.md b/website/docs/language/expressions/conditionals.html.md similarity index 96% rename from website/docs/configuration/expressions/conditionals.html.md rename to website/docs/language/expressions/conditionals.html.md index 1ef7baae2..138e2b0e5 100644 --- a/website/docs/configuration/expressions/conditionals.html.md +++ b/website/docs/language/expressions/conditionals.html.md @@ -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 diff --git a/website/docs/configuration/expressions/dynamic-blocks.html.md b/website/docs/language/expressions/dynamic-blocks.html.md similarity index 95% rename from website/docs/configuration/expressions/dynamic-blocks.html.md rename to website/docs/language/expressions/dynamic-blocks.html.md index 2c87c427a..b6117b4a0 100644 --- a/website/docs/configuration/expressions/dynamic-blocks.html.md +++ b/website/docs/language/expressions/dynamic-blocks.html.md @@ -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). diff --git a/website/docs/configuration/expressions/for.html.md b/website/docs/language/expressions/for.html.md similarity index 99% rename from website/docs/configuration/expressions/for.html.md rename to website/docs/language/expressions/for.html.md index 04ab3a0ab..77ba0a3cd 100644 --- a/website/docs/configuration/expressions/for.html.md +++ b/website/docs/language/expressions/for.html.md @@ -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 diff --git a/website/docs/configuration/expressions/function-calls.html.md b/website/docs/language/expressions/function-calls.html.md similarity index 87% rename from website/docs/configuration/expressions/function-calls.html.md rename to website/docs/language/expressions/function-calls.html.md index b0deb2b99..26e230350 100644 --- a/website/docs/configuration/expressions/function-calls.html.md +++ b/website/docs/language/expressions/function-calls.html.md @@ -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. diff --git a/website/docs/configuration/expressions/index.html.md b/website/docs/language/expressions/index.html.md similarity index 72% rename from website/docs/configuration/expressions/index.html.md rename to website/docs/language/expressions/index.html.md index 4aee75658..5a6a18a0f 100644 --- a/website/docs/configuration/expressions/index.html.md +++ b/website/docs/language/expressions/index.html.md @@ -16,54 +16,54 @@ 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. You can experiment with the behavior of Terraform's expressions from the Terraform expression console, by running -[the `terraform console` command](/docs/commands/console.html). +[the `terraform console` command](/docs/cli/commands/console.html). 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 ` ? : ` 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. diff --git a/website/docs/configuration/expressions/operators.html.md b/website/docs/language/expressions/operators.html.md similarity index 98% rename from website/docs/configuration/expressions/operators.html.md rename to website/docs/language/expressions/operators.html.md index 330573590..542232680 100644 --- a/website/docs/configuration/expressions/operators.html.md +++ b/website/docs/language/expressions/operators.html.md @@ -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 diff --git a/website/docs/configuration/expressions/references.html.md b/website/docs/language/expressions/references.html.md similarity index 92% rename from website/docs/configuration/expressions/references.html.md rename to website/docs/language/expressions/references.html.md index 86d562108..26eed0fb5 100644 --- a/website/docs/configuration/expressions/references.html.md +++ b/website/docs/language/expressions/references.html.md @@ -36,7 +36,7 @@ instance resource. ### Resources -`.` represents a [managed resource](/docs/configuration/blocks/resources/index.html) of +`.` 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.` is the value of the [input variable](/docs/configuration/variables.html) of the given name. +`var.` 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.` is the value of the [local value](/docs/configuration/locals.html) of the given name. +`local.` 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.` 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..`. +[output values](/docs/language/values/outputs.html), use `module..`. 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..` 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 diff --git a/website/docs/configuration/expressions/splat.html.md b/website/docs/language/expressions/splat.html.md similarity index 97% rename from website/docs/configuration/expressions/splat.html.md rename to website/docs/language/expressions/splat.html.md index 6ae8017f7..731aa767f 100644 --- a/website/docs/configuration/expressions/splat.html.md +++ b/website/docs/language/expressions/splat.html.md @@ -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 diff --git a/website/docs/configuration/expressions/strings.html.md b/website/docs/language/expressions/strings.html.md similarity index 97% rename from website/docs/configuration/expressions/strings.html.md rename to website/docs/language/expressions/strings.html.md index d4f15d742..72cd0bba0 100644 --- a/website/docs/configuration/expressions/strings.html.md +++ b/website/docs/language/expressions/strings.html.md @@ -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 diff --git a/website/docs/configuration/types.html.md b/website/docs/language/expressions/type-constraints.html.md similarity index 96% rename from website/docs/configuration/types.html.md rename to website/docs/language/expressions/type-constraints.html.md index 441cdc6fb..43d7f938c 100644 --- a/website/docs/configuration/types.html.md +++ b/website/docs/language/expressions/type-constraints.html.md @@ -9,11 +9,6 @@ description: |- # Type Constraints --> **Note:** This page is about Terraform 0.12 and later, and documents a -feature that did not exist in older versions. For other information about -Terraform 0.11 and earlier, see -[0.11 Configuration Language](../configuration-0-11/index.html). - Terraform module authors and provider developers can use detailed type constraints to validate user-provided values for their input variables and resource arguments. This requires some additional knowledge about Terraform's @@ -32,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 @@ -160,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. diff --git a/website/docs/configuration/expressions/types.html.md b/website/docs/language/expressions/types.html.md similarity index 96% rename from website/docs/configuration/expressions/types.html.md rename to website/docs/language/expressions/types.html.md index 285c0a08d..c197a7f8e 100644 --- a/website/docs/configuration/expressions/types.html.md +++ b/website/docs/language/expressions/types.html.md @@ -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 diff --git a/website/docs/configuration/version-constraints.html.md b/website/docs/language/expressions/version-constraints.html.md similarity index 91% rename from website/docs/configuration/version-constraints.html.md rename to website/docs/language/expressions/version-constraints.html.md index 41c148911..0f7ebba54 100644 --- a/website/docs/configuration/version-constraints.html.md +++ b/website/docs/language/expressions/version-constraints.html.md @@ -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. diff --git a/website/docs/configuration/files/index.html.md b/website/docs/language/files/index.html.md similarity index 92% rename from website/docs/configuration/files/index.html.md rename to website/docs/language/files/index.html.md index 6c1361d10..109c60f73 100644 --- a/website/docs/configuration/files/index.html.md +++ b/website/docs/language/files/index.html.md @@ -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 diff --git a/website/docs/configuration/override.html.md b/website/docs/language/files/override.html.md similarity index 97% rename from website/docs/configuration/override.html.md rename to website/docs/language/files/override.html.md index 2dcea4b26..334aa2eb5 100644 --- a/website/docs/configuration/override.html.md +++ b/website/docs/language/files/override.html.md @@ -9,10 +9,6 @@ description: |- # Override Files --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Override Files](../configuration-0-11/override.html). - Terraform normally loads all of the `.tf` and `.tf.json` files within a directory and expects each one to define a distinct set of configuration objects. If two files attempt to define the same object, Terraform returns diff --git a/website/docs/configuration/functions/abs.html.md b/website/docs/language/functions/abs.html.md similarity index 72% rename from website/docs/configuration/functions/abs.html.md rename to website/docs/language/functions/abs.html.md index df76e7206..51d3bc01c 100644 --- a/website/docs/configuration/functions/abs.html.md +++ b/website/docs/language/functions/abs.html.md @@ -8,10 +8,6 @@ description: |- # `abs` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `abs` returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it. diff --git a/website/docs/configuration/functions/abspath.html.md b/website/docs/language/functions/abspath.html.md similarity index 82% rename from website/docs/configuration/functions/abspath.html.md rename to website/docs/language/functions/abspath.html.md index 710b57204..3da10ed72 100644 --- a/website/docs/configuration/functions/abspath.html.md +++ b/website/docs/language/functions/abspath.html.md @@ -8,10 +8,6 @@ description: |- # `abspath` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `abspath` takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory. diff --git a/website/docs/configuration/functions/alltrue.html.md b/website/docs/language/functions/alltrue.html.md similarity index 100% rename from website/docs/configuration/functions/alltrue.html.md rename to website/docs/language/functions/alltrue.html.md diff --git a/website/docs/configuration/functions/anytrue.html.md b/website/docs/language/functions/anytrue.html.md similarity index 100% rename from website/docs/configuration/functions/anytrue.html.md rename to website/docs/language/functions/anytrue.html.md diff --git a/website/docs/configuration/functions/base64decode.html.md b/website/docs/language/functions/base64decode.html.md similarity index 90% rename from website/docs/configuration/functions/base64decode.html.md rename to website/docs/language/functions/base64decode.html.md index 7a562aa5e..41feab121 100644 --- a/website/docs/configuration/functions/base64decode.html.md +++ b/website/docs/language/functions/base64decode.html.md @@ -8,10 +8,6 @@ description: |- # `base64decode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `base64decode` takes a string containing a Base64 character sequence and returns the original string. diff --git a/website/docs/configuration/functions/base64encode.html.md b/website/docs/language/functions/base64encode.html.md similarity index 91% rename from website/docs/configuration/functions/base64encode.html.md rename to website/docs/language/functions/base64encode.html.md index 9874fcb9d..8a4ddb1c3 100644 --- a/website/docs/configuration/functions/base64encode.html.md +++ b/website/docs/language/functions/base64encode.html.md @@ -8,10 +8,6 @@ description: |- # `base64encode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `base64encode` applies Base64 encoding to a string. Terraform uses the "standard" Base64 alphabet as defined in diff --git a/website/docs/configuration/functions/base64gzip.html.md b/website/docs/language/functions/base64gzip.html.md similarity index 87% rename from website/docs/configuration/functions/base64gzip.html.md rename to website/docs/language/functions/base64gzip.html.md index 35abeb117..f8d103a9d 100644 --- a/website/docs/configuration/functions/base64gzip.html.md +++ b/website/docs/language/functions/base64gzip.html.md @@ -9,10 +9,6 @@ description: |- # `base64gzip` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `base64gzip` compresses a string with gzip and then encodes the result in Base64 encoding. diff --git a/website/docs/configuration/functions/base64sha256.html.md b/website/docs/language/functions/base64sha256.html.md similarity index 86% rename from website/docs/configuration/functions/base64sha256.html.md rename to website/docs/language/functions/base64sha256.html.md index 1fd204e9b..1edfc98da 100644 --- a/website/docs/configuration/functions/base64sha256.html.md +++ b/website/docs/language/functions/base64sha256.html.md @@ -9,10 +9,6 @@ description: |- # `base64sha256` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `base64sha256` computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to `base64encode(sha256("test"))` since `sha256()` returns hexadecimal representation. diff --git a/website/docs/configuration/functions/base64sha512.html.md b/website/docs/language/functions/base64sha512.html.md similarity index 86% rename from website/docs/configuration/functions/base64sha512.html.md rename to website/docs/language/functions/base64sha512.html.md index 35a6509f5..87bd52137 100644 --- a/website/docs/configuration/functions/base64sha512.html.md +++ b/website/docs/language/functions/base64sha512.html.md @@ -9,10 +9,6 @@ description: |- # `base64sha512` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `base64sha512` computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to `base64encode(sha512("test"))` since `sha512()` returns hexadecimal representation. diff --git a/website/docs/configuration/functions/basename.html.md b/website/docs/language/functions/basename.html.md similarity index 88% rename from website/docs/configuration/functions/basename.html.md rename to website/docs/language/functions/basename.html.md index 87702481c..e7869d642 100644 --- a/website/docs/configuration/functions/basename.html.md +++ b/website/docs/language/functions/basename.html.md @@ -9,10 +9,6 @@ description: |- # `basename` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `basename` takes a string containing a filesystem path and removes all except the last portion from it. diff --git a/website/docs/configuration/functions/bcrypt.html.md b/website/docs/language/functions/bcrypt.html.md similarity index 86% rename from website/docs/configuration/functions/bcrypt.html.md rename to website/docs/language/functions/bcrypt.html.md index d8bdafbb9..b1b0eb79a 100644 --- a/website/docs/configuration/functions/bcrypt.html.md +++ b/website/docs/language/functions/bcrypt.html.md @@ -9,10 +9,6 @@ description: |- # `bcrypt` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `bcrypt` computes a hash of the given string using the Blowfish cipher, returning a string in [the _Modular Crypt Format_](https://passlib.readthedocs.io/en/stable/modular_crypt_format.html) diff --git a/website/docs/configuration/functions/can.html.md b/website/docs/language/functions/can.html.md similarity index 89% rename from website/docs/configuration/functions/can.html.md rename to website/docs/language/functions/can.html.md index d8450f4b8..8c05a304e 100644 --- a/website/docs/configuration/functions/can.html.md +++ b/website/docs/language/functions/can.html.md @@ -9,10 +9,6 @@ description: |- # `can` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `can` evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors. @@ -23,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: ``` diff --git a/website/docs/configuration/functions/ceil.html.md b/website/docs/language/functions/ceil.html.md similarity index 73% rename from website/docs/configuration/functions/ceil.html.md rename to website/docs/language/functions/ceil.html.md index a10ef4c9e..0b68172ce 100644 --- a/website/docs/configuration/functions/ceil.html.md +++ b/website/docs/language/functions/ceil.html.md @@ -9,10 +9,6 @@ description: |- # `ceil` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `ceil` returns the closest whole number that is greater than or equal to the given value, which may be a fraction. diff --git a/website/docs/configuration/functions/chomp.html.md b/website/docs/language/functions/chomp.html.md similarity index 77% rename from website/docs/configuration/functions/chomp.html.md rename to website/docs/language/functions/chomp.html.md index ee290e4ec..5ea67e81a 100644 --- a/website/docs/configuration/functions/chomp.html.md +++ b/website/docs/language/functions/chomp.html.md @@ -8,10 +8,6 @@ description: |- # `chomp` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `chomp` removes newline characters at the end of a string. This can be useful if, for example, the string was read from a file that has diff --git a/website/docs/configuration/functions/chunklist.html.md b/website/docs/language/functions/chunklist.html.md similarity index 77% rename from website/docs/configuration/functions/chunklist.html.md rename to website/docs/language/functions/chunklist.html.md index 9e796cc7c..21823ab47 100644 --- a/website/docs/configuration/functions/chunklist.html.md +++ b/website/docs/language/functions/chunklist.html.md @@ -9,10 +9,6 @@ description: |- # `chunklist` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `chunklist` splits a single list into fixed-size chunks, returning a list of lists. diff --git a/website/docs/configuration/functions/cidrhost.html.md b/website/docs/language/functions/cidrhost.html.md similarity index 89% rename from website/docs/configuration/functions/cidrhost.html.md rename to website/docs/language/functions/cidrhost.html.md index a8da2fce1..e43540362 100644 --- a/website/docs/configuration/functions/cidrhost.html.md +++ b/website/docs/language/functions/cidrhost.html.md @@ -9,10 +9,6 @@ description: |- # `cidrhost` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `cidrhost` calculates a full host IP address for a given host number within a given IP network address prefix. diff --git a/website/docs/configuration/functions/cidrnetmask.html.md b/website/docs/language/functions/cidrnetmask.html.md similarity index 81% rename from website/docs/configuration/functions/cidrnetmask.html.md rename to website/docs/language/functions/cidrnetmask.html.md index fd3807606..bb3de4f7b 100644 --- a/website/docs/configuration/functions/cidrnetmask.html.md +++ b/website/docs/language/functions/cidrnetmask.html.md @@ -9,10 +9,6 @@ description: |- # `cidrnetmask` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `cidrnetmask` converts an IPv4 address prefix given in CIDR notation into a subnet mask address. diff --git a/website/docs/configuration/functions/cidrsubnet.html.md b/website/docs/language/functions/cidrsubnet.html.md similarity index 97% rename from website/docs/configuration/functions/cidrsubnet.html.md rename to website/docs/language/functions/cidrsubnet.html.md index 6b9bf6e7a..e64c894fb 100644 --- a/website/docs/configuration/functions/cidrsubnet.html.md +++ b/website/docs/language/functions/cidrsubnet.html.md @@ -9,10 +9,6 @@ description: |- # `cidrsubnet` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `cidrsubnet` calculates a subnet address within given IP network address prefix. ```hcl diff --git a/website/docs/configuration/functions/cidrsubnets.html.md b/website/docs/language/functions/cidrsubnets.html.md similarity index 92% rename from website/docs/configuration/functions/cidrsubnets.html.md rename to website/docs/language/functions/cidrsubnets.html.md index 66268f8ff..4f43635c7 100644 --- a/website/docs/configuration/functions/cidrsubnets.html.md +++ b/website/docs/language/functions/cidrsubnets.html.md @@ -9,10 +9,6 @@ description: |- # `cidrsubnets` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `cidrsubnets` calculates a sequence of consecutive IP address ranges within a particular CIDR prefix. @@ -70,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: ``` diff --git a/website/docs/configuration/functions/coalesce.html.md b/website/docs/language/functions/coalesce.html.md similarity index 88% rename from website/docs/configuration/functions/coalesce.html.md rename to website/docs/language/functions/coalesce.html.md index d4b409d3c..6458970ee 100644 --- a/website/docs/configuration/functions/coalesce.html.md +++ b/website/docs/language/functions/coalesce.html.md @@ -9,10 +9,6 @@ description: |- # `coalesce` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `coalesce` takes any number of arguments and returns the first one that isn't null or an empty string. diff --git a/website/docs/configuration/functions/coalescelist.html.md b/website/docs/language/functions/coalescelist.html.md similarity index 81% rename from website/docs/configuration/functions/coalescelist.html.md rename to website/docs/language/functions/coalescelist.html.md index 15d9f97c2..6508fa31f 100644 --- a/website/docs/configuration/functions/coalescelist.html.md +++ b/website/docs/language/functions/coalescelist.html.md @@ -9,10 +9,6 @@ description: |- # `coalescelist` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `coalescelist` takes any number of list arguments and returns the first one that isn't empty. diff --git a/website/docs/configuration/functions/compact.html.md b/website/docs/language/functions/compact.html.md similarity index 68% rename from website/docs/configuration/functions/compact.html.md rename to website/docs/language/functions/compact.html.md index 45f804534..cd2d6379c 100644 --- a/website/docs/configuration/functions/compact.html.md +++ b/website/docs/language/functions/compact.html.md @@ -8,10 +8,6 @@ description: |- # `compact` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `compact` takes a list of strings and returns a new list with any empty string elements removed. diff --git a/website/docs/configuration/functions/concat.html.md b/website/docs/language/functions/concat.html.md similarity index 67% rename from website/docs/configuration/functions/concat.html.md rename to website/docs/language/functions/concat.html.md index 5e616c3b2..47ef10ac0 100644 --- a/website/docs/configuration/functions/concat.html.md +++ b/website/docs/language/functions/concat.html.md @@ -8,10 +8,6 @@ description: |- # `concat` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `concat` takes two or more lists and combines them into a single list. ## Examples diff --git a/website/docs/configuration/functions/contains.html.md b/website/docs/language/functions/contains.html.md similarity index 71% rename from website/docs/configuration/functions/contains.html.md rename to website/docs/language/functions/contains.html.md index 6fd5eed8a..8ab835eb4 100644 --- a/website/docs/configuration/functions/contains.html.md +++ b/website/docs/language/functions/contains.html.md @@ -8,10 +8,6 @@ description: |- # `contains` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `contains` determines whether a given list or set contains a given single value as one of its elements. diff --git a/website/docs/configuration/functions/csvdecode.html.md b/website/docs/language/functions/csvdecode.html.md similarity index 90% rename from website/docs/configuration/functions/csvdecode.html.md rename to website/docs/language/functions/csvdecode.html.md index acd0e50a6..be3016286 100644 --- a/website/docs/configuration/functions/csvdecode.html.md +++ b/website/docs/language/functions/csvdecode.html.md @@ -8,10 +8,6 @@ description: |- # `csvdecode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `csvdecode` decodes a string containing CSV-formatted data and produces a list of maps representing that data. @@ -46,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. @@ -94,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 diff --git a/website/docs/configuration/functions/defaults.html.md b/website/docs/language/functions/defaults.html.md similarity index 96% rename from website/docs/configuration/functions/defaults.html.md rename to website/docs/language/functions/defaults.html.md index b967d6a37..b4d684780 100644 --- a/website/docs/configuration/functions/defaults.html.md +++ b/website/docs/language/functions/defaults.html.md @@ -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. diff --git a/website/docs/configuration/functions/dirname.html.md b/website/docs/language/functions/dirname.html.md similarity index 88% rename from website/docs/configuration/functions/dirname.html.md rename to website/docs/language/functions/dirname.html.md index 251f4a250..e39150b37 100644 --- a/website/docs/configuration/functions/dirname.html.md +++ b/website/docs/language/functions/dirname.html.md @@ -8,10 +8,6 @@ description: |- # `dirname` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `dirname` takes a string containing a filesystem path and removes the last portion from it. diff --git a/website/docs/configuration/functions/distinct.html.md b/website/docs/language/functions/distinct.html.md similarity index 73% rename from website/docs/configuration/functions/distinct.html.md rename to website/docs/language/functions/distinct.html.md index 9e1635847..fc871471e 100644 --- a/website/docs/configuration/functions/distinct.html.md +++ b/website/docs/language/functions/distinct.html.md @@ -8,10 +8,6 @@ description: |- # `distinct` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `distinct` takes a list and returns a new list with any duplicate elements removed. diff --git a/website/docs/configuration/functions/element.html.md b/website/docs/language/functions/element.html.md similarity index 86% rename from website/docs/configuration/functions/element.html.md rename to website/docs/language/functions/element.html.md index ba9187e72..f0f6462c6 100644 --- a/website/docs/configuration/functions/element.html.md +++ b/website/docs/language/functions/element.html.md @@ -8,10 +8,6 @@ description: |- # `element` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `element` retrieves a single element from a list. ```hcl diff --git a/website/docs/configuration/functions/file.html.md b/website/docs/language/functions/file.html.md similarity index 89% rename from website/docs/configuration/functions/file.html.md rename to website/docs/language/functions/file.html.md index dc83b4f1a..48e96afa2 100644 --- a/website/docs/configuration/functions/file.html.md +++ b/website/docs/language/functions/file.html.md @@ -9,10 +9,6 @@ description: |- # `file` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `file` reads the contents of a file at the given path and returns them as a string. diff --git a/website/docs/configuration/functions/filebase64.html.md b/website/docs/language/functions/filebase64.html.md similarity index 90% rename from website/docs/configuration/functions/filebase64.html.md rename to website/docs/language/functions/filebase64.html.md index ce59e756f..1ae07b4f3 100644 --- a/website/docs/configuration/functions/filebase64.html.md +++ b/website/docs/language/functions/filebase64.html.md @@ -9,10 +9,6 @@ description: |- # `filebase64` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filebase64` reads the contents of a file at the given path and returns them as a base64-encoded string. diff --git a/website/docs/configuration/functions/filebase64sha256.html.md b/website/docs/language/functions/filebase64sha256.html.md similarity index 76% rename from website/docs/configuration/functions/filebase64sha256.html.md rename to website/docs/language/functions/filebase64sha256.html.md index f184c3237..cedc5d3eb 100644 --- a/website/docs/configuration/functions/filebase64sha256.html.md +++ b/website/docs/language/functions/filebase64sha256.html.md @@ -9,10 +9,6 @@ description: |- # `filebase64sha256` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filebase64sha256` is a variant of [`base64sha256`](./base64sha256.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/filebase64sha512.html.md b/website/docs/language/functions/filebase64sha512.html.md similarity index 76% rename from website/docs/configuration/functions/filebase64sha512.html.md rename to website/docs/language/functions/filebase64sha512.html.md index a0ce0b2aa..6844050e0 100644 --- a/website/docs/configuration/functions/filebase64sha512.html.md +++ b/website/docs/language/functions/filebase64sha512.html.md @@ -9,10 +9,6 @@ description: |- # `filebase64sha512` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filebase64sha512` is a variant of [`base64sha512`](./base64sha512.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/fileexists.html.md b/website/docs/language/functions/fileexists.html.md similarity index 82% rename from website/docs/configuration/functions/fileexists.html.md rename to website/docs/language/functions/fileexists.html.md index cd8dd764c..019b8e61d 100644 --- a/website/docs/configuration/functions/fileexists.html.md +++ b/website/docs/language/functions/fileexists.html.md @@ -8,10 +8,6 @@ description: |- # `fileexists` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `fileexists` determines whether a file exists at a given path. ```hcl diff --git a/website/docs/configuration/functions/filemd5.html.md b/website/docs/language/functions/filemd5.html.md similarity index 73% rename from website/docs/configuration/functions/filemd5.html.md rename to website/docs/language/functions/filemd5.html.md index 07d7c0d13..956581767 100644 --- a/website/docs/configuration/functions/filemd5.html.md +++ b/website/docs/language/functions/filemd5.html.md @@ -9,10 +9,6 @@ description: |- # `filemd5` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filemd5` is a variant of [`md5`](./md5.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/fileset.html.md b/website/docs/language/functions/fileset.html.md similarity index 88% rename from website/docs/configuration/functions/fileset.html.md rename to website/docs/language/functions/fileset.html.md index 82ac4773d..147ac08ba 100644 --- a/website/docs/configuration/functions/fileset.html.md +++ b/website/docs/language/functions/fileset.html.md @@ -8,10 +8,6 @@ description: |- # `fileset` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `fileset` enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (`/`) as @@ -69,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" { diff --git a/website/docs/configuration/functions/filesha1.html.md b/website/docs/language/functions/filesha1.html.md similarity index 74% rename from website/docs/configuration/functions/filesha1.html.md rename to website/docs/language/functions/filesha1.html.md index ef7a890de..a1657638e 100644 --- a/website/docs/configuration/functions/filesha1.html.md +++ b/website/docs/language/functions/filesha1.html.md @@ -9,10 +9,6 @@ description: |- # `filesha1` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filesha1` is a variant of [`sha1`](./sha1.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/filesha256.html.md b/website/docs/language/functions/filesha256.html.md similarity index 74% rename from website/docs/configuration/functions/filesha256.html.md rename to website/docs/language/functions/filesha256.html.md index 02a06adb7..2392b57fa 100644 --- a/website/docs/configuration/functions/filesha256.html.md +++ b/website/docs/language/functions/filesha256.html.md @@ -9,10 +9,6 @@ description: |- # `filesha256` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filesha256` is a variant of [`sha256`](./sha256.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/filesha512.html.md b/website/docs/language/functions/filesha512.html.md similarity index 74% rename from website/docs/configuration/functions/filesha512.html.md rename to website/docs/language/functions/filesha512.html.md index 5021db4c0..9786df3fc 100644 --- a/website/docs/configuration/functions/filesha512.html.md +++ b/website/docs/language/functions/filesha512.html.md @@ -9,10 +9,6 @@ description: |- # `filesha512` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `filesha512` is a variant of [`sha512`](./sha512.html) that hashes the contents of a given file rather than a literal string. diff --git a/website/docs/configuration/functions/flatten.html.md b/website/docs/language/functions/flatten.html.md similarity index 90% rename from website/docs/configuration/functions/flatten.html.md rename to website/docs/language/functions/flatten.html.md index 90da0079c..57c81091a 100644 --- a/website/docs/configuration/functions/flatten.html.md +++ b/website/docs/language/functions/flatten.html.md @@ -8,10 +8,6 @@ description: |- # `flatten` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `flatten` takes a list and replaces any elements that are lists with a flattened sequence of the list contents. @@ -35,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. diff --git a/website/docs/configuration/functions/floor.html.md b/website/docs/language/functions/floor.html.md similarity index 73% rename from website/docs/configuration/functions/floor.html.md rename to website/docs/language/functions/floor.html.md index 3d22ecdc5..6a1ea1804 100644 --- a/website/docs/configuration/functions/floor.html.md +++ b/website/docs/language/functions/floor.html.md @@ -9,10 +9,6 @@ description: |- # `floor` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `floor` returns the closest whole number that is less than or equal to the given value, which may be a fraction. diff --git a/website/docs/configuration/functions/format.html.md b/website/docs/language/functions/format.html.md similarity index 96% rename from website/docs/configuration/functions/format.html.md rename to website/docs/language/functions/format.html.md index d53977963..7fb8c9a8a 100644 --- a/website/docs/configuration/functions/format.html.md +++ b/website/docs/language/functions/format.html.md @@ -9,10 +9,6 @@ description: |- # `format` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `format` produces a string by formatting a number of other values according to a specification string. It is similar to the `printf` function in C, and other similar functions in other programming languages. diff --git a/website/docs/configuration/functions/formatdate.html.md b/website/docs/language/functions/formatdate.html.md similarity index 96% rename from website/docs/configuration/functions/formatdate.html.md rename to website/docs/language/functions/formatdate.html.md index 65fd6893e..c519b6eff 100644 --- a/website/docs/configuration/functions/formatdate.html.md +++ b/website/docs/language/functions/formatdate.html.md @@ -8,10 +8,6 @@ description: |- # `formatdate` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `formatdate` converts a timestamp into a different time format. ```hcl diff --git a/website/docs/configuration/functions/formatlist.html.md b/website/docs/language/functions/formatlist.html.md similarity index 88% rename from website/docs/configuration/functions/formatlist.html.md rename to website/docs/language/functions/formatlist.html.md index a3d68792e..16043611a 100644 --- a/website/docs/configuration/functions/formatlist.html.md +++ b/website/docs/language/functions/formatlist.html.md @@ -9,10 +9,6 @@ description: |- # `formatlist` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `formatlist` produces a list of strings by formatting a number of other values according to a specification string. diff --git a/website/docs/configuration/functions/indent.html.md b/website/docs/language/functions/indent.html.md similarity index 80% rename from website/docs/configuration/functions/indent.html.md rename to website/docs/language/functions/indent.html.md index 0c327ae78..40c995075 100644 --- a/website/docs/configuration/functions/indent.html.md +++ b/website/docs/language/functions/indent.html.md @@ -9,10 +9,6 @@ description: |- # `indent` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `indent` adds a given number of spaces to the beginnings of all but the first line in a given multi-line string. diff --git a/website/docs/configuration/functions.html.md b/website/docs/language/functions/index.html.md similarity index 81% rename from website/docs/configuration/functions.html.md rename to website/docs/language/functions/index.html.md index 8317bcf64..f062b32a7 100644 --- a/website/docs/configuration/functions.html.md +++ b/website/docs/language/functions/index.html.md @@ -9,10 +9,6 @@ description: |- # Built-in Functions --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../configuration-0-11/interpolation.html). - > **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 includes a number of built-in functions that you can @@ -25,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 @@ -34,7 +30,7 @@ for this section includes a list of all of the available built-in functions. You can experiment with the behavior of Terraform's built-in functions from the Terraform expression console, by running -[the `terraform console` command](/docs/commands/console.html): +[the `terraform console` command](/docs/cli/commands/console.html): ``` > max(5, 12, 9) diff --git a/website/docs/configuration/functions/index.html.md b/website/docs/language/functions/index_function.html.md similarity index 76% rename from website/docs/configuration/functions/index.html.md rename to website/docs/language/functions/index_function.html.md index 566da83b8..6d8b3eb13 100644 --- a/website/docs/configuration/functions/index.html.md +++ b/website/docs/language/functions/index_function.html.md @@ -8,10 +8,6 @@ description: |- # `index` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `index` finds the element index for a given value in a list. ```hcl diff --git a/website/docs/configuration/functions/join.html.md b/website/docs/language/functions/join.html.md similarity index 77% rename from website/docs/configuration/functions/join.html.md rename to website/docs/language/functions/join.html.md index 8c9be78ae..e3c609fb0 100644 --- a/website/docs/configuration/functions/join.html.md +++ b/website/docs/language/functions/join.html.md @@ -9,10 +9,6 @@ description: |- # `join` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `join` produces a string by concatenating together all elements of a given list of strings with the given delimiter. diff --git a/website/docs/configuration/functions/jsondecode.html.md b/website/docs/language/functions/jsondecode.html.md similarity index 85% rename from website/docs/configuration/functions/jsondecode.html.md rename to website/docs/language/functions/jsondecode.html.md index b09f42cbb..aacf2874a 100644 --- a/website/docs/configuration/functions/jsondecode.html.md +++ b/website/docs/language/functions/jsondecode.html.md @@ -9,17 +9,13 @@ description: |- # `jsondecode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `jsondecode` interprets a given string as JSON, returning a representation 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 | diff --git a/website/docs/configuration/functions/jsonencode.html.md b/website/docs/language/functions/jsonencode.html.md similarity index 85% rename from website/docs/configuration/functions/jsonencode.html.md rename to website/docs/language/functions/jsonencode.html.md index 90896acf1..06f13fa84 100644 --- a/website/docs/configuration/functions/jsonencode.html.md +++ b/website/docs/language/functions/jsonencode.html.md @@ -8,16 +8,12 @@ description: |- # `jsonencode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `jsonencode` encodes a given value to a string using JSON syntax. 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 | diff --git a/website/docs/configuration/functions/keys.html.md b/website/docs/language/functions/keys.html.md similarity index 75% rename from website/docs/configuration/functions/keys.html.md rename to website/docs/language/functions/keys.html.md index 10d25b8cb..46a65e48d 100644 --- a/website/docs/configuration/functions/keys.html.md +++ b/website/docs/language/functions/keys.html.md @@ -8,10 +8,6 @@ description: |- # `keys` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `keys` takes a map and returns a list containing the keys from that map. The keys are returned in lexicographical order, ensuring that the result will diff --git a/website/docs/configuration/functions/length.html.md b/website/docs/language/functions/length.html.md similarity index 85% rename from website/docs/configuration/functions/length.html.md rename to website/docs/language/functions/length.html.md index abe5dc845..5fd70ddb7 100644 --- a/website/docs/configuration/functions/length.html.md +++ b/website/docs/language/functions/length.html.md @@ -8,10 +8,6 @@ description: |- # `length` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `length` determines the length of a given list, map, or string. If given a list or map, the result is the number of elements in that collection. diff --git a/website/docs/configuration/functions/list.html.md b/website/docs/language/functions/list.html.md similarity index 78% rename from website/docs/configuration/functions/list.html.md rename to website/docs/language/functions/list.html.md index 3cfafd69a..3330d330c 100644 --- a/website/docs/configuration/functions/list.html.md +++ b/website/docs/language/functions/list.html.md @@ -8,10 +8,6 @@ description: |- # `list` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `list` function is no longer available. Prior to Terraform v0.12 it was the only available syntax for writing a literal list inside an expression, but Terraform v0.12 introduced a new first-class syntax. @@ -24,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 diff --git a/website/docs/configuration/functions/log.html.md b/website/docs/language/functions/log.html.md similarity index 75% rename from website/docs/configuration/functions/log.html.md rename to website/docs/language/functions/log.html.md index af4a0fb3f..28ade0a7f 100644 --- a/website/docs/configuration/functions/log.html.md +++ b/website/docs/language/functions/log.html.md @@ -8,10 +8,6 @@ description: |- # `log` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `log` returns the logarithm of a given number in a given base. ```hcl diff --git a/website/docs/configuration/functions/lookup.html.md b/website/docs/language/functions/lookup.html.md similarity index 81% rename from website/docs/configuration/functions/lookup.html.md rename to website/docs/language/functions/lookup.html.md index 194c43a01..e41ece732 100644 --- a/website/docs/configuration/functions/lookup.html.md +++ b/website/docs/language/functions/lookup.html.md @@ -8,10 +8,6 @@ description: |- # `lookup` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `lookup` retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead. diff --git a/website/docs/configuration/functions/lower.html.md b/website/docs/language/functions/lower.html.md similarity index 77% rename from website/docs/configuration/functions/lower.html.md rename to website/docs/language/functions/lower.html.md index c06034b0f..a767859fd 100644 --- a/website/docs/configuration/functions/lower.html.md +++ b/website/docs/language/functions/lower.html.md @@ -8,10 +8,6 @@ description: |- # `lower` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `lower` converts all cased letters in the given string to lowercase. ## Examples diff --git a/website/docs/configuration/functions/map.html.md b/website/docs/language/functions/map.html.md similarity index 78% rename from website/docs/configuration/functions/map.html.md rename to website/docs/language/functions/map.html.md index 20b2c905a..b05744d59 100644 --- a/website/docs/configuration/functions/map.html.md +++ b/website/docs/language/functions/map.html.md @@ -8,10 +8,6 @@ description: |- # `map` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `map` function is no longer available. Prior to Terraform v0.12 it was the only available syntax for writing a literal map inside an expression, but Terraform v0.12 introduced a new first-class syntax. @@ -27,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 diff --git a/website/docs/configuration/functions/matchkeys.html.md b/website/docs/language/functions/matchkeys.html.md similarity index 91% rename from website/docs/configuration/functions/matchkeys.html.md rename to website/docs/language/functions/matchkeys.html.md index 139d1a04c..390e24a25 100644 --- a/website/docs/configuration/functions/matchkeys.html.md +++ b/website/docs/language/functions/matchkeys.html.md @@ -9,10 +9,6 @@ description: |- # `matchkeys` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `matchkeys` constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list. diff --git a/website/docs/configuration/functions/max.html.md b/website/docs/language/functions/max.html.md similarity index 75% rename from website/docs/configuration/functions/max.html.md rename to website/docs/language/functions/max.html.md index d833a22c2..33a458189 100644 --- a/website/docs/configuration/functions/max.html.md +++ b/website/docs/language/functions/max.html.md @@ -8,10 +8,6 @@ description: |- # `max` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `max` takes one or more numbers and returns the greatest number from the set. ## Examples diff --git a/website/docs/configuration/functions/md5.html.md b/website/docs/language/functions/md5.html.md similarity index 83% rename from website/docs/configuration/functions/md5.html.md rename to website/docs/language/functions/md5.html.md index 0945ed0ec..67c9330eb 100644 --- a/website/docs/configuration/functions/md5.html.md +++ b/website/docs/language/functions/md5.html.md @@ -9,10 +9,6 @@ description: |- # `md5` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `md5` computes the MD5 hash of a given string and encodes it with hexadecimal digits. diff --git a/website/docs/configuration/functions/merge.html.md b/website/docs/language/functions/merge.html.md similarity index 83% rename from website/docs/configuration/functions/merge.html.md rename to website/docs/language/functions/merge.html.md index f67eebe99..d01d551bb 100644 --- a/website/docs/configuration/functions/merge.html.md +++ b/website/docs/language/functions/merge.html.md @@ -10,10 +10,6 @@ description: |- # `merge` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `merge` takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments. diff --git a/website/docs/configuration/functions/min.html.md b/website/docs/language/functions/min.html.md similarity index 75% rename from website/docs/configuration/functions/min.html.md rename to website/docs/language/functions/min.html.md index c04b576c4..e9712dce1 100644 --- a/website/docs/configuration/functions/min.html.md +++ b/website/docs/language/functions/min.html.md @@ -8,10 +8,6 @@ description: |- # `min` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `min` takes one or more numbers and returns the smallest number from the set. ## Examples diff --git a/website/docs/configuration/functions/parseint.html.md b/website/docs/language/functions/parseint.html.md similarity index 86% rename from website/docs/configuration/functions/parseint.html.md rename to website/docs/language/functions/parseint.html.md index fe280aa1c..f7ca35d55 100644 --- a/website/docs/configuration/functions/parseint.html.md +++ b/website/docs/language/functions/parseint.html.md @@ -8,10 +8,6 @@ description: |- # `parseint` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `parseint` parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive. diff --git a/website/docs/configuration/functions/pathexpand.html.md b/website/docs/language/functions/pathexpand.html.md similarity index 90% rename from website/docs/configuration/functions/pathexpand.html.md rename to website/docs/language/functions/pathexpand.html.md index 173d951ed..d7fccc3b0 100644 --- a/website/docs/configuration/functions/pathexpand.html.md +++ b/website/docs/language/functions/pathexpand.html.md @@ -9,10 +9,6 @@ description: |- # `pathexpand` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `pathexpand` takes a filesystem path that might begin with a `~` segment, and if so it replaces that segment with the current user's home directory path. diff --git a/website/docs/configuration/functions/pow.html.md b/website/docs/language/functions/pow.html.md similarity index 64% rename from website/docs/configuration/functions/pow.html.md rename to website/docs/language/functions/pow.html.md index c6b10934a..baf73014b 100644 --- a/website/docs/configuration/functions/pow.html.md +++ b/website/docs/language/functions/pow.html.md @@ -8,10 +8,6 @@ description: |- # `pow` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `pow` calculates an exponent, by raising its first argument to the power of the second argument. ## Examples diff --git a/website/docs/configuration/functions/range.html.md b/website/docs/language/functions/range.html.md similarity index 93% rename from website/docs/configuration/functions/range.html.md rename to website/docs/language/functions/range.html.md index b3c2532ba..bdb538ec8 100644 --- a/website/docs/configuration/functions/range.html.md +++ b/website/docs/language/functions/range.html.md @@ -8,10 +8,6 @@ description: |- # `range` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `range` generates a list of numbers using a start value, a limit value, and a step value. diff --git a/website/docs/configuration/functions/regex.html.md b/website/docs/language/functions/regex.html.md similarity index 98% rename from website/docs/configuration/functions/regex.html.md rename to website/docs/language/functions/regex.html.md index cd7e6e27b..13e9419a9 100644 --- a/website/docs/configuration/functions/regex.html.md +++ b/website/docs/language/functions/regex.html.md @@ -9,10 +9,6 @@ description: |- # `regex` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `regex` applies a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) to a string and returns the matching substrings. diff --git a/website/docs/configuration/functions/regexall.html.md b/website/docs/language/functions/regexall.html.md similarity index 89% rename from website/docs/configuration/functions/regexall.html.md rename to website/docs/language/functions/regexall.html.md index 8561375f2..5b5928d87 100644 --- a/website/docs/configuration/functions/regexall.html.md +++ b/website/docs/language/functions/regexall.html.md @@ -8,10 +8,6 @@ description: |- # `regexall` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `regexall` applies a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) to a string and returns a list of all matches. diff --git a/website/docs/configuration/functions/replace.html.md b/website/docs/language/functions/replace.html.md similarity index 85% rename from website/docs/configuration/functions/replace.html.md rename to website/docs/language/functions/replace.html.md index 3781f6188..8475e26ae 100644 --- a/website/docs/configuration/functions/replace.html.md +++ b/website/docs/language/functions/replace.html.md @@ -9,10 +9,6 @@ description: |- # `replace` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `replace` searches a given string for another given substring, and replaces each occurrence with a given replacement string. diff --git a/website/docs/configuration/functions/reverse.html.md b/website/docs/language/functions/reverse.html.md similarity index 72% rename from website/docs/configuration/functions/reverse.html.md rename to website/docs/language/functions/reverse.html.md index 6e7ba2686..deeb3a177 100644 --- a/website/docs/configuration/functions/reverse.html.md +++ b/website/docs/language/functions/reverse.html.md @@ -8,10 +8,6 @@ description: |- # `reverse` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `reverse` takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. diff --git a/website/docs/configuration/functions/rsadecrypt.html.md b/website/docs/language/functions/rsadecrypt.html.md similarity index 83% rename from website/docs/configuration/functions/rsadecrypt.html.md rename to website/docs/language/functions/rsadecrypt.html.md index 9ab4f8751..1cf0b04b4 100644 --- a/website/docs/configuration/functions/rsadecrypt.html.md +++ b/website/docs/language/functions/rsadecrypt.html.md @@ -8,10 +8,6 @@ description: |- # `rsadecrypt` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `rsadecrypt` decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. diff --git a/website/docs/configuration/functions/setintersection.html.md b/website/docs/language/functions/setintersection.html.md similarity index 86% rename from website/docs/configuration/functions/setintersection.html.md rename to website/docs/language/functions/setintersection.html.md index aea068e19..c582cc0cf 100644 --- a/website/docs/configuration/functions/setintersection.html.md +++ b/website/docs/language/functions/setintersection.html.md @@ -9,10 +9,6 @@ description: |- # `setintersection` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `setintersection` function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the diff --git a/website/docs/configuration/functions/setproduct.html.md b/website/docs/language/functions/setproduct.html.md similarity index 94% rename from website/docs/configuration/functions/setproduct.html.md rename to website/docs/language/functions/setproduct.html.md index 24010f722..030ab2c32 100644 --- a/website/docs/configuration/functions/setproduct.html.md +++ b/website/docs/language/functions/setproduct.html.md @@ -9,10 +9,6 @@ description: |- # `setproduct` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `setproduct` function finds all of the possible combinations of elements from all of the given sets by computing the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product). @@ -121,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. diff --git a/website/docs/configuration/functions/setsubtract.html.md b/website/docs/language/functions/setsubtract.html.md similarity index 85% rename from website/docs/configuration/functions/setsubtract.html.md rename to website/docs/language/functions/setsubtract.html.md index 5fed7f4f6..8b95b203a 100644 --- a/website/docs/configuration/functions/setsubtract.html.md +++ b/website/docs/language/functions/setsubtract.html.md @@ -9,10 +9,6 @@ description: |- # `setsubtract` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `setsubtract` function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the [relative complement](https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement) of the first set in the second set. diff --git a/website/docs/configuration/functions/setunion.html.md b/website/docs/language/functions/setunion.html.md similarity index 85% rename from website/docs/configuration/functions/setunion.html.md rename to website/docs/language/functions/setunion.html.md index 9816f02a3..2784f5d87 100644 --- a/website/docs/configuration/functions/setunion.html.md +++ b/website/docs/language/functions/setunion.html.md @@ -9,10 +9,6 @@ description: |- # `setunion` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - The `setunion` function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the [union](https://en.wikipedia.org/wiki/Union_(set_theory)) of diff --git a/website/docs/configuration/functions/sha1.html.md b/website/docs/language/functions/sha1.html.md similarity index 84% rename from website/docs/configuration/functions/sha1.html.md rename to website/docs/language/functions/sha1.html.md index b2588cd80..3b1b75930 100644 --- a/website/docs/configuration/functions/sha1.html.md +++ b/website/docs/language/functions/sha1.html.md @@ -9,10 +9,6 @@ description: |- # `sha1` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `sha1` computes the SHA1 hash of a given string and encodes it with hexadecimal digits. diff --git a/website/docs/configuration/functions/sha256.html.md b/website/docs/language/functions/sha256.html.md similarity index 83% rename from website/docs/configuration/functions/sha256.html.md rename to website/docs/language/functions/sha256.html.md index f364a9dee..c71157d84 100644 --- a/website/docs/configuration/functions/sha256.html.md +++ b/website/docs/language/functions/sha256.html.md @@ -9,10 +9,6 @@ description: |- # `sha256` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `sha256` computes the SHA256 hash of a given string and encodes it with hexadecimal digits. diff --git a/website/docs/configuration/functions/sha512.html.md b/website/docs/language/functions/sha512.html.md similarity index 84% rename from website/docs/configuration/functions/sha512.html.md rename to website/docs/language/functions/sha512.html.md index 026b1d35f..b36c6bf9c 100644 --- a/website/docs/configuration/functions/sha512.html.md +++ b/website/docs/language/functions/sha512.html.md @@ -9,10 +9,6 @@ description: |- # `sha512` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `sha512` computes the SHA512 hash of a given string and encodes it with hexadecimal digits. diff --git a/website/docs/configuration/functions/signum.html.md b/website/docs/language/functions/signum.html.md similarity index 67% rename from website/docs/configuration/functions/signum.html.md rename to website/docs/language/functions/signum.html.md index e778d71cf..e81365880 100644 --- a/website/docs/configuration/functions/signum.html.md +++ b/website/docs/language/functions/signum.html.md @@ -8,10 +8,6 @@ description: |- # `signum` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `signum` determines the sign of a number, returning a number between -1 and 1 to represent the sign. diff --git a/website/docs/configuration/functions/slice.html.md b/website/docs/language/functions/slice.html.md similarity index 79% rename from website/docs/configuration/functions/slice.html.md rename to website/docs/language/functions/slice.html.md index 31d2c4dec..d6672386c 100644 --- a/website/docs/configuration/functions/slice.html.md +++ b/website/docs/language/functions/slice.html.md @@ -8,10 +8,6 @@ description: |- # `slice` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `slice` extracts some consecutive elements from within a list. ```hcl diff --git a/website/docs/configuration/functions/sort.html.md b/website/docs/language/functions/sort.html.md similarity index 74% rename from website/docs/configuration/functions/sort.html.md rename to website/docs/language/functions/sort.html.md index 26626e085..6e50ae9f4 100644 --- a/website/docs/configuration/functions/sort.html.md +++ b/website/docs/language/functions/sort.html.md @@ -9,10 +9,6 @@ description: |- # `sort` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `sort` takes a list of strings and returns a new list with those strings sorted lexicographically. diff --git a/website/docs/configuration/functions/split.html.md b/website/docs/language/functions/split.html.md similarity index 78% rename from website/docs/configuration/functions/split.html.md rename to website/docs/language/functions/split.html.md index 037b70247..a777b7b5a 100644 --- a/website/docs/configuration/functions/split.html.md +++ b/website/docs/language/functions/split.html.md @@ -9,10 +9,6 @@ description: |- # `split` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `split` produces a list by dividing a given string at all occurrences of a given separator. diff --git a/website/docs/configuration/functions/strrev.html.md b/website/docs/language/functions/strrev.html.md similarity index 100% rename from website/docs/configuration/functions/strrev.html.md rename to website/docs/language/functions/strrev.html.md diff --git a/website/docs/configuration/functions/substr.html.md b/website/docs/language/functions/substr.html.md similarity index 74% rename from website/docs/configuration/functions/substr.html.md rename to website/docs/language/functions/substr.html.md index 7ce782500..21b3bbc31 100644 --- a/website/docs/configuration/functions/substr.html.md +++ b/website/docs/language/functions/substr.html.md @@ -9,10 +9,6 @@ description: |- # `substr` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `substr` extracts a substring from a given string by offset and length. ```hcl diff --git a/website/docs/configuration/functions/sum.html.md b/website/docs/language/functions/sum.html.md similarity index 65% rename from website/docs/configuration/functions/sum.html.md rename to website/docs/language/functions/sum.html.md index bb0c20cc4..63c241843 100644 --- a/website/docs/configuration/functions/sum.html.md +++ b/website/docs/language/functions/sum.html.md @@ -9,10 +9,6 @@ description: |- # `sum` Function --> **Note:** This page is about Terraform 0.13 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `sum` takes a list or set of numbers and returns the sum of those numbers. diff --git a/website/docs/configuration/functions/templatefile.html.md b/website/docs/language/functions/templatefile.html.md similarity index 89% rename from website/docs/configuration/functions/templatefile.html.md rename to website/docs/language/functions/templatefile.html.md index b40929e76..95bc2b04f 100644 --- a/website/docs/configuration/functions/templatefile.html.md +++ b/website/docs/language/functions/templatefile.html.md @@ -9,10 +9,6 @@ description: |- # `templatefile` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `templatefile` reads the file at the given path and renders its content as a template using a supplied set of template variables. @@ -21,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. @@ -102,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: ``` @@ -122,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"]} diff --git a/website/docs/configuration/functions/textdecodebase64.html.md b/website/docs/language/functions/textdecodebase64.html.md similarity index 100% rename from website/docs/configuration/functions/textdecodebase64.html.md rename to website/docs/language/functions/textdecodebase64.html.md diff --git a/website/docs/configuration/functions/textencodebase64.html.md b/website/docs/language/functions/textencodebase64.html.md similarity index 100% rename from website/docs/configuration/functions/textencodebase64.html.md rename to website/docs/language/functions/textencodebase64.html.md diff --git a/website/docs/configuration/functions/timeadd.html.md b/website/docs/language/functions/timeadd.html.md similarity index 85% rename from website/docs/configuration/functions/timeadd.html.md rename to website/docs/language/functions/timeadd.html.md index 279724f09..5ba5800d4 100644 --- a/website/docs/configuration/functions/timeadd.html.md +++ b/website/docs/language/functions/timeadd.html.md @@ -9,10 +9,6 @@ description: |- # `timeadd` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `timeadd` adds a duration to a timestamp, returning a new timestamp. ```hcl diff --git a/website/docs/configuration/functions/timestamp.html.md b/website/docs/language/functions/timestamp.html.md similarity index 82% rename from website/docs/configuration/functions/timestamp.html.md rename to website/docs/language/functions/timestamp.html.md index c17527ae2..5ad73efd2 100644 --- a/website/docs/configuration/functions/timestamp.html.md +++ b/website/docs/language/functions/timestamp.html.md @@ -9,10 +9,6 @@ description: |- # `timestamp` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `timestamp` returns a UTC timestamp string in [RFC 3339](https://tools.ietf.org/html/rfc3339) format. In the Terraform language, timestamps are conventionally represented as @@ -24,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/). diff --git a/website/docs/configuration/functions/title.html.md b/website/docs/language/functions/title.html.md similarity index 77% rename from website/docs/configuration/functions/title.html.md rename to website/docs/language/functions/title.html.md index f13fa501d..fef24ddd4 100644 --- a/website/docs/configuration/functions/title.html.md +++ b/website/docs/language/functions/title.html.md @@ -9,10 +9,6 @@ description: |- # `title` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `title` converts the first letter of each word in the given string to uppercase. ## Examples diff --git a/website/docs/configuration/functions/tobool.html.md b/website/docs/language/functions/tobool.html.md similarity index 83% rename from website/docs/configuration/functions/tobool.html.md rename to website/docs/language/functions/tobool.html.md index 24b98e6f2..4ff160929 100644 --- a/website/docs/configuration/functions/tobool.html.md +++ b/website/docs/language/functions/tobool.html.md @@ -8,10 +8,6 @@ description: |- # `tobool` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `tobool` converts its argument to a boolean value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/tolist.html.md b/website/docs/language/functions/tolist.html.md similarity index 83% rename from website/docs/configuration/functions/tolist.html.md rename to website/docs/language/functions/tolist.html.md index 291e5c3b4..682a7e538 100644 --- a/website/docs/configuration/functions/tolist.html.md +++ b/website/docs/language/functions/tolist.html.md @@ -8,10 +8,6 @@ description: |- # `tolist` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `tolist` converts its argument to a list value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/tomap.html.md b/website/docs/language/functions/tomap.html.md similarity index 80% rename from website/docs/configuration/functions/tomap.html.md rename to website/docs/language/functions/tomap.html.md index 9a0362cf7..da28a4d89 100644 --- a/website/docs/configuration/functions/tomap.html.md +++ b/website/docs/language/functions/tomap.html.md @@ -8,10 +8,6 @@ description: |- # `tomap` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `tomap` converts its argument to a map value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/tonumber.html.md b/website/docs/language/functions/tonumber.html.md similarity index 81% rename from website/docs/configuration/functions/tonumber.html.md rename to website/docs/language/functions/tonumber.html.md index 60763304e..1b7e0236b 100644 --- a/website/docs/configuration/functions/tonumber.html.md +++ b/website/docs/language/functions/tonumber.html.md @@ -8,10 +8,6 @@ description: |- # `tonumber` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `tonumber` converts its argument to a number value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/toset.html.md b/website/docs/language/functions/toset.html.md similarity index 85% rename from website/docs/configuration/functions/toset.html.md rename to website/docs/language/functions/toset.html.md index 9a48ee0da..0dc2e73c1 100644 --- a/website/docs/configuration/functions/toset.html.md +++ b/website/docs/language/functions/toset.html.md @@ -8,10 +8,6 @@ description: |- # `toset` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `toset` converts its argument to a set value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/tostring.html.md b/website/docs/language/functions/tostring.html.md similarity index 80% rename from website/docs/configuration/functions/tostring.html.md rename to website/docs/language/functions/tostring.html.md index d0053e6f0..667b3619a 100644 --- a/website/docs/configuration/functions/tostring.html.md +++ b/website/docs/language/functions/tostring.html.md @@ -8,10 +8,6 @@ description: |- # `tostring` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `tostring` converts its argument to a string value. Explicit type conversions are rarely necessary in Terraform because it will diff --git a/website/docs/configuration/functions/transpose.html.md b/website/docs/language/functions/transpose.html.md similarity index 73% rename from website/docs/configuration/functions/transpose.html.md rename to website/docs/language/functions/transpose.html.md index faf9ae964..dde38dac1 100644 --- a/website/docs/configuration/functions/transpose.html.md +++ b/website/docs/language/functions/transpose.html.md @@ -9,10 +9,6 @@ description: |- # `transpose` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `transpose` takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings. diff --git a/website/docs/configuration/functions/trim.html.md b/website/docs/language/functions/trim.html.md similarity index 78% rename from website/docs/configuration/functions/trim.html.md rename to website/docs/language/functions/trim.html.md index 6c2379fa2..43f12f2af 100644 --- a/website/docs/configuration/functions/trim.html.md +++ b/website/docs/language/functions/trim.html.md @@ -9,10 +9,6 @@ description: |- # `trim` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `trim` removes the specified characters from the start and end of the given string. diff --git a/website/docs/configuration/functions/trimprefix.html.md b/website/docs/language/functions/trimprefix.html.md similarity index 81% rename from website/docs/configuration/functions/trimprefix.html.md rename to website/docs/language/functions/trimprefix.html.md index 342e458df..e1058ffba 100644 --- a/website/docs/configuration/functions/trimprefix.html.md +++ b/website/docs/language/functions/trimprefix.html.md @@ -9,10 +9,6 @@ description: |- # `trimprefix` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `trimprefix` removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged. ## Examples diff --git a/website/docs/configuration/functions/trimspace.html.md b/website/docs/language/functions/trimspace.html.md similarity index 77% rename from website/docs/configuration/functions/trimspace.html.md rename to website/docs/language/functions/trimspace.html.md index b6fdd7cde..b4f1a40df 100644 --- a/website/docs/configuration/functions/trimspace.html.md +++ b/website/docs/language/functions/trimspace.html.md @@ -9,10 +9,6 @@ description: |- # `trimspace` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `trimspace` removes any space characters from the start and end of the given string. diff --git a/website/docs/configuration/functions/trimsuffix.html.md b/website/docs/language/functions/trimsuffix.html.md similarity index 78% rename from website/docs/configuration/functions/trimsuffix.html.md rename to website/docs/language/functions/trimsuffix.html.md index 44f90a5d0..727c31b55 100644 --- a/website/docs/configuration/functions/trimsuffix.html.md +++ b/website/docs/language/functions/trimsuffix.html.md @@ -9,10 +9,6 @@ description: |- # `trimsuffix` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `trimsuffix` removes the specified suffix from the end of the given string. ## Examples diff --git a/website/docs/configuration/functions/try.html.md b/website/docs/language/functions/try.html.md similarity index 95% rename from website/docs/configuration/functions/try.html.md rename to website/docs/language/functions/try.html.md index e2c25e5e9..d389a066e 100644 --- a/website/docs/configuration/functions/try.html.md +++ b/website/docs/language/functions/try.html.md @@ -10,10 +10,6 @@ description: |- # `try` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `try` evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors. diff --git a/website/docs/configuration/functions/upper.html.md b/website/docs/language/functions/upper.html.md similarity index 77% rename from website/docs/configuration/functions/upper.html.md rename to website/docs/language/functions/upper.html.md index 65b3c0433..c2fe37579 100644 --- a/website/docs/configuration/functions/upper.html.md +++ b/website/docs/language/functions/upper.html.md @@ -8,10 +8,6 @@ description: |- # `upper` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `upper` converts all cased letters in the given string to uppercase. ## Examples diff --git a/website/docs/configuration/functions/urlencode.html.md b/website/docs/language/functions/urlencode.html.md similarity index 85% rename from website/docs/configuration/functions/urlencode.html.md rename to website/docs/language/functions/urlencode.html.md index 779f6ff35..d5c396156 100644 --- a/website/docs/configuration/functions/urlencode.html.md +++ b/website/docs/language/functions/urlencode.html.md @@ -8,10 +8,6 @@ description: |- # `urlencode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `urlencode` applies URL encoding to a given string. This function identifies characters in the given string that would have a diff --git a/website/docs/configuration/functions/uuid.html.md b/website/docs/language/functions/uuid.html.md similarity index 77% rename from website/docs/configuration/functions/uuid.html.md rename to website/docs/language/functions/uuid.html.md index 7ed9ba9bc..b801bf666 100644 --- a/website/docs/configuration/functions/uuid.html.md +++ b/website/docs/language/functions/uuid.html.md @@ -8,10 +8,6 @@ description: |- # `uuid` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `uuid` generates a unique identifier string. The id is a generated and formatted as required by @@ -23,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. diff --git a/website/docs/configuration/functions/uuidv5.html.md b/website/docs/language/functions/uuidv5.html.md similarity index 93% rename from website/docs/configuration/functions/uuidv5.html.md rename to website/docs/language/functions/uuidv5.html.md index 69043bfb5..24efce01f 100644 --- a/website/docs/configuration/functions/uuidv5.html.md +++ b/website/docs/language/functions/uuidv5.html.md @@ -8,10 +8,6 @@ description: |- # `uuidv5` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `uuidv5` generates a _name-based_ UUID, as described in [RFC 4122 section 4.3](https://tools.ietf.org/html/rfc4122#section-4.3), also known as a "version 5" UUID. diff --git a/website/docs/configuration/functions/values.html.md b/website/docs/language/functions/values.html.md similarity index 77% rename from website/docs/configuration/functions/values.html.md rename to website/docs/language/functions/values.html.md index 4de7b5678..4acc3772b 100644 --- a/website/docs/configuration/functions/values.html.md +++ b/website/docs/language/functions/values.html.md @@ -8,10 +8,6 @@ description: |- # `values` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `values` takes a map and returns a list containing the values of the elements in that map. diff --git a/website/docs/configuration/functions/yamldecode.html.md b/website/docs/language/functions/yamldecode.html.md similarity index 92% rename from website/docs/configuration/functions/yamldecode.html.md rename to website/docs/language/functions/yamldecode.html.md index 600c6312e..b24ae72aa 100644 --- a/website/docs/configuration/functions/yamldecode.html.md +++ b/website/docs/language/functions/yamldecode.html.md @@ -9,10 +9,6 @@ description: |- # `yamldecode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `yamldecode` parses a string as a subset of YAML, and produces a representation of its value. @@ -20,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 | diff --git a/website/docs/configuration/functions/yamlencode.html.md b/website/docs/language/functions/yamlencode.html.md similarity index 91% rename from website/docs/configuration/functions/yamlencode.html.md rename to website/docs/language/functions/yamlencode.html.md index aa128ea22..aa823dcde 100644 --- a/website/docs/configuration/functions/yamlencode.html.md +++ b/website/docs/language/functions/yamlencode.html.md @@ -8,10 +8,6 @@ description: |- # `yamlencode` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `yamlencode` encodes a given value to a string using [YAML 1.2](https://yaml.org/spec/1.2/spec.html) block syntax. @@ -33,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 | diff --git a/website/docs/configuration/functions/zipmap.html.md b/website/docs/language/functions/zipmap.html.md similarity index 81% rename from website/docs/configuration/functions/zipmap.html.md rename to website/docs/language/functions/zipmap.html.md index 66457cf0c..d37926f74 100644 --- a/website/docs/configuration/functions/zipmap.html.md +++ b/website/docs/language/functions/zipmap.html.md @@ -9,10 +9,6 @@ description: |- # `zipmap` Function --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). - `zipmap` constructs a map from a list of keys and a corresponding list of values. diff --git a/website/docs/configuration/index.html.md b/website/docs/language/index.html.md similarity index 96% rename from website/docs/configuration/index.html.md rename to website/docs/language/index.html.md index 1f60b96a2..49067f802 100644 --- a/website/docs/configuration/index.html.md +++ b/website/docs/language/index.html.md @@ -6,7 +6,7 @@ page_title: "Overview - Configuration Language" # Terraform Language Documentation This is the documentation for Terraform's configuration language. It is relevant -to users of [Terraform CLI](/docs/cli-index.html), +to users of [Terraform CLI](/docs/cli/index.html), [Terraform Cloud](/docs/cloud/index.html), and [Terraform Enterprise](/docs/enterprise/index.html). @@ -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. diff --git a/website/docs/configuration/meta-arguments/count.html.md b/website/docs/language/meta-arguments/count.html.md similarity index 92% rename from website/docs/configuration/meta-arguments/count.html.md rename to website/docs/language/meta-arguments/count.html.md index fa2125325..4e92bdb95 100644 --- a/website/docs/configuration/meta-arguments/count.html.md +++ b/website/docs/language/meta-arguments/count.html.md @@ -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 diff --git a/website/docs/configuration/meta-arguments/depends_on.html.md b/website/docs/language/meta-arguments/depends_on.html.md similarity index 100% rename from website/docs/configuration/meta-arguments/depends_on.html.md rename to website/docs/language/meta-arguments/depends_on.html.md diff --git a/website/docs/configuration/meta-arguments/for_each.html.md b/website/docs/language/meta-arguments/for_each.html.md similarity index 87% rename from website/docs/configuration/meta-arguments/for_each.html.md rename to website/docs/language/meta-arguments/for_each.html.md index 23bdeb8e1..44b80a707 100644 --- a/website/docs/configuration/meta-arguments/for_each.html.md +++ b/website/docs/language/meta-arguments/for_each.html.md @@ -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: diff --git a/website/docs/configuration/meta-arguments/lifecycle.html.md b/website/docs/language/meta-arguments/lifecycle.html.md similarity index 98% rename from website/docs/configuration/meta-arguments/lifecycle.html.md rename to website/docs/language/meta-arguments/lifecycle.html.md index 6c9be168c..6671ff3b3 100644 --- a/website/docs/configuration/meta-arguments/lifecycle.html.md +++ b/website/docs/language/meta-arguments/lifecycle.html.md @@ -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: diff --git a/website/docs/configuration/meta-arguments/module-providers.html.md b/website/docs/language/meta-arguments/module-providers.html.md similarity index 94% rename from website/docs/configuration/meta-arguments/module-providers.html.md rename to website/docs/language/meta-arguments/module-providers.html.md index b5b1faca6..99cd8e431 100644 --- a/website/docs/configuration/meta-arguments/module-providers.html.md +++ b/website/docs/language/meta-arguments/module-providers.html.md @@ -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). diff --git a/website/docs/configuration/meta-arguments/resource-provider.html.md b/website/docs/language/meta-arguments/resource-provider.html.md similarity index 89% rename from website/docs/configuration/meta-arguments/resource-provider.html.md rename to website/docs/language/meta-arguments/resource-provider.html.md index 7fa434c93..bdecf834c 100644 --- a/website/docs/configuration/meta-arguments/resource-provider.html.md +++ b/website/docs/language/meta-arguments/resource-provider.html.md @@ -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 `.` 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 `.` reference](/docs/configuration/providers.html#referring-to-alternate-provider-configurations), +[a `.` 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. diff --git a/website/docs/modules/composition.html.markdown b/website/docs/language/modules/develop/composition.html.md similarity index 95% rename from website/docs/modules/composition.html.markdown rename to website/docs/language/modules/develop/composition.html.md index 695690e7a..96c2da685 100644 --- a/website/docs/modules/composition.html.markdown +++ b/website/docs/language/modules/develop/composition.html.md @@ -9,12 +9,6 @@ description: |- # Module Composition --> This section is written for **Terraform v0.12 or later**. The general patterns - described in this section _do_ apply to earlier versions, but the examples - shown are using v0.12-only syntax and features. For general information - on module usage in prior versions, see - [the v0.11 documentation about modules](/docs/configuration-0-11/modules.html). - In a simple Terraform configuration with only one root module, we create a flat set of resources and use Terraform's expression syntax to describe the relationships between these resources: @@ -316,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 @@ -352,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. diff --git a/website/docs/modules/index.html.markdown b/website/docs/language/modules/develop/index.html.md similarity index 83% rename from website/docs/modules/index.html.markdown rename to website/docs/language/modules/develop/index.html.md index af6d608bf..5e71edd59 100644 --- a/website/docs/modules/index.html.markdown +++ b/website/docs/language/modules/develop/index.html.md @@ -15,27 +15,27 @@ Modules can be used to create lightweight abstractions, so that you can describe your infrastructure in terms of its architecture, rather than directly in terms of physical objects. -The `.tf` files in your working directory when you run [`terraform plan`](/docs/commands/plan.html) -or [`terraform apply`](/docs/commands/apply.html) together form the _root_ -module. That module may [call other modules](/docs/configuration/blocks/modules/syntax.html#calling-a-child-module) +The `.tf` files in your working directory when you run [`terraform plan`](/docs/cli/commands/plan.html) +or [`terraform apply`](/docs/cli/commands/apply.html) together form the _root_ +module. That module may [call other modules](/docs/language/modules/syntax.html#calling-a-child-module) and connect them together by passing output values from one to input values of another. -To learn how to _use_ modules, see [the Modules configuration section](/docs/configuration/blocks/modules/index.html). +To learn how to _use_ modules, see [the Modules configuration section](/docs/language/modules/index.html). This section is about _creating_ re-usable modules that other configurations can include using `module` blocks. ## Module structure Re-usable modules are defined using all of the same -[configuration language](/docs/configuration/) concepts we use in root modules. +[configuration language](/docs/language/index.html) concepts we use in root modules. Most commonly, modules use: -* [Input variables](/docs/configuration/variables.html) to accept values from +* [Input variables](/docs/language/values/variables.html) to accept values from the calling module. -* [Output values](/docs/configuration/outputs.html) to return results to the +* [Output values](/docs/language/values/outputs.html) to return results to the calling module, which it can then use to populate arguments elsewhere. -* [Resources](/docs/configuration/blocks/resources/index.html) to define one or more +* [Resources](/docs/language/resources/index.html) to define one or more infrastructure objects that the module will manage. To define a module, create a new directory for it and place one or more `.tf` diff --git a/website/docs/modules/providers.html.md b/website/docs/language/modules/develop/providers.html.md similarity index 94% rename from website/docs/modules/providers.html.md rename to website/docs/language/modules/develop/providers.html.md index 2578a03b1..4d71e3325 100644 --- a/website/docs/modules/providers.html.md +++ b/website/docs/language/modules/develop/providers.html.md @@ -54,10 +54,10 @@ to reintroduce the provider configuration. ## Provider Version Constraints in Modules Although provider _configurations_ are shared between modules, each module must -declare its own [provider requirements](/docs/configuration/provider-requirements.html), so that +declare its own [provider requirements](/docs/language/providers/requirements.html), so that Terraform can ensure that there is a single version of the provider that is compatible with all modules in the configuration and to specify the -[source address](/docs/configuration/provider-requirements.html#source-addresses) that serves as +[source address](/docs/language/providers/requirements.html#source-addresses) that serves as the global (module-agnostic) identifier for a provider. To declare that a module requires particular versions of a specific provider, @@ -80,7 +80,7 @@ however, specify any of the configuration settings that determine what remote endpoints the provider will access, such as an AWS region; configuration settings come from provider _configurations_, and a particular overall Terraform configuration can potentially have -[several different configurations for the same provider](/docs/configuration/providers.html#alias-multiple-provider-configurations). +[several different configurations for the same provider](/docs/language/providers/configuration.html#alias-multiple-provider-configurations). If you are writing a shared Terraform module, constrain only the minimum required provider version using a `>=` constraint. This should specify the @@ -121,10 +121,10 @@ resource "aws_s3_bucket" "example" { We recommend using this approach when a single configuration for each provider is sufficient for an entire configuration. -~> **Note:** Only provider configurations are inherited by child modules, not provider source or version requirements. Each module must [declare its own provider requirements](/docs/configuration/provider-requirements.html). This is especially important for non-HashiCorp providers. +~> **Note:** Only provider configurations are inherited by child modules, not provider source or version requirements. Each module must [declare its own provider requirements](/docs/language/providers/requirements.html). This is especially important for non-HashiCorp providers. In more complex situations there may be -[multiple provider configurations](/docs/configuration/providers.html#alias-multiple-provider-configurations), +[multiple provider configurations](/docs/language/providers/configuration.html#alias-multiple-provider-configurations), or a child module may need to use different provider settings than its parent. For such situations, you must pass providers explicitly. @@ -161,7 +161,7 @@ module "example" { ``` The `providers` argument within a `module` block is similar to -[the `provider` argument](/docs/configuration/meta-arguments/resource-provider.html) +[the `provider` argument](/docs/language/meta-arguments/resource-provider.html) within a resource, but is a map rather than a single string because a module may contain resources from many different providers. @@ -231,7 +231,7 @@ valid, it is not necessary: proxy configuration blocks are needed only to establish which _aliased_ provider configurations a child module expects. Don't use a proxy configuration block if a module only needs a single default provider configuration, and don't use proxy configuration blocks only to imply -[provider requirements](/docs/configuration/provider-requirements.html). +[provider requirements](/docs/language/providers/requirements.html). ## Legacy Shared Modules with Provider Configurations diff --git a/website/docs/modules/publish.html.markdown b/website/docs/language/modules/develop/publish.html.md similarity index 84% rename from website/docs/modules/publish.html.markdown rename to website/docs/language/modules/develop/publish.html.md index b0eebf367..93a17e3df 100644 --- a/website/docs/modules/publish.html.markdown +++ b/website/docs/language/modules/develop/publish.html.md @@ -14,7 +14,7 @@ If you've built a module that you intend to be reused, we recommend your module, generate documentation, and more. Published modules can be easily consumed by Terraform, and users can -[constrain module versions](/docs/configuration/blocks/modules/syntax.html#version) +[constrain module versions](/docs/language/modules/syntax.html#version) for safe and predictable updates. The following example shows how a caller might use a module from the Terraform Registry: @@ -32,11 +32,11 @@ the same benefits. Although the registry is the native mechanism for distributing re-usable modules, Terraform can also install modules from -[various other sources](/docs/modules/sources.html). The alternative sources +[various other sources](/docs/language/modules/sources.html). The alternative sources do not support the first-class versioning mechanism, but some sources have their own mechanisms for selecting particular VCS commits, etc. We recommend that modules distributed via other protocols still use the -[standard module structure](/docs/modules/structure.html) so that they can +[standard module structure](/docs/language/modules/develop/structure.html) so that they can be used in a similar way as a registry module or be published on the registry at a later time. diff --git a/website/docs/modules/structure.html.md b/website/docs/language/modules/develop/structure.html.md similarity index 97% rename from website/docs/modules/structure.html.md rename to website/docs/language/modules/develop/structure.html.md index e3b0225b0..6aed2b265 100644 --- a/website/docs/modules/structure.html.md +++ b/website/docs/language/modules/develop/structure.html.md @@ -54,8 +54,8 @@ don't need to do any extra work to follow the standard structure. * **Variables and outputs should have descriptions.** All variables and outputs should have one or two sentence descriptions that explain their purpose. This is used for documentation. See the documentation for - [variable configuration](/docs/configuration/variables.html) and - [output configuration](/docs/configuration/outputs.html) for more details. + [variable configuration](/docs/language/values/variables.html) and + [output configuration](/docs/language/values/outputs.html) for more details. * **Nested modules**. Nested modules should exist under the `modules/` subdirectory. Any nested module with a `README.md` is considered usable diff --git a/website/docs/configuration/blocks/modules/index.html.md b/website/docs/language/modules/index.html.md similarity index 83% rename from website/docs/configuration/blocks/modules/index.html.md rename to website/docs/language/modules/index.html.md index e5f756102..2aef04ab3 100644 --- a/website/docs/configuration/blocks/modules/index.html.md +++ b/website/docs/language/modules/index.html.md @@ -48,21 +48,21 @@ module registry for sharing modules internally within your organization. ## Using Modules -- [Module Blocks](/docs/configuration/blocks/modules/syntax.html) documents the syntax for +- [Module Blocks](/docs/language/modules/syntax.html) documents the syntax for calling a child module from a parent module, including meta-arguments like `for_each`. -- [Module Sources](/docs/modules/sources.html) documents what kinds of paths, +- [Module Sources](/docs/language/modules/sources.html) documents what kinds of paths, addresses, and URIs can be used in the `source` argument of a module block. - The Meta-Arguments section documents special arguments that can be used with every module, including - [`providers`](/docs/configuration/meta-arguments/module-providers.html), - [`depends_on`](/docs/configuration/meta-arguments/depends_on.html), - [`count`](/docs/configuration/meta-arguments/count.html), - and [`for_each`](/docs/configuration/meta-arguments/for_each.html). + [`providers`](/docs/language/meta-arguments/module-providers.html), + [`depends_on`](/docs/language/meta-arguments/depends_on.html), + [`count`](/docs/language/meta-arguments/count.html), + and [`for_each`](/docs/language/meta-arguments/for_each.html). ## Developing Modules For information about developing reusable modules, see -[Module Development](/docs/modules/index.html). +[Module Development](/docs/language/modules/develop/index.html). diff --git a/website/docs/modules/sources.html.markdown b/website/docs/language/modules/sources.html.md similarity index 98% rename from website/docs/modules/sources.html.markdown rename to website/docs/language/modules/sources.html.md index 692fda2be..c8e232909 100644 --- a/website/docs/modules/sources.html.markdown +++ b/website/docs/language/modules/sources.html.md @@ -7,7 +7,7 @@ description: The source argument within a module block specifies the location of # Module Sources -The `source` argument in [a `module` block](/docs/configuration/blocks/modules/syntax.html) +The `source` argument in [a `module` block](/docs/language/modules/syntax.html) tells Terraform where to find the source code for the desired child module. Terraform uses this during the module installation step of `terraform init` @@ -123,13 +123,13 @@ the `remote` backend. Registry modules support versioning. You can provide a specific version as shown in the above examples, or use flexible -[version constraints](/docs/configuration/blocks/modules/syntax.html#version). +[version constraints](/docs/language/modules/syntax.html#version). You can learn more about the registry at the [Terraform Registry documentation](/docs/registry/modules/use.html#using-modules). To access modules from a private registry, you may need to configure an access -token [in the CLI config](/docs/commands/cli-config.html#credentials). Use the +token [in the CLI config](/docs/cli/config/config-file.html#credentials). Use the same hostname as used in the module source string. For a private registry within Terraform Cloud, use the same authentication token as you would use with the Enterprise API or command-line clients. diff --git a/website/docs/configuration/blocks/modules/syntax.html.md b/website/docs/language/modules/syntax.html.md similarity index 84% rename from website/docs/configuration/blocks/modules/syntax.html.md rename to website/docs/language/modules/syntax.html.md index e3d7d72f1..9bbf78d9f 100644 --- a/website/docs/configuration/blocks/modules/syntax.html.md +++ b/website/docs/language/modules/syntax.html.md @@ -8,10 +8,6 @@ description: |- # Module Blocks --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Modules](/docs/configuration-0-11/modules.html). - > **Hands-on:** Try the [Reuse Configuration with Modules](https://learn.hashicorp.com/collections/terraform/modules?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) collection on HashiCorp Learn. A _module_ is a container for multiple resources that are used together. @@ -27,13 +23,13 @@ in separate configurations, allowing resource configurations to be packaged and re-used. This page describes how to call one module from another. For more information -about creating re-usable child modules, see [Module Development](/docs/modules/index.html). +about creating re-usable child modules, see [Module Development](/docs/language/modules/develop/index.html). ## Calling a Child Module To _call_ a module means to include the contents of that module into the configuration with specific values for its -[input variables](/docs/configuration/variables.html). Modules are called +[input variables](/docs/language/values/variables.html). Modules are called from within other modules using `module` blocks: ```hcl @@ -57,7 +53,7 @@ Module calls use the following kinds of arguments: - The `version` argument is recommended for modules from a registry. -- Most other arguments correspond to [input variables](/docs/configuration/variables.html) +- Most other arguments correspond to [input variables](/docs/language/values/variables.html) defined by the module. (The `servers` argument in the example above is one of these.) @@ -71,7 +67,7 @@ Terraform. Its value is either the path to a local directory containing 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; arbitrary expressions 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 @@ -99,7 +95,7 @@ module "consul" { } ``` -The `version` argument accepts a [version constraint string](/docs/configuration/version-constraints.html). +The `version` argument accepts a [version constraint string](/docs/language/expressions/version-constraints.html). Terraform will use the newest installed version of the module that meets the constraint; if no acceptable versions are installed, it will download the newest version that meets the constraint. @@ -120,22 +116,22 @@ optional meta-arguments that have special meaning across all modules, described in more detail in the following pages: - `count` - Creates multiple instances of a module from a single `module` block. - See [the `count` page](/docs/configuration/meta-arguments/count.html) + See [the `count` page](/docs/language/meta-arguments/count.html) for details. - `for_each` - Creates multiple instances of a module from a single `module` block. See - [the `for_each` page](/docs/configuration/meta-arguments/for_each.html) + [the `for_each` page](/docs/language/meta-arguments/for_each.html) for details. - `providers` - Passes provider configurations to a child module. See - [the `providers` page](/docs/configuration/meta-arguments/module-providers.html) + [the `providers` page](/docs/language/meta-arguments/module-providers.html) for details. If not specified, the child module inherits all of the default (un-aliased) provider configurations from the calling module. - `depends_on` - Creates explicit dependencies between the entire module and the listed targets. See - [the `depends_on` page](/docs/configuration/meta-arguments/depends_on.html) + [the `depends_on` page](/docs/language/meta-arguments/depends_on.html) for details. In addition to the above, the `lifecycle` argument is not currently used by @@ -145,7 +141,7 @@ Terraform but is reserved for planned future features. The resources defined in a module are encapsulated, so the calling module cannot access their attributes directly. However, the child module can -declare [output values](/docs/configuration/outputs.html) to selectively +declare [output values](/docs/language/values/outputs.html) to selectively export certain values to be accessed by the calling module. For example, if the `./app-cluster` module referenced in the example above @@ -161,7 +157,7 @@ resource "aws_elb" "example" { ``` For more information about referring to named values, see -[Expressions](/docs/configuration/expressions/index.html). +[Expressions](/docs/language/expressions/index.html). ## Transferring Resource State Into Modules @@ -172,25 +168,25 @@ after moving code across modules to ensure that no resources are deleted by surprise. If you want to make sure an existing resource is preserved, use -[the `terraform state mv` command](/docs/commands/state/mv.html) to inform +[the `terraform state mv` command](/docs/cli/commands/state/mv.html) to inform Terraform that it has moved to a different module. When passing resource addresses to `terraform state mv`, resources within child modules must be prefixed with `module..`. If a module was called with -[`count`](/docs/configuration/meta-arguments/count.html) or -[`for_each`](/docs/configuration/meta-arguments/for_each.html), +[`count`](/docs/language/meta-arguments/count.html) or +[`for_each`](/docs/language/meta-arguments/for_each.html), its resource addresses must be prefixed with `module.[].` instead, where `` matches the `count.index` or `each.key` value of a particular module instance. Full resource addresses for module contents are used within the UI and on the command line, but cannot be used within a Terraform configuration. Only -[outputs](/docs/configuration/outputs.html) from a module can be referenced from +[outputs](/docs/language/values/outputs.html) from a module can be referenced from elsewhere in your configuration. ## Tainting resources within a module -The [taint command](/docs/commands/taint.html) can be used to _taint_ specific +The [taint command](/docs/cli/commands/taint.html) can be used to _taint_ specific resources within a module: ```shell diff --git a/website/docs/configuration/providers.html.md b/website/docs/language/providers/configuration.html.md similarity index 88% rename from website/docs/configuration/providers.html.md rename to website/docs/language/providers/configuration.html.md index a6377a713..612e8f9d5 100644 --- a/website/docs/configuration/providers.html.md +++ b/website/docs/language/providers/configuration.html.md @@ -8,10 +8,6 @@ description: |- # Provider Configuration --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Providers](../configuration-0-11/providers.html). - Terraform relies on plugins called "providers" to interact with remote systems. Terraform configurations must declare which providers they require, so that @@ -20,7 +16,7 @@ configuration (like endpoint URLs or cloud regions) before they can be used. - This page documents how to configure settings for providers. -- The [Provider Requirements](./provider-requirements.html) page documents how +- The [Provider Requirements](/docs/language/providers/requirements.html) page documents how to declare providers so Terraform can install them. ## Provider Configuration @@ -28,8 +24,8 @@ configuration (like endpoint URLs or cloud regions) before they can be used. Provider configurations belong in the root module of a Terraform configuration. (Child modules receive their provider configurations from the root module; for more information, see -[The Module `providers` Meta-Argument](/docs/configuration/meta-arguments/module-providers.html) -and [Module Development: Providers Within Modules](/docs/modules/providers.html).) +[The Module `providers` Meta-Argument](/docs/language/meta-arguments/module-providers.html) +and [Module Development: Providers Within Modules](/docs/language/modules/develop/providers.html).) A provider configuration is created using a `provider` block: @@ -41,7 +37,7 @@ provider "google" { ``` The name given in the block header (`"google"` in this example) is the -[local name](./provider-requirements.html#local-names) of the provider to +[local name](/docs/language/providers/requirements.html#local-names) of the provider to configure. This provider should already be included in a `required_providers` block. @@ -50,7 +46,7 @@ the provider. Most arguments in this section are defined by the provider itself; in this example both `project` and `region` are specific to the `google` provider. -You can use [expressions](/docs/configuration/expressions/index.html) in the values of these +You can use [expressions](/docs/language/expressions/index.html) in the values of these configuration arguments, but can only reference values that are known before the configuration is applied. This means you can safely reference input variables, but not attributes exported by resources (with an exception for resource @@ -72,7 +68,7 @@ and available for all `provider` blocks: - [`alias`, for using the same provider with different configurations for different resources][inpage-alias] - [`version`, which we no longer recommend][inpage-versions] (use - [provider requirements](./provider-requirements.html) instead) + [provider requirements](/docs/language/providers/requirements.html) instead) Unlike many other objects in the Terraform language, a `provider` block may be omitted if its contents would otherwise be empty. Terraform assumes an @@ -161,7 +157,7 @@ module "aws_vpc" { ``` Modules have some special requirements when passing in providers; see -[The Module `providers` Meta-Argument](/docs/configuration/meta-arguments/module-providers.html) +[The Module `providers` Meta-Argument](/docs/language/meta-arguments/module-providers.html) for more details. In most cases, only _root modules_ should define provider configurations, with all child modules obtaining their provider configurations from their parents. @@ -174,13 +170,13 @@ from their parents. The `version` meta-argument specifies a version constraint for a provider, and works the same way as the `version` argument in a -[`required_providers` block](./provider-requirements.html). The version +[`required_providers` block](/docs/language/providers/requirements.html). The version constraint in a provider configuration is only used if `required_providers` does not include one for that provider. **The `version` argument in provider configurations is deprecated.** In Terraform 0.13 and later, version constraints should always be declared in -[the `required_providers` block](./provider-requirements.html). The `version` +[the `required_providers` block](/docs/language/providers/requirements.html). The `version` argument will be removed in a future version of Terraform. -> **Note:** The `version` meta-argument made sense before Terraform 0.13, since diff --git a/website/docs/configuration/blocks/providers/index.html.md b/website/docs/language/providers/index.html.md similarity index 92% rename from website/docs/configuration/blocks/providers/index.html.md rename to website/docs/language/providers/index.html.md index 287eb6539..44f830101 100644 --- a/website/docs/configuration/blocks/providers/index.html.md +++ b/website/docs/language/providers/index.html.md @@ -13,8 +13,8 @@ configuration (like endpoint URLs or cloud regions) before they can be used. ## What Providers Do -Each provider adds a set of [resource types](/docs/configuration/blocks/resources/index.html) -and/or [data sources](/docs/configuration/data-sources.html) that Terraform can +Each provider adds a set of [resource types](/docs/language/resources/index.html) +and/or [data sources](/docs/language/data-sources/index.html) that Terraform can manage. Every resource type is implemented by a provider; without providers, Terraform @@ -38,13 +38,13 @@ providers for most major infrastructure platforms. To use resources from a given provider, you need to include some information about it in your configuration. See the following pages for details: -- [Provider Requirements](/docs/configuration/provider-requirements.html) +- [Provider Requirements](/docs/language/providers/requirements.html) documents how to declare providers so Terraform can install them. -- [Provider Configuration](/docs/configuration/providers.html) +- [Provider Configuration](/docs/language/providers/configuration.html) documents how to configure settings for providers. -- [Dependency Lock File](/docs/configuration/dependency-lock.html) +- [Dependency Lock File](/docs/language/dependency-lock.html) documents an additional HCL file that can be included with a configuration, which tells Terraform to always use a specific set of provider versions. @@ -60,11 +60,11 @@ about it in your configuration. See the following pages for details: To save time and bandwidth, Terraform CLI supports an optional plugin cache. You can enable the cache using the `plugin_cache_dir` setting in - [the CLI configuration file](/docs/commands/cli-config.html). + [the CLI configuration file](/docs/cli/config/config-file.html). To ensure Terraform always installs the same provider versions for a given configuration, you can use Terraform CLI to create a -[dependency lock file](/docs/configuration/dependency-lock.html) +[dependency lock file](/docs/language/dependency-lock.html) and commit it to version control along with your configuration. If a lock file is present, Terraform Cloud, CLI, and Enterprise will all obey it when installing providers. diff --git a/website/docs/configuration/provider-requirements.html.md b/website/docs/language/providers/requirements.html.md similarity index 95% rename from website/docs/configuration/provider-requirements.html.md rename to website/docs/language/providers/requirements.html.md index 40ca196da..128192432 100644 --- a/website/docs/configuration/provider-requirements.html.md +++ b/website/docs/language/providers/requirements.html.md @@ -7,8 +7,7 @@ page_title: "Provider Requirements - Configuration Language" -> **Note:** This page is about a feature of Terraform 0.13 and later; it also describes how to use the more limited version of that feature that was available -in Terraform 0.12. If you are using Terraform 0.11 or earlier, see -[0.11 Configuration Language: Provider Versions](../configuration-0-11/providers.html#provider-versions) instead. +in Terraform 0.12. Terraform relies on plugins called "providers" to interact with remote systems. @@ -18,7 +17,7 @@ configuration (like endpoint URLs or cloud regions) before they can be used. - This page documents how to declare providers so Terraform can install them. -- The [Provider Configuration](./providers.html) page documents how to configure +- The [Provider Configuration](/docs/language/providers/configuration.html) page documents how to configure settings for providers. ## Requiring Providers @@ -42,7 +41,7 @@ terraform { ``` The `required_providers` block must be nested inside the top-level -[`terraform` block](terraform.html) (which can also contain other settings). +[`terraform` block](/docs/language/settings/index.html) (which can also contain other settings). Each argument in the `required_providers` block enables one provider. The key determines the provider's [local name](#local-names) (its unique identifier @@ -79,7 +78,7 @@ Local names must be unique per-module. Outside of the `required_providers` block, Terraform configurations always refer to providers by their local names. For example, the following configuration declares `mycloud` as the local name for `mycorp/mycloud`, then uses that local -name when [configuring the provider](./providers.html): +name when [configuring the provider](/docs/language/providers/configuration.html): ```hcl terraform { @@ -209,7 +208,7 @@ avoiding typing. Each provider plugin has its own set of available versions, allowing the functionality of the provider to evolve over time. Each provider dependency you -declare should have a [version constraint](./version-constraints.html) given in +declare should have a [version constraint](/docs/language/expressions/version-constraints.html) given in the `version` argument so Terraform can select a single version per provider that all modules are compatible with. @@ -219,7 +218,7 @@ a version constraint for every provider your module depends on. To ensure Terraform always installs the same provider versions for a given configuration, you can use Terraform CLI to create a -[dependency lock file](/docs/configuration/dependency-lock.html) +[dependency lock file](/docs/language/dependency-lock.html) and commit it to version control along with your configuration. If a lock file is present, Terraform Cloud, CLI, and Enterprise will all obey it when installing providers. @@ -271,7 +270,7 @@ incompatibilities, and let the root module manage the maximum version. While most Terraform providers are distributed separately as plugins, there is currently one provider that is built in to Terraform itself, which provides -[the `terraform_remote_state` data source](/docs/providers/terraform/d/remote_state.html). +[the `terraform_remote_state` data source](/docs/language/state/remote-state-data.html). Because this provider is built in to Terraform, you don't need to declare it in the `required_providers` block in order to use its features. However, for @@ -304,7 +303,7 @@ registry, by implementing Running an additional service just to distribute a single provider internally may be undesirable, so Terraform also supports -[other provider installation methods](/docs/commands/cli-config.html#provider-installation), +[other provider installation methods](/docs/cli/config/config-file.html#provider-installation), including placing provider plugins directly in specific directories in the local filesystem, via _filesystem mirrors_. @@ -333,7 +332,7 @@ terraform { To make version 1.0.0 of this provider available for installation from the local filesystem, choose one of the -[implied local mirror directories](/docs/commands/cli-config.html#implied-local-mirror-directories) +[implied local mirror directories](/docs/cli/config/config-file.html#implied-local-mirror-directories) and create a directory structure under it like this: ``` diff --git a/website/docs/configuration/blocks/resources/behavior.html.md b/website/docs/language/resources/behavior.html.md similarity index 89% rename from website/docs/configuration/blocks/resources/behavior.html.md rename to website/docs/language/resources/behavior.html.md index b565e0abf..70c0e2da7 100644 --- a/website/docs/configuration/blocks/resources/behavior.html.md +++ b/website/docs/language/resources/behavior.html.md @@ -18,7 +18,7 @@ match the configuration. When Terraform creates a new infrastructure object represented by a `resource` block, the identifier for that real object is saved in Terraform's -[state](/docs/state/index.html), allowing it to be updated and destroyed +[state](/docs/language/state/index.html), allowing it to be updated and destroyed in response to future changes. For resource blocks that already have an associated infrastructure object in the state, Terraform compares the actual configuration of the object with the arguments given in the @@ -42,7 +42,7 @@ customized on a per-resource basis. ## Accessing Resource Attributes -[Expressions](/docs/configuration/expressions/index.html) within a Terraform module can access +[Expressions](/docs/language/expressions/index.html) within a Terraform module can access information about resources in the same module, and you can use that information to help configure other resources. Use the `..` syntax to reference a resource attribute in an expression. @@ -52,7 +52,7 @@ read-only attributes with information obtained from the remote API; this often includes things that can't be known until the resource is created, like the resource's unique random ID. -Many providers also include [data sources](/docs/configuration/data-sources.html), +Many providers also include [data sources](/docs/language/data-sources/index.html), which are a special type of resource used only for looking up information. For a list of the attributes a resource or data source type provides, consult @@ -60,7 +60,7 @@ its documentation; these are generally included in a second list below its list of configurable arguments. For more information about referencing resource attributes in expressions, see -[Expressions: References to Resource Attributes](/docs/configuration/expressions/references.html#references-to-resource-attributes). +[Expressions: References to Resource Attributes](/docs/language/expressions/references.html#references-to-resource-attributes). ## Resource Dependencies @@ -73,7 +73,7 @@ resource's configuration just requires information generated by another resource. Most resource dependencies are handled automatically. Terraform analyses any -[expressions](/docs/configuration/expressions/index.html) within a `resource` block to find references +[expressions](/docs/language/expressions/index.html) within a `resource` block to find references to other objects, and treats those references as implicit ordering requirements when creating, updating, or destroying resources. Since most resources with behavioral dependencies on other resources also refer to those resources' data, @@ -84,7 +84,7 @@ example, if Terraform must manage access control policies _and_ take actions that require those policies to be present, there is a hidden dependency between the access policy and a resource whose creation depends on it. In these rare cases, -[the `depends_on` meta-argument](/docs/configuration/meta-arguments/depends_on.html) +[the `depends_on` meta-argument](/docs/language/meta-arguments/depends_on.html) can explicitly specify a dependency. ## Local-only Resources diff --git a/website/docs/configuration/blocks/resources/index.html.md b/website/docs/language/resources/index.html.md similarity index 64% rename from website/docs/configuration/blocks/resources/index.html.md rename to website/docs/language/resources/index.html.md index 676741f0e..891202d34 100644 --- a/website/docs/configuration/blocks/resources/index.html.md +++ b/website/docs/language/resources/index.html.md @@ -12,22 +12,22 @@ Each resource block describes one or more infrastructure objects, such as virtual networks, compute instances, or higher-level components such as DNS records. -- [Resource Blocks](/docs/configuration/blocks/resources/syntax.html) documents +- [Resource Blocks](/docs/language/resources/syntax.html) documents the syntax for declaring resources. -- [Resource Behavior](/docs/configuration/blocks/resources/behavior.html) explains in +- [Resource Behavior](/docs/language/resources/behavior.html) explains in more detail how Terraform handles resource declarations when applying a configuration. - The Meta-Arguments section documents special arguments that can be used with every resource type, including - [`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), - and [`lifecycle`](/docs/configuration/meta-arguments/lifecycle.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), + and [`lifecycle`](/docs/language/meta-arguments/lifecycle.html). -- [Provisioners](/docs/configuration/blocks/resources/provisioners/index.html) +- [Provisioners](/docs/language/resources/provisioners/index.html) documents configuring post-creation actions for a resource using the `provisioner` and `connection` blocks. Since provisioners are non-declarative and potentially unpredictable, we strongly recommend that you treat them as a diff --git a/website/docs/provisioners/chef.html.markdown b/website/docs/language/resources/provisioners/chef.html.md similarity index 95% rename from website/docs/provisioners/chef.html.markdown rename to website/docs/language/resources/provisioners/chef.html.md index b8eeb7bf0..e420b9a38 100644 --- a/website/docs/provisioners/chef.html.markdown +++ b/website/docs/language/resources/provisioners/chef.html.md @@ -10,7 +10,7 @@ description: |- The `chef` provisioner installs, configures and runs the Chef Client on a remote resource. The `chef` provisioner supports both `ssh` and `winrm` type -[connections](/docs/provisioners/connection.html). +[connections](/docs/language/resources/provisioners/connection.html). !> **Note:** This provisioner was removed in the 0.15.0 version of Terraform after being deprecated as of Terraform 0.13.4. For most common situations there are better alternatives to using provisioners. For more information, see [the main Provisioners page](./). @@ -68,7 +68,7 @@ The following arguments are supported: * `attributes_json (string)` - (Optional) A raw JSON string with initial node attributes for the new node. These can also be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). + [the `file` function](/docs/language/functions/file.html). * `channel (string)` - (Optional) The Chef Client release channel to install from. If not set, the `stable` channel will be used. @@ -127,7 +127,7 @@ The following arguments are supported: * `prevent_sudo (boolean)` - (Optional) Prevent the use of the `sudo` command while installing, configuring and running the initial Chef Client run. This option is only used with `ssh` type - [connections](/docs/provisioners/connection.html). + [connections](/docs/language/resources/provisioners/connection.html). * `recreate_client (boolean)` - (Optional) If `true`, first delete any existing Chef Node and Client before registering the new Chef Client. @@ -145,7 +145,7 @@ The following arguments are supported: * `secret_key (string)` - (Optional) The contents of the secret key that is used by the Chef Client to decrypt data bags on the Chef Server. The key will be uploaded to the remote machine. This can also be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). + [the `file` function](/docs/language/functions/file.html). * `server_url (string)` - (Required) The URL to the Chef server. This includes the path to the organization. See the example. @@ -167,11 +167,11 @@ The following arguments are supported: * `user_key (string)` - (Required) The contents of the user key that will be used to authenticate with the Chef Server. This can also be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). + [the `file` function](/docs/language/functions/file.html). * `vault_json (string)` - (Optional) A raw JSON string with Chef Vaults and Items to which the new node should have access. These can also be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). + [the `file` function](/docs/language/functions/file.html). * `version (string)` - (Optional) The Chef Client version to install on the remote machine. If not set, the latest available version will be installed. diff --git a/website/docs/provisioners/connection.html.markdown b/website/docs/language/resources/provisioners/connection.html.md similarity index 96% rename from website/docs/provisioners/connection.html.markdown rename to website/docs/language/resources/provisioners/connection.html.md index 52005876c..698ddfad7 100644 --- a/website/docs/provisioners/connection.html.markdown +++ b/website/docs/language/resources/provisioners/connection.html.md @@ -108,12 +108,12 @@ block would create a dependency cycle. * `private_key` - The contents of an SSH key to use for the connection. These can be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). This takes + [the `file` function](/docs/language/functions/file.html). This takes preference over the password if provided. * `certificate` - The contents of a signed CA Certificate. The certificate argument must be used in conjunction with a `private_key`. These can - be loaded from a file on disk using the [the `file` function](/docs/configuration/functions/file.html). + be loaded from a file on disk using the [the `file` function](/docs/language/functions/file.html). * `agent` - Set to `false` to disable using `ssh-agent` to authenticate. On Windows the only supported SSH authentication agent is @@ -161,9 +161,9 @@ The `ssh` connection also supports the following fields to facilitate connnectio * `bastion_private_key` - The contents of an SSH key file to use for the bastion host. These can be loaded from a file on disk using - [the `file` function](/docs/configuration/functions/file.html). + [the `file` function](/docs/language/functions/file.html). Defaults to the value of the `private_key` field. * `bastion_certificate` - The contents of a signed CA Certificate. The certificate argument must be used in conjunction with a `bastion_private_key`. These can be loaded from - a file on disk using the [the `file` function](/docs/configuration/functions/file.html). + a file on disk using the [the `file` function](/docs/language/functions/file.html). diff --git a/website/docs/provisioners/file.html.markdown b/website/docs/language/resources/provisioners/file.html.md similarity index 97% rename from website/docs/provisioners/file.html.markdown rename to website/docs/language/resources/provisioners/file.html.md index 1d6770a83..05b494e5b 100644 --- a/website/docs/provisioners/file.html.markdown +++ b/website/docs/language/resources/provisioners/file.html.md @@ -10,7 +10,7 @@ description: |- The `file` provisioner is used to copy files or directories from the machine executing Terraform to the newly created resource. The `file` provisioner -supports both `ssh` and `winrm` type [connections](/docs/provisioners/connection.html). +supports both `ssh` and `winrm` type [connections](/docs/language/resources/provisioners/connection.html). -> **Note:** Provisioners should only be used as a last resort. For most common situations there are better alternatives. For more information, see diff --git a/website/docs/provisioners/habitat.html.markdown b/website/docs/language/resources/provisioners/habitat.html.md similarity index 100% rename from website/docs/provisioners/habitat.html.markdown rename to website/docs/language/resources/provisioners/habitat.html.md diff --git a/website/docs/configuration/blocks/resources/provisioners/index.html.md b/website/docs/language/resources/provisioners/index.html.md similarity index 100% rename from website/docs/configuration/blocks/resources/provisioners/index.html.md rename to website/docs/language/resources/provisioners/index.html.md diff --git a/website/docs/provisioners/local-exec.html.markdown b/website/docs/language/resources/provisioners/local-exec.html.md similarity index 96% rename from website/docs/provisioners/local-exec.html.markdown rename to website/docs/language/resources/provisioners/local-exec.html.md index d28cbcffd..f0d463ea7 100644 --- a/website/docs/provisioners/local-exec.html.markdown +++ b/website/docs/language/resources/provisioners/local-exec.html.md @@ -11,7 +11,7 @@ description: |- The `local-exec` provisioner invokes a local executable after a resource is created. This invokes a process on the machine running Terraform, not on the resource. See the `remote-exec` -[provisioner](/docs/provisioners/remote-exec.html) to run commands on the +[provisioner](/docs/language/resources/provisioners/remote-exec.html) to run commands on the resource. Note that even though the resource will be fully created when the provisioner is diff --git a/website/docs/provisioners/null_resource.html.markdown b/website/docs/language/resources/provisioners/null_resource.html.md similarity index 91% rename from website/docs/provisioners/null_resource.html.markdown rename to website/docs/language/resources/provisioners/null_resource.html.md index 8ee6f62f9..7fb94a4e8 100644 --- a/website/docs/provisioners/null_resource.html.markdown +++ b/website/docs/language/resources/provisioners/null_resource.html.md @@ -16,8 +16,8 @@ resource, you can associate them with a `null_resource`. Instances of [`null_resource`][null] are treated like normal resources, but they don't do anything. Like with any other resource, you can configure -[provisioners](/docs/provisioners/index.html) and [connection -details](/docs/provisioners/connection.html) on a `null_resource`. You can also +[provisioners](/docs/language/resources/provisioners/syntax.html) and [connection +details](/docs/language/resources/provisioners/connection.html) on a `null_resource`. You can also use its `triggers` argument and any meta-arguments to control exactly where in the dependency graph its provisioners will run. diff --git a/website/docs/provisioners/puppet.html.markdown b/website/docs/language/resources/provisioners/puppet.html.md similarity index 98% rename from website/docs/provisioners/puppet.html.markdown rename to website/docs/language/resources/provisioners/puppet.html.md index d350c09a8..0e5005256 100644 --- a/website/docs/provisioners/puppet.html.markdown +++ b/website/docs/language/resources/provisioners/puppet.html.md @@ -10,7 +10,7 @@ description: |- The `puppet` provisioner installs, configures and runs the Puppet agent on a remote resource. The `puppet` provisioner supports both `ssh` and `winrm` type -[connections](/docs/provisioners/connection.html). +[connections](/docs/language/resources/provisioners/connection.html). !> **Note:** This provisioner was removed in the 0.15.0 version of Terraform after being deprecated as of Terraform 0.13.4. For most common situations there are better alternatives to using provisioners. For more information, see [the main Provisioners page](./). diff --git a/website/docs/provisioners/remote-exec.html.markdown b/website/docs/language/resources/provisioners/remote-exec.html.md similarity index 91% rename from website/docs/provisioners/remote-exec.html.markdown rename to website/docs/language/resources/provisioners/remote-exec.html.md index 0d56343ce..7962cdd00 100644 --- a/website/docs/provisioners/remote-exec.html.markdown +++ b/website/docs/language/resources/provisioners/remote-exec.html.md @@ -11,8 +11,8 @@ description: |- The `remote-exec` provisioner invokes a script on a remote resource after it is created. This can be used to run a configuration management tool, bootstrap into a cluster, etc. To invoke a local process, see the `local-exec` -[provisioner](/docs/provisioners/local-exec.html) instead. The `remote-exec` -provisioner supports both `ssh` and `winrm` type [connections](/docs/provisioners/connection.html). +[provisioner](/docs/language/resources/provisioners/local-exec.html) instead. The `remote-exec` +provisioner supports both `ssh` and `winrm` type [connections](/docs/language/resources/provisioners/connection.html). -> **Note:** Provisioners should only be used as a last resort. For most common situations there are better alternatives. For more information, see @@ -53,7 +53,7 @@ The following arguments are supported: You cannot pass any arguments to scripts using the `script` or `scripts` arguments to this provisioner. If you want to specify arguments, upload the script with the -[file provisioner](/docs/provisioners/file.html) +[file provisioner](/docs/language/resources/provisioners/file.html) and then use `inline` to call it. Example: ```hcl diff --git a/website/docs/provisioners/salt-masterless.html.md b/website/docs/language/resources/provisioners/salt-masterless.html.md similarity index 98% rename from website/docs/provisioners/salt-masterless.html.md rename to website/docs/language/resources/provisioners/salt-masterless.html.md index e1e895c35..6cdb4f326 100644 --- a/website/docs/provisioners/salt-masterless.html.md +++ b/website/docs/language/resources/provisioners/salt-masterless.html.md @@ -11,7 +11,7 @@ description: |- Type: `salt-masterless` The `salt-masterless` Terraform provisioner provisions machines built by Terraform -using [Salt](http://saltstack.com/) states, without connecting to a Salt master. The `salt-masterless` provisioner supports `ssh` [connections](/docs/provisioners/connection.html). +using [Salt](http://saltstack.com/) states, without connecting to a Salt master. The `salt-masterless` provisioner supports `ssh` [connections](/docs/language/resources/provisioners/connection.html). !> **Note:** This provisioner was removed in the 0.15.0 version of Terraform after being deprecated as of Terraform 0.13.4. For most common situations there are better alternatives to using provisioners. For more information, see [the main Provisioners page](./). diff --git a/website/docs/provisioners/index.html.markdown b/website/docs/language/resources/provisioners/syntax.html.md similarity index 98% rename from website/docs/provisioners/index.html.markdown rename to website/docs/language/resources/provisioners/syntax.html.md index d2d277fdf..3a8eb95eb 100644 --- a/website/docs/provisioners/index.html.markdown +++ b/website/docs/language/resources/provisioners/syntax.html.md @@ -194,8 +194,8 @@ block would create a dependency cycle. ## Suppressing Provisioner Logs in CLI Output The configuration for a `provisioner` block may use sensitive values, such as -[`sensitive` variables](/docs/configuration/variables.html#suppressing-values-in-cli-output) or -[`sensitive` output values](/docs/configuration/outputs.html#sensitive-suppressing-values-in-cli-output). +[`sensitive` variables](/docs/language/values/variables.html#suppressing-values-in-cli-output) or +[`sensitive` output values](/docs/language/values/outputs.html#sensitive-suppressing-values-in-cli-output). In this case, all log output from the provisioner is automatically suppressed to prevent the sensitive values from being displayed. diff --git a/website/docs/configuration/blocks/resources/syntax.html.md b/website/docs/language/resources/syntax.html.md similarity index 82% rename from website/docs/configuration/blocks/resources/syntax.html.md rename to website/docs/language/resources/syntax.html.md index 2f74015d1..65d52537e 100644 --- a/website/docs/configuration/blocks/resources/syntax.html.md +++ b/website/docs/language/resources/syntax.html.md @@ -10,10 +10,6 @@ description: |- # Resource Blocks --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Resources](/docs/configuration-0-11/resources.html). - > **Hands-on:** Try the [Terraform: Get Started](https://learn.hashicorp.com/collections/terraform/aws-get-started?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) collection on HashiCorp Learn. _Resources_ are the most important element in the Terraform language. @@ -59,7 +55,7 @@ attributes the resource supports. ### Providers -Each resource type is implemented by a [provider](/docs/configuration/provider-requirements.html), +Each resource type is implemented by a [provider](/docs/language/providers/requirements.html), which is a plugin for Terraform that offers a collection of resource types. A provider usually provides resources to manage a single cloud or on-premises infrastructure platform. Providers are distributed separately from Terraform @@ -72,16 +68,16 @@ access their remote APIs, and the root module must provide that configuration. For more information, see: -- [Provider Requirements](/docs/configuration/provider-requirements.html), for declaring which +- [Provider Requirements](/docs/language/providers/requirements.html), for declaring which providers a module uses. -- [Provider Configuration](/docs/configuration/providers.html), for configuring provider settings. +- [Provider Configuration](/docs/language/providers/configuration.html), for configuring provider settings. Terraform usually automatically determines which provider to use based on a resource type's name. (By convention, resource type names start with their provider's preferred local name.) When using multiple configurations of a provider (or non-preferred local provider names), you must use the `provider` meta-argument to manually choose an alternate provider configuration. See -[the `provider` meta-argument](/docs/configuration/meta-arguments/resource-provider.html) for more details. +[the `provider` meta-argument](/docs/language/meta-arguments/resource-provider.html) for more details. ### Resource Arguments @@ -90,7 +86,7 @@ selected resource type. The resource type's documentation lists which arguments are available and how their values should be formatted. The values for resource arguments can make full use of -[expressions](/docs/configuration/expressions/index.html) and other dynamic Terraform +[expressions](/docs/language/expressions/index.html) and other dynamic Terraform language features. There are also some _meta-arguments_ that are defined by Terraform itself @@ -115,15 +111,13 @@ To browse the publicly available providers and their documentation, see -> **Note:** Provider documentation used to be hosted directly on terraform.io, as part of Terraform's core documentation. Although some provider documentation might still be hosted here, the Terraform Registry is now the main home for all -public provider docs. (The exception is the built-in -[`terraform` provider](/docs/providers/terraform/index.html) for reading state -data, since it is not available on the Terraform Registry.) +public provider docs. ## Resource Behavior For more information about how Terraform manages resources when applying a configuration, see -[Resource Behavior](/docs/configuration/blocks/resources/behavior.html). +[Resource Behavior](/docs/language/resources/behavior.html). ## Meta-Arguments @@ -132,12 +126,12 @@ any resource type to change the behavior of resources. The following meta-arguments are documented on separate pages: -- [`depends_on`, for specifying hidden dependencies](/docs/configuration/meta-arguments/depends_on.html) -- [`count`, for creating multiple resource instances according to a count](/docs/configuration/meta-arguments/count.html) -- [`for_each`, to create multiple instances according to a map, or set of strings](/docs/configuration/meta-arguments/for_each.html) -- [`provider`, for selecting a non-default provider configuration](/docs/configuration/meta-arguments/resource-provider.html) -- [`lifecycle`, for lifecycle customizations](/docs/configuration/meta-arguments/lifecycle.html) -- [`provisioner` and `connection`, for taking extra actions after resource creation](/docs/configuration/blocks/resources/provisioners/index.html) +- [`depends_on`, for specifying hidden dependencies](/docs/language/meta-arguments/depends_on.html) +- [`count`, for creating multiple resource instances according to a count](/docs/language/meta-arguments/count.html) +- [`for_each`, to create multiple instances according to a map, or set of strings](/docs/language/meta-arguments/for_each.html) +- [`provider`, for selecting a non-default provider configuration](/docs/language/meta-arguments/resource-provider.html) +- [`lifecycle`, for lifecycle customizations](/docs/language/meta-arguments/lifecycle.html) +- [`provisioner` and `connection`, for taking extra actions after resource creation](/docs/language/resources/provisioners/index.html) ## Operation Timeouts diff --git a/website/docs/backends/types/artifactory.html.md b/website/docs/language/settings/backends/artifactory.html.md similarity index 100% rename from website/docs/backends/types/artifactory.html.md rename to website/docs/language/settings/backends/artifactory.html.md diff --git a/website/docs/backends/types/azurerm.html.md b/website/docs/language/settings/backends/azurerm.html.md similarity index 98% rename from website/docs/backends/types/azurerm.html.md rename to website/docs/language/settings/backends/azurerm.html.md index f2b7fa3c7..0286a8b09 100644 --- a/website/docs/backends/types/azurerm.html.md +++ b/website/docs/language/settings/backends/azurerm.html.md @@ -75,7 +75,7 @@ terraform { } ``` --> **NOTE:** When using a Service Principal or an Access Key - we recommend using a [Partial Configuration](/docs/backends/config.html) for the credentials. +-> **NOTE:** When using a Service Principal or an Access Key - we recommend using a [Partial Configuration](/docs/language/settings/backends/configuration.html#partial-configuration) for the credentials. ## Data Source Configuration diff --git a/website/docs/configuration/backend.html.md b/website/docs/language/settings/backends/configuration.html.md similarity index 91% rename from website/docs/configuration/backend.html.md rename to website/docs/language/settings/backends/configuration.html.md index 8d65e469a..23bd91b0c 100644 --- a/website/docs/configuration/backend.html.md +++ b/website/docs/language/settings/backends/configuration.html.md @@ -5,13 +5,9 @@ page_title: "Backend Configuration - Configuration Language" # Backend Configuration --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Terraform Settings](../configuration-0-11/terraform.html). - Each Terraform configuration can specify a backend, which defines exactly where -and how operations are performed, where [state](/docs/state/index.html) +and how operations are performed, where [state](/docs/language/state/index.html) snapshots are stored, etc. Most non-trivial Terraform configurations configure a remote backend so that multiple people can work with the same infrastructure. @@ -45,7 +41,7 @@ The arguments used in the block's body are specific to the chosen backend type; Some backends allow providing access credentials directly as part of the configuration for use in unusual situations, for pragmatic reasons. However, in normal use we _do not_ recommend including access credentials as part of the backend configuration. Instead, leave those arguments completely unset and provide credentials via the credentials files or environment variables that are conventional for the target system, as described in the documentation for each backend. -See _[Backend Types](/docs/backends/types/index.html)_ for details about each supported backend type and its configuration arguments. +See the list of backend types in the navigation sidebar for details about each supported backend type and its configuration arguments. ### Default Backend @@ -75,7 +71,7 @@ the arguments are omitted, we call this a _partial configuration_. With a partial configuration, the remaining configuration arguments must be provided as part of -[the initialization process](/docs/backends/init.html#backend-initialization). +[the initialization process](/docs/cli/init/index.html). There are several ways to supply the remaining arguments: * **File**: A configuration file may be specified via the `init` command line. @@ -149,12 +145,12 @@ both the configuration itself as well as the type of backend (for example from "consul" to "s3"). Terraform will automatically detect any changes in your configuration -and request a [reinitialization](/docs/backends/init.html). As part of +and request a [reinitialization](/docs/cli/init/index.html). As part of 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. @@ -165,7 +161,7 @@ want to migrate your state. You can respond "no" in this scenario. If you no longer want to use any backend, you can simply remove the configuration from the file. Terraform will detect this like any other -change and prompt you to [reinitialize](/docs/backends/init.html). +change and prompt you to [reinitialize](/docs/cli/init/index.html). As part of the reinitialization, Terraform will ask if you'd like to migrate your state back down to normal local state. Once this is complete then diff --git a/website/docs/backends/types/consul.html.md b/website/docs/language/settings/backends/consul.html.md similarity index 92% rename from website/docs/backends/types/consul.html.md rename to website/docs/language/settings/backends/consul.html.md index be7cd665a..d2f921454 100644 --- a/website/docs/backends/types/consul.html.md +++ b/website/docs/language/settings/backends/consul.html.md @@ -12,7 +12,7 @@ description: |- Stores the state in the [Consul](https://www.consul.io/) KV store at a given path. -This backend supports [state locking](/docs/state/locking.html). +This backend supports [state locking](/docs/language/state/locking.html). ## Example Configuration @@ -27,7 +27,7 @@ terraform { ``` Note that for the access credentials we recommend using a -[partial configuration](/docs/backends/config.html). +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ## Data Source Configuration diff --git a/website/docs/backends/types/cos.html.md b/website/docs/language/settings/backends/cos.html.md similarity index 93% rename from website/docs/backends/types/cos.html.md rename to website/docs/language/settings/backends/cos.html.md index 0a0173eee..cef18670c 100644 --- a/website/docs/backends/types/cos.html.md +++ b/website/docs/language/settings/backends/cos.html.md @@ -11,7 +11,7 @@ description: |- **Kind: Standard (with locking)** Stores the state as an object in a configurable prefix in a given bucket on [Tencent Cloud Object Storage](https://intl.cloud.tencent.com/product/cos) (COS). -This backend also supports [state locking](/docs/state/locking.html). +This backend also supports [state locking](/docs/language/state/locking.html). ~> **Warning!** It is highly recommended that you enable [Object Versioning](https://intl.cloud.tencent.com/document/product/436/19883) on the COS bucket to allow for state recovery in the case of accidental deletions and human error. @@ -33,7 +33,7 @@ Terraform state will be written into the file `terraform/state/terraform.tfstate ## Data Source Configuration -To make use of the COS remote state in another configuration, use the [`terraform_remote_state` data source](/docs/providers/terraform/d/remote_state.html). +To make use of the COS remote state in another configuration, use the [`terraform_remote_state` data source](/docs/language/state/remote-state-data.html). ```hcl data "terraform_remote_state" "foo" { diff --git a/website/docs/backends/types/etcd.html.md b/website/docs/language/settings/backends/etcd.html.md similarity index 100% rename from website/docs/backends/types/etcd.html.md rename to website/docs/language/settings/backends/etcd.html.md diff --git a/website/docs/backends/types/etcdv3.html.md b/website/docs/language/settings/backends/etcdv3.html.md similarity index 90% rename from website/docs/backends/types/etcdv3.html.md rename to website/docs/language/settings/backends/etcdv3.html.md index 5b8558995..7c31d5125 100644 --- a/website/docs/backends/types/etcdv3.html.md +++ b/website/docs/language/settings/backends/etcdv3.html.md @@ -12,7 +12,7 @@ description: |- Stores the state in the [etcd](https://coreos.com/etcd/) KV store with a given prefix. -This backend supports [state locking](/docs/state/locking.html). +This backend supports [state locking](/docs/language/state/locking.html). ## Example Configuration @@ -27,7 +27,7 @@ terraform { ``` Note that for the access credentials we recommend using a -[partial configuration](/docs/backends/config.html). +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ## Data Source Configuration diff --git a/website/docs/backends/types/gcs.html.md b/website/docs/language/settings/backends/gcs.html.md similarity index 97% rename from website/docs/backends/types/gcs.html.md rename to website/docs/language/settings/backends/gcs.html.md index b449f46a3..1d869579e 100644 --- a/website/docs/backends/types/gcs.html.md +++ b/website/docs/language/settings/backends/gcs.html.md @@ -11,7 +11,7 @@ description: |- **Kind: Standard (with locking)** Stores the state as an object in a configurable prefix in a pre-existing bucket on [Google Cloud Storage](https://cloud.google.com/storage/) (GCS). -This backend also supports [state locking](/docs/state/locking.html). The bucket must exist prior to configuring the backend. +This backend also supports [state locking](/docs/language/state/locking.html). The bucket must exist prior to configuring the backend. ~> **Warning!** It is highly recommended that you enable [Object Versioning](https://cloud.google.com/storage/docs/object-versioning) diff --git a/website/docs/backends/types/http.html.md b/website/docs/language/settings/backends/http.html.md similarity index 100% rename from website/docs/backends/types/http.html.md rename to website/docs/language/settings/backends/http.html.md diff --git a/website/docs/configuration/blocks/backends/index.html.md b/website/docs/language/settings/backends/index.html.md similarity index 83% rename from website/docs/configuration/blocks/backends/index.html.md rename to website/docs/language/settings/backends/index.html.md index 834337ef4..6e477c5ef 100644 --- a/website/docs/configuration/blocks/backends/index.html.md +++ b/website/docs/language/settings/backends/index.html.md @@ -6,13 +6,13 @@ page_title: "Backend Overview - Configuration Language" # Backends Each Terraform configuration can specify a backend, which defines where -and how operations are performed, where [state](/docs/state/index.html) +and how operations are performed, where [state](/docs/language/state/index.html) snapshots are stored, etc. The rest of this page introduces the concept of backends; the other pages in this section document how to configure and use backends. -- [Backend Configuration](/docs/configuration/backend.html) documents the form +- [Backend Configuration](/docs/language/settings/backends/configuration.html) documents the form of a `backend` block, which selects and configures a backend for a Terraform configuration. - This section also includes a page for each of Terraform's built-in backends, @@ -29,14 +29,14 @@ this section document how to configure and use backends. ## Where Backends are Used -Backend configuration is only used by [Terraform CLI](/docs/cli-index.html). +Backend configuration is only used by [Terraform CLI](/docs/cli/index.html). Terraform Cloud and Terraform Enterprise always use their own state storage when performing Terraform runs, so they ignore any backend block in the configuration. But since it's common to [use Terraform CLI alongside Terraform Cloud](/docs/cloud/run/cli.html) -(and since certain state operations, like [tainting](/docs/commands/taint.html), +(and since certain state operations, like [tainting](/docs/cli/commands/taint.html), can only be performed on the CLI), we recommend that Terraform Cloud users include a backend block in their configurations and configure the `remote` backend to use the relevant Terraform Cloud workspace(s). @@ -58,7 +58,7 @@ There are two areas of Terraform's behavior that are determined by the backend: ### State -Terraform uses persistent [state](/docs/state/index.html) data to keep track of +Terraform uses persistent [state](/docs/language/state/index.html) data to keep track of the resources it manages. Since it needs the state in order to know which real-world infrastructure objects correspond to the resources in a configuration, everyone working with a given collection of infrastructure @@ -98,3 +98,13 @@ target Terraform Cloud workspace determine whether operations run remotely or locally. If local operations are configured, Terraform uses the `remote` backend for state and the `local` backend for operations, like with the other state backends. + +### Backend Types + +Terraform's backends are divided into two main types, according to how they +handle state and operations: + +- **Enhanced** backends can both store state and perform operations. There are + only two enhanced backends: `local` and `remote`. +- **Standard** backends only store state, and rely on the `local` backend for + performing operations. diff --git a/website/docs/backends/types/kubernetes.html.md b/website/docs/language/settings/backends/kubernetes.html.md similarity index 98% rename from website/docs/backends/types/kubernetes.html.md rename to website/docs/language/settings/backends/kubernetes.html.md index 9cf00ca81..715db82c5 100644 --- a/website/docs/backends/types/kubernetes.html.md +++ b/website/docs/language/settings/backends/kubernetes.html.md @@ -33,7 +33,7 @@ If the `in_cluster_config` flag is set the backend will attempt to use a [servic For most use cases either `in_cluster_config` or `load_config_file` will need to be set to `true`. If both flags are set the configuration from `load_config_file` will be used. -Note that for the access credentials we recommend using a [partial configuration](/docs/backends/config.html#partial-configuration). +Note that for the access credentials we recommend using a [partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ## Example Referencing diff --git a/website/docs/backends/types/local.html.md b/website/docs/language/settings/backends/local.html.md similarity index 100% rename from website/docs/backends/types/local.html.md rename to website/docs/language/settings/backends/local.html.md diff --git a/website/docs/backends/types/manta.html.md b/website/docs/language/settings/backends/manta.html.md similarity index 96% rename from website/docs/backends/types/manta.html.md rename to website/docs/language/settings/backends/manta.html.md index 9fae9a679..ef82e5602 100644 --- a/website/docs/backends/types/manta.html.md +++ b/website/docs/language/settings/backends/manta.html.md @@ -24,7 +24,7 @@ terraform { ``` Note that for the access credentials we recommend using a -[partial configuration](/docs/backends/config.html). +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ## Data Source Configuration diff --git a/website/docs/backends/types/oss.html.md b/website/docs/language/settings/backends/oss.html.md similarity index 99% rename from website/docs/backends/types/oss.html.md rename to website/docs/language/settings/backends/oss.html.md index bcf6e42e4..6acc16af1 100644 --- a/website/docs/backends/types/oss.html.md +++ b/website/docs/language/settings/backends/oss.html.md @@ -43,7 +43,7 @@ Terraform state will be written into the file `path/mystate/version-1.tfstate`. To make use of the OSS remote state in another configuration, use the [`terraform_remote_state` data -source](/docs/providers/terraform/d/remote_state.html). +source](/docs/language/state/remote-state-data.html). ```hcl terraform { diff --git a/website/docs/backends/types/pg.html.md b/website/docs/language/settings/backends/pg.html.md similarity index 76% rename from website/docs/backends/types/pg.html.md rename to website/docs/language/settings/backends/pg.html.md index 1b9ee0c3c..362443cfb 100644 --- a/website/docs/backends/types/pg.html.md +++ b/website/docs/language/settings/backends/pg.html.md @@ -12,7 +12,7 @@ description: |- Stores the state in a [Postgres database](https://www.postgresql.org) version 9.5 or newer. -This backend supports [state locking](/docs/state/locking.html). +This backend supports [state locking](/docs/language/state/locking.html). ## Example Configuration @@ -32,7 +32,9 @@ createdb terraform_backend This `createdb` command is found in [Postgres client applications](https://www.postgresql.org/docs/9.5/reference-client.html) which are installed along with the database server. -We recommend using a [partial configuration](/docs/backends/config.html#partial-configuration) for the `conn_str` variable, because it typically contains access credentials that should not be committed to source control: +We recommend using a +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration) +for the `conn_str` variable, because it typically contains access credentials that should not be committed to source control: ```hcl terraform { @@ -54,7 +56,7 @@ terraform init -backend-config="conn_str=postgres://localhost/terraform_backend? ## Data Source Configuration -To make use of the pg remote state in another configuration, use the [`terraform_remote_state` data source](/docs/providers/terraform/d/remote_state.html). +To make use of the pg remote state in another configuration, use the [`terraform_remote_state` data source](/docs/language/state/remote-state-data.html). ```hcl data "terraform_remote_state" "network" { @@ -81,9 +83,9 @@ Postgres version 9.5 or newer is required to support advisory locks and the "ON This backend creates one table **states** in the automatically-managed Postgres schema configured by the `schema_name` variable. -The table is keyed by the [workspace](/docs/state/workspaces.html) name. If workspaces are not in use, the name `default` is used. +The table is keyed by the [workspace](/docs/language/state/workspaces.html) name. If workspaces are not in use, the name `default` is used. -Locking is supported using [Postgres advisory locks](https://www.postgresql.org/docs/9.5/explicit-locking.html#ADVISORY-LOCKS). [`force-unlock`](https://www.terraform.io/docs/commands/force-unlock.html) is not supported, because these database-native locks will automatically unlock when the session is aborted or the connection fails. To see outstanding locks in a Postgres server, use the [`pg_locks` system view](https://www.postgresql.org/docs/9.5/view-pg-locks.html). +Locking is supported using [Postgres advisory locks](https://www.postgresql.org/docs/9.5/explicit-locking.html#ADVISORY-LOCKS). [`force-unlock`](https://www.terraform.io/docs/cli/commands/force-unlock.html) is not supported, because these database-native locks will automatically unlock when the session is aborted or the connection fails. To see outstanding locks in a Postgres server, use the [`pg_locks` system view](https://www.postgresql.org/docs/9.5/view-pg-locks.html). The **states** table contains: diff --git a/website/docs/backends/types/remote.html.md b/website/docs/language/settings/backends/remote.html.md similarity index 93% rename from website/docs/backends/types/remote.html.md rename to website/docs/language/settings/backends/remote.html.md index 275cf6e71..83350eae9 100644 --- a/website/docs/backends/types/remote.html.md +++ b/website/docs/language/settings/backends/remote.html.md @@ -59,7 +59,7 @@ determines which mode it uses: all of the desired remote workspace names. For example, set `prefix = "networking-"` to use Terraform cloud workspaces with names like `networking-dev` and `networking-prod`. This is helpful when - mapping multiple Terraform CLI [workspaces](../../state/workspaces.html) + mapping multiple Terraform CLI [workspaces](/docs/language/state/workspaces.html) used in a single Terraform configuration to multiple Terraform Cloud workspaces. @@ -70,7 +70,7 @@ the Terraform CLI workspace `prod` within the current configuration. Remote Terraform operations such as `plan` and `apply` executed against that Terraform CLI workspace will be executed in the Terraform Cloud workspace `networking-prod`. -Additionally, the [`${terraform.workspace}`](../../state/workspaces.html#current-workspace-interpolation) +Additionally, the [`${terraform.workspace}`](/docs/language/state/workspaces.html#current-workspace-interpolation) interpolation sequence should be removed from Terraform configurations that run remote operations against Terraform Cloud workspaces. The reason for this is that each Terraform Cloud workspace currently only uses the single `default` Terraform @@ -94,8 +94,8 @@ running any remote operations against them. ## Example Configurations -> **Note:** We recommend omitting the token from the configuration, and instead using - [`terraform login`](/docs/commands/login.html) or manually configuring - `credentials` in the [CLI config file](/docs/commands/cli-config.html#credentials). + [`terraform login`](/docs/cli/commands/login.html) or manually configuring + `credentials` in the [CLI config file](/docs/cli/config/config-file.html#credentials). ### Basic Configuration @@ -177,9 +177,9 @@ The following configuration options are supported: targeted workspace(s). * `token` - (Optional) The token used to authenticate with the remote backend. We recommend omitting the token from the configuration, and instead using - [`terraform login`](/docs/commands/login.html) or manually configuring + [`terraform login`](/docs/cli/commands/login.html) or manually configuring `credentials` in the - [CLI config file](/docs/commands/cli-config.html#credentials). + [CLI config file](/docs/cli/config/config-file.html#credentials). * `workspaces` - (Required) A block specifying which remote workspace(s) to use. The `workspaces` block supports the following keys: diff --git a/website/docs/backends/types/s3.html.md b/website/docs/language/settings/backends/s3.html.md similarity index 97% rename from website/docs/backends/types/s3.html.md rename to website/docs/language/settings/backends/s3.html.md index 7579e96f4..678cb24b7 100644 --- a/website/docs/backends/types/s3.html.md +++ b/website/docs/language/settings/backends/s3.html.md @@ -37,7 +37,7 @@ This assumes we have a bucket created called `mybucket`. The Terraform state is written to the key `path/to/my/key`. Note that for the access credentials we recommend using a -[partial configuration](/docs/backends/config.html). +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ### S3 Bucket Permissions @@ -107,7 +107,7 @@ This is seen in the following AWS IAM Statement: To make use of the S3 remote state in another configuration, use the [`terraform_remote_state` data -source](/docs/providers/terraform/d/remote_state.html). +source](/docs/language/state/remote-state-data.html). ```hcl data "terraform_remote_state" "network" { @@ -182,7 +182,7 @@ The following configuration is optional: The following configuration is required: * `bucket` - (Required) Name of the S3 Bucket. -* `key` - (Required) Path to the state file inside the S3 Bucket. When using a non-default [workspace](/docs/state/workspaces.html), the state path will be `/workspace_key_prefix/workspace_name/key` (see also the `workspace_key_prefix` configuration). +* `key` - (Required) Path to the state file inside the S3 Bucket. When using a non-default [workspace](/docs/language/state/workspaces.html), the state path will be `/workspace_key_prefix/workspace_name/key` (see also the `workspace_key_prefix` configuration). The following configuration is optional: @@ -214,7 +214,7 @@ The S3 backend can be used in a number of different ways that make different tradeoffs between convenience, security, and isolation in such an organization. This section describes one such approach that aims to find a good compromise between these tradeoffs, allowing use of -[Terraform's workspaces feature](/docs/state/workspaces.html) to switch +[Terraform's workspaces feature](/docs/language/state/workspaces.html) to switch conveniently between multiple isolated deployments of the same configuration. Use this section as a starting-point for your approach, but note that @@ -320,7 +320,7 @@ provider "aws" { If workspace IAM roles are centrally managed and shared across many separate Terraform configurations, the role ARNs could also be obtained via a data -source such as [`terraform_remote_state`](/docs/providers/terraform/d/remote_state.html) +source such as [`terraform_remote_state`](/docs/language/state/remote-state-data.html) to avoid repeating these values. ### Creating and Selecting Workspaces diff --git a/website/docs/backends/types/swift.html.md b/website/docs/language/settings/backends/swift.html.md similarity index 96% rename from website/docs/backends/types/swift.html.md rename to website/docs/language/settings/backends/swift.html.md index 35d77b7ce..1d8241ae4 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/language/settings/backends/swift.html.md @@ -12,7 +12,7 @@ description: |- Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/latest/). -~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) by setting the [`archive_container`](https://www.terraform.io/docs/backends/types/swift.html#archive_container) configuration. This allows for state recovery in the case of accidental deletions and human error. +~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) by setting the [`archive_container`](https://www.terraform.io/docs/language/settings/backends/swift.html#archive_container) configuration. This allows for state recovery in the case of accidental deletions and human error. ## Example Configuration @@ -27,7 +27,7 @@ terraform { This will create a container called `terraform-state` and an object within that container called `tfstate.tf`. It will enable versioning using the `terraform-state-archive` container to contain the older version. For the access credentials we recommend using a -[partial configuration](/docs/backends/config.html). +[partial configuration](/docs/language/settings/backends/configuration.html#partial-configuration). ## Data Source Configuration diff --git a/website/docs/configuration/terraform.html.md b/website/docs/language/settings/index.html.md similarity index 88% rename from website/docs/configuration/terraform.html.md rename to website/docs/language/settings/index.html.md index b6f1ffd1d..c9a79a865 100644 --- a/website/docs/configuration/terraform.html.md +++ b/website/docs/language/settings/index.html.md @@ -9,10 +9,6 @@ description: |- # Terraform Settings --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Terraform Settings](../configuration-0-11/terraform.html). - The special `terraform` configuration block type is used to configure some behaviors of Terraform itself, such as requiring a minimum Terraform version to apply your configuration. @@ -40,18 +36,18 @@ following sections. The nested `backend` block configures which backend Terraform should use. The syntax and behavior of the `backend` block is described in [Backend -Configuration](./backend.html). +Configuration](/docs/language/settings/backends/configuration.html). ## Specifying a Required Terraform Version The `required_version` setting accepts a [version constraint -string,](./version-constraints.html) which specifies which versions of Terraform +string,](/docs/language/expressions/version-constraints.html) which specifies which versions of Terraform can be used with your configuration. If the running version of Terraform doesn't match the constraints specified, Terraform will produce an error and exit without taking any further actions. -When you use [child modules](/docs/configuration/blocks/modules/index.html), each module can specify its own +When you use [child modules](/docs/language/modules/index.html), each module can specify its own version requirements. The requirements of all modules in the tree must be satisfied. @@ -62,7 +58,7 @@ a minimum Terraform version that has behavior expected by the configuration. The `required_version` setting applies only to the version of Terraform CLI. Terraform's resource types are implemented by provider plugins, whose release cycles are independent of Terraform CLI and of each other. -Use [the `required_providers` block](./provider-requirements.html) to manage +Use [the `required_providers` block](/docs/language/providers/requirements.html) to manage the expected versions for each provider you use. ## Specifying Provider Requirements @@ -84,7 +80,7 @@ terraform { } ``` -For more information, see [Provider Requirements](./provider-requirements.html). +For more information, see [Provider Requirements](/docs/language/providers/requirements.html). ## Experimental Language Features diff --git a/website/docs/backends/state.html.md b/website/docs/language/state/backends.html.md similarity index 87% rename from website/docs/backends/state.html.md rename to website/docs/language/state/backends.html.md index 0f40c757c..da957173d 100644 --- a/website/docs/backends/state.html.md +++ b/website/docs/language/state/backends.html.md @@ -9,7 +9,7 @@ description: |- # State Storage and Locking Backends are responsible for storing state and providing an API for -[state locking](/docs/state/locking.html). State locking is optional. +[state locking](/docs/language/state/locking.html). State locking is optional. Despite the state being stored remotely, all Terraform commands such as `terraform console`, the `terraform state` operations, `terraform taint`, @@ -64,10 +64,12 @@ prior to forcing the overwrite. ## State Locking -Backends are responsible for supporting [state locking](/docs/state/locking.html) -if possible. Not all backend types support state locking. In the -[list of supported backend types](/docs/backends/types/index.html) we explicitly note -whether locking is supported. +Backends are responsible for supporting [state locking](/docs/language/state/locking.html) +if possible. + +Not all backends support locking. The +[documentation for each backend](/docs/language/settings/backends/index.html) +includes details on whether it supports locking or not. For more information on state locking, view the -[page dedicated to state locking](/docs/state/locking.html). +[page dedicated to state locking](/docs/language/state/locking.html). diff --git a/website/docs/state/import.html.md b/website/docs/language/state/import.html.md similarity index 88% rename from website/docs/state/import.html.md rename to website/docs/language/state/import.html.md index a71d68d5b..1334269e9 100644 --- a/website/docs/state/import.html.md +++ b/website/docs/language/state/import.html.md @@ -12,4 +12,4 @@ Terraform is able to import existing infrastructure. This allows you take resources you've created by some other means and bring it under Terraform management. To learn more about this, please visit the -[pages dedicated to import](/docs/import/index.html). +[pages dedicated to import](/docs/cli/import/index.html). diff --git a/website/docs/state/index.html.md b/website/docs/language/state/index.html.md similarity index 92% rename from website/docs/state/index.html.md rename to website/docs/language/state/index.html.md index 7e7d2a5e5..071cee81e 100644 --- a/website/docs/state/index.html.md +++ b/website/docs/language/state/index.html.md @@ -18,7 +18,7 @@ but it can also be stored remotely, which works better in a team environment. Terraform uses this local state to create plans and make changes to your infrastructure. Prior to any operation, Terraform does a -[refresh](/docs/commands/refresh.html) to update the state with the +[refresh](/docs/cli/commands/refresh.html) to update the state with the real infrastructure. The primary purpose of Terraform state is to store bindings between objects in @@ -29,13 +29,13 @@ resource instance, and then potentially update or delete that object in response to future configuration changes. For more information on why Terraform requires state and why Terraform cannot -function without state, please see the page [state purpose](/docs/state/purpose.html). +function without state, please see the page [state purpose](/docs/language/state/purpose.html). ## Inspection and Modification While the format of the state files are just JSON, direct file editing of the state is discouraged. Terraform provides the -[terraform state](/docs/commands/state/index.html) command to perform +[terraform state](/docs/cli/commands/state/index.html) command to perform basic modifications of the state using the CLI. The CLI usage and output of the state commands is structured to be @@ -68,10 +68,10 @@ in new versions. Alternatively, there are several integration points which produce JSON output that is specifically intended for consumption by external software: -* [The `terraform output` command](/docs/commands/output.html) +* [The `terraform output` command](/docs/cli/commands/output.html) has a `-json` option, for obtaining either the full set of root module output values or a specific named output value from the latest state snapshot. -* [The `terraform show` command](/docs/commands/show.html) has a `-json` +* [The `terraform show` command](/docs/cli/commands/show.html) has a `-json` option for inspecting the latest state snapshot in full, and also for inspecting saved plan files which include a copy of the prior state at the time the plan was made. diff --git a/website/docs/state/locking.html.md b/website/docs/language/state/locking.html.md similarity index 80% rename from website/docs/state/locking.html.md rename to website/docs/language/state/locking.html.md index 5431f7d34..739a4b8c4 100644 --- a/website/docs/state/locking.html.md +++ b/website/docs/language/state/locking.html.md @@ -8,7 +8,7 @@ description: |- # State Locking -If supported by your [backend](/docs/backends/), Terraform will lock your +If supported by your [backend](/docs/language/settings/backends/index.html), Terraform will lock your state for all operations that could write state. This prevents others from acquiring the lock and potentially corrupting your state. @@ -21,13 +21,13 @@ If acquiring the lock is taking longer than expected, Terraform will output a status message. If Terraform doesn't output a message, state locking is still occurring if your backend supports it. -Not all [backends](/docs/backends/) support locking. Please view the list -of [backend types](/docs/backends/types/) for details on whether a backend -supports locking or not. +Not all backends support locking. The +[documentation for each backend](/docs/language/settings/backends/index.html) +includes details on whether it supports locking or not. ## Force Unlock -Terraform has a [force-unlock command](/docs/commands/force-unlock.html) +Terraform has a [force-unlock command](/docs/cli/commands/force-unlock.html) to manually unlock the state if unlocking failed. **Be very careful with this command.** If you unlock the state when someone diff --git a/website/docs/state/purpose.html.md b/website/docs/language/state/purpose.html.md similarity index 98% rename from website/docs/state/purpose.html.md rename to website/docs/language/state/purpose.html.md index 4182e9a81..44bfef6d1 100644 --- a/website/docs/state/purpose.html.md +++ b/website/docs/language/state/purpose.html.md @@ -105,7 +105,7 @@ started, but when using Terraform in a team it is important for everyone to be working with the same state so that operations will be applied to the same remote objects. -[Remote state](/docs/state/remote.html) is the recommended solution +[Remote state](/docs/language/state/remote.html) is the recommended solution to this problem. With a fully-featured state backend, Terraform can use remote locking as a measure to avoid two or more different users accidentally running Terraform at the same time, and thus ensure that each Terraform run diff --git a/website/docs/providers/terraform/d/remote_state.html.md b/website/docs/language/state/remote-state-data.html.md similarity index 94% rename from website/docs/providers/terraform/d/remote_state.html.md rename to website/docs/language/state/remote-state-data.html.md index cba263823..717d8fb30 100644 --- a/website/docs/providers/terraform/d/remote_state.html.md +++ b/website/docs/language/state/remote-state-data.html.md @@ -18,7 +18,7 @@ This data source is built into Terraform, and is always available; you do not need to require or configure a provider in order to use it. -> **Note:** This data source is implemented by a built-in provider, whose -[source address](/docs/configuration/provider-requirements.html#source-addresses) +[source address](/docs/language/providers/requirements.html#source-addresses) is `terraform.io/builtin/terraform`. That provider does not include any other resources or data sources. @@ -81,14 +81,14 @@ or the Some of the data stores listed above are specifically designed for storing small configuration values, while others are generic blob storage systems. For those generic systems, you can use -[the `jsonencode` function](https://www.terraform.io/docs/configuration/functions/jsonencode.html) +[the `jsonencode` function](https://www.terraform.io/docs/language/functions/jsonencode.html) and -[the `jsondecode` function](https://www.terraform.io/docs/configuration/functions/jsondecode.html) respectively +[the `jsondecode` function](https://www.terraform.io/docs/language/functions/jsondecode.html) respectively to store and retrieve structured data. You can encapsulate the implementation details of retrieving your published configuration data by writing a -[data-only module](/docs/modules/composition.html#data-only-modules) +[data-only module](/docs/language/modules/develop/composition.html#data-only-modules) containing the necessary data source configuration and any necessary post-processing such as JSON decoding. You can then change that module later if you switch to a different strategy for sharing data between multiple @@ -158,7 +158,7 @@ The following arguments are supported: The `config` object can use any arguments that would be valid in the equivalent `terraform { backend "" { ... } }` block. See - [the documentation of your chosen backend](/docs/backends/types/index.html) + [the documentation of your chosen backend](/docs/language/settings/backends/index.html) for details. -> **Note:** If the backend configuration requires a nested block, specify @@ -172,8 +172,8 @@ The following arguments are supported: In addition to the above, the following attributes are exported: * (v0.12+) `outputs` - An object containing every root-level - [output](/docs/configuration/outputs.html) in the remote state. -* (<= v0.11) `` - Each root-level [output](/docs/configuration/outputs.html) + [output](/docs/language/values/outputs.html) in the remote state. +* (<= v0.11) `` - Each root-level [output](/docs/language/values/outputs.html) in the remote state appears as a top level attribute on the data source. ## Root Outputs Only diff --git a/website/docs/state/remote.html.md b/website/docs/language/state/remote.html.md similarity index 87% rename from website/docs/state/remote.html.md rename to website/docs/language/state/remote.html.md index 743e630b6..998b47945 100644 --- a/website/docs/state/remote.html.md +++ b/website/docs/language/state/remote.html.md @@ -19,13 +19,13 @@ which can then be shared between all members of a team. Terraform supports storing state in [Terraform Cloud](https://www.hashicorp.com/products/terraform/), [HashiCorp Consul](https://www.consul.io/), Amazon S3, Azure Blob Storage, Google Cloud Storage, Alibaba Cloud OSS, and more. -Remote state is a feature of [backends](/docs/backends/), which you can activate -in your configuration's root module. +Remote state is implemented by a [backend](/docs/language/settings/backends/index.html), +which you can configure in your configuration's root module. ## Delegation and Teamwork Remote state allows you to share -[output values](/docs/configuration/outputs.html) with other configurations. +[output values](/docs/language/values/outputs.html) with other configurations. This allows your infrastructure to be decomposed into smaller components. Put another way, remote state also allows teams to share infrastructure @@ -39,7 +39,7 @@ you can expose things such as VPC IDs, subnets, NAT instance IDs, etc. through remote state and have other Terraform states consume that. For example usage, see -[the `terraform_remote_state` data source](/docs/providers/terraform/d/remote_state.html). +[the `terraform_remote_state` data source](/docs/language/state/remote-state-data.html). While remote state can be a convenient, built-in mechanism for sharing data between configurations, you may prefer to use more general stores to @@ -53,7 +53,7 @@ another that consumes those values using ## Locking and Teamwork For fully-featured remote backends, Terraform can also use -[state locking](/docs/state/locking.html) to prevent concurrent runs of +[state locking](/docs/language/state/locking.html) to prevent concurrent runs of Terraform against the same state. [Terraform Cloud by HashiCorp](https://www.hashicorp.com/products/terraform/) diff --git a/website/docs/state/sensitive-data.html.md b/website/docs/language/state/sensitive-data.html.md similarity index 94% rename from website/docs/state/sensitive-data.html.md rename to website/docs/language/state/sensitive-data.html.md index ac2061b6a..49f5c1270 100644 --- a/website/docs/state/sensitive-data.html.md +++ b/website/docs/language/state/sensitive-data.html.md @@ -15,7 +15,7 @@ passwords. When using local state, state is stored in plain-text JSON files. -When using [remote state](/docs/state/remote.html), state is only ever held in +When using [remote state](/docs/language/state/remote.html), state is only ever held in memory when used by Terraform. It may be encrypted at rest, but this depends on the specific remote state backend. diff --git a/website/docs/state/workspaces.html.md b/website/docs/language/state/workspaces.html.md similarity index 87% rename from website/docs/state/workspaces.html.md rename to website/docs/language/state/workspaces.html.md index 1bca724e1..07db50a40 100644 --- a/website/docs/state/workspaces.html.md +++ b/website/docs/language/state/workspaces.html.md @@ -8,9 +8,9 @@ description: |- # Workspaces -Each Terraform configuration has an associated [backend](/docs/backends/index.html) +Each Terraform configuration has an associated [backend](/docs/language/settings/backends/index.html) that defines how operations are executed and where persistent data such as -[the Terraform state](https://www.terraform.io/docs/state/purpose.html) are +[the Terraform state](https://www.terraform.io/docs/language/state/purpose.html) are stored. The persistent data stored in the backend belongs to a _workspace_. Initially @@ -25,16 +25,16 @@ credentials. Multiple workspaces are currently supported by the following backends: - * [AzureRM](/docs/backends/types/azurerm.html) - * [Consul](/docs/backends/types/consul.html) - * [COS](/docs/backends/types/cos.html) - * [GCS](/docs/backends/types/gcs.html) - * [Kubernetes](/docs/backends/types/kubernetes.html) - * [Local](/docs/backends/types/local.html) - * [Manta](/docs/backends/types/manta.html) - * [Postgres](/docs/backends/types/pg.html) - * [Remote](/docs/backends/types/remote.html) - * [S3](/docs/backends/types/s3.html) + * [AzureRM](/docs/language/settings/backends/azurerm.html) + * [Consul](/docs/language/settings/backends/consul.html) + * [COS](/docs/language/settings/backends/cos.html) + * [GCS](/docs/language/settings/backends/gcs.html) + * [Kubernetes](/docs/language/settings/backends/kubernetes.html) + * [Local](/docs/language/settings/backends/local.html) + * [Manta](/docs/language/settings/backends/manta.html) + * [Postgres](/docs/language/settings/backends/pg.html) + * [Remote](/docs/language/settings/backends/remote.html) + * [S3](/docs/language/settings/backends/s3.html) In the 0.9 line of Terraform releases, this concept was known as "environment". It was renamed in 0.10 based on feedback about confusion caused by the @@ -81,7 +81,7 @@ Within your Terraform configuration, you may include the name of the current workspace using the `${terraform.workspace}` interpolation sequence. This can be used anywhere interpolations are allowed. However, it should **not** be used in remote operations against Terraform Cloud workspaces. For an -explanation, see the [remote backend](../backends/types/remote.html#workspaces) +explanation, see the [remote backend](/docs/language/settings/backends/remote.html#workspaces) document. Referencing the current workspace is useful for changing behavior based @@ -146,7 +146,7 @@ In this case, the backend used for each deployment often belongs to that deployment, with different credentials and access controls. Named workspaces are _not_ a suitable isolation mechanism for this scenario. -Instead, use one or more [re-usable modules](/docs/modules/index.html) to +Instead, use one or more [re-usable modules](/docs/language/modules/develop/index.html) to represent the common elements, and then represent each instance as a separate configuration that instantiates those common elements in the context of a different backend. In that case, the root module of each configuration will @@ -176,7 +176,7 @@ another using paired resources types and data sources. For example: * If a Terraform state for one configuration is stored in a remote backend that is accessible to other configurations then - [`terraform_remote_state`](/docs/providers/terraform/d/remote_state.html) + [`terraform_remote_state`](/docs/language/state/remote-state-data.html) can be used to directly consume its root module outputs from those other configurations. This creates a tighter coupling between configurations, but avoids the need for the "producer" configuration to explicitly @@ -194,9 +194,9 @@ local-only `terraform.tfstate`; some teams commit these files to version control, although using a remote backend instead is recommended when there are multiple collaborators. -For [remote state](/docs/state/remote.html), the workspaces are stored -directly in the configured [backend](/docs/backends/). For example, if you -use [Consul](/docs/backends/types/consul.html), the workspaces are stored +For [remote state](/docs/language/state/remote.html), the workspaces are stored +directly in the configured [backend](/docs/language/settings/backends/index.html). For example, if you +use [Consul](/docs/language/settings/backends/consul.html), the workspaces are stored by appending the workspace name to the state path. To ensure that workspace names are stored correctly and safely in all backends, the name must be valid to use in a URL path segment without escaping. diff --git a/website/docs/configuration/syntax.html.md b/website/docs/language/syntax/configuration.html.md similarity index 94% rename from website/docs/configuration/syntax.html.md rename to website/docs/language/syntax/configuration.html.md index 8de4253e3..e8c38d51c 100644 --- a/website/docs/configuration/syntax.html.md +++ b/website/docs/language/syntax/configuration.html.md @@ -10,10 +10,6 @@ description: |- # Configuration Syntax --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Syntax](../configuration-0-11/syntax.html). - Other pages in this section have described various configuration constructs that can appear in the Terraform language. This page describes the lower-level syntax of the language in more detail, revealing the building blocks that @@ -22,7 +18,7 @@ those constructs are built from. This page describes the _native syntax_ of the Terraform language, which is a rich language designed to be relatively easy for humans to read and write. The constructs in the Terraform language can also be expressed in -[JSON syntax](./syntax-json.html), which is harder for humans +[JSON syntax](/docs/language/syntax/json.html), which is harder for humans to read and edit but easier to generate and parse programmatically. This low-level syntax of the Terraform language is defined in terms of a @@ -53,7 +49,7 @@ after the equals sign is the argument's value. The context where the argument appears determines what value types are valid (for example, each resource type has a schema that defines the types of its arguments), but many arguments accept arbitrary -[expressions](/docs/configuration/expressions/index.html), which allow the value to +[expressions](/docs/language/expressions/index.html), which allow the value to either be specified literally or generated from other values programmatically. -> **Note:** Terraform's configuration language is based on a more general diff --git a/website/docs/configuration/syntax/index.html.md b/website/docs/language/syntax/index.html.md similarity index 69% rename from website/docs/configuration/syntax/index.html.md rename to website/docs/language/syntax/index.html.md index 80a599c66..83de5faaa 100644 --- a/website/docs/configuration/syntax/index.html.md +++ b/website/docs/language/syntax/index.html.md @@ -9,13 +9,13 @@ The majority of the Terraform language documentation focuses on the practical uses of the language and the specific constructs it uses. The pages in this section offer a more abstract view of the Terraform language. -- [Configuration Syntax](/docs/configuration/syntax.html) describes the native +- [Configuration Syntax](/docs/language/syntax/configuration.html) describes the native grammar of the Terraform language. -- [JSON Configuration Syntax](/docs/configuration/syntax-json.html) documents +- [JSON Configuration Syntax](/docs/language/syntax/json.html) documents how to represent Terraform language constructs in the pure JSON variant of the Terraform language. Terraform's JSON syntax is unfriendly to humans, but can be very useful when generating infrastructure as code with other systems that don't have a readily available HCL library. -- [Style Conventions](/docs/configuration/style.html) documents some commonly +- [Style Conventions](/docs/language/syntax/style.html) documents some commonly accepted formatting guidelines for Terraform code. These conventions can be - enforced automatically with [`terraform fmt`](/docs/commands/fmt.html). + enforced automatically with [`terraform fmt`](/docs/cli/commands/fmt.html). diff --git a/website/docs/configuration/syntax-json.html.md b/website/docs/language/syntax/json.html.md similarity index 95% rename from website/docs/configuration/syntax-json.html.md rename to website/docs/language/syntax/json.html.md index be0b99856..393e2840b 100644 --- a/website/docs/configuration/syntax-json.html.md +++ b/website/docs/language/syntax/json.html.md @@ -9,13 +9,8 @@ description: |- # JSON Configuration Syntax --> **Note:** This page is about Terraform 0.12 and later. The JSON configuration -syntax in 0.11 and earlier was never formally documented. For other information -about Terraform 0.11 and earlier, see -[0.11 Configuration Language](../configuration-0-11/index.html). - Most Terraform configurations are written in -[the native Terraform language syntax](./syntax.html), which is designed to be +[the native Terraform language syntax](/docs/language/syntax/configuration.html), which is designed to be relatively easy for humans to read and update. Terraform also supports an alternative syntax that is JSON-compatible. This @@ -99,7 +94,7 @@ different (see the [block-type-specific exceptions](#block-type-specific-excepti correspond either to argument names or to nested block type names. * Where a property corresponds to an argument that accepts - [arbitrary expressions](/docs/configuration/expressions/index.html) in the native syntax, the + [arbitrary expressions](/docs/language/expressions/index.html) in the native syntax, the property value is mapped to an expression as described under [_Expression Mapping_](#expression-mapping) below. For arguments that do _not_ accept arbitrary expressions, the interpretation of the property @@ -116,7 +111,7 @@ different (see the [block-type-specific exceptions](#block-type-specific-excepti ## Expression Mapping Since JSON grammar is not able to represent all of the Terraform language -[expression syntax](/docs/configuration/expressions/index.html), JSON values interpreted as expressions +[expression syntax](/docs/language/expressions/index.html), JSON values interpreted as expressions are mapped as follows: | JSON | Terraform Language Interpretation | @@ -128,7 +123,7 @@ are mapped as follows: | Array | Each element is mapped per this table, producing a `tuple(...)` value with suitable element types. | | Null | A literal `null`. | -[string template]: /docs/configuration/expressions/strings.html#string-templates +[string template]: /docs/language/expressions/strings.html#string-templates When a JSON string is encountered in a location where arbitrary expressions are expected, its value is first parsed as a [string template][] diff --git a/website/docs/configuration/style.html.md b/website/docs/language/syntax/style.html.md similarity index 94% rename from website/docs/configuration/style.html.md rename to website/docs/language/syntax/style.html.md index 170b35272..c7599bd07 100644 --- a/website/docs/configuration/style.html.md +++ b/website/docs/language/syntax/style.html.md @@ -10,10 +10,6 @@ description: |- # Style Conventions --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language](../configuration-0-11/index.html). - The Terraform parser allows you some flexibility in how you lay out the elements in your configuration files, but the Terraform language also has some idiomatic style conventions which we recommend users always follow diff --git a/website/docs/configuration/blocks/values/index.html.md b/website/docs/language/values/index.html.md similarity index 57% rename from website/docs/configuration/blocks/values/index.html.md rename to website/docs/language/values/index.html.md index fb800fb70..e73972c41 100644 --- a/website/docs/configuration/blocks/values/index.html.md +++ b/website/docs/language/values/index.html.md @@ -8,11 +8,11 @@ page_title: "Variables and Outputs" The Terraform language includes a few kinds of blocks for requesting or publishing named values. -- [Input Variables](/docs/configuration/variables.html) serve as parameters for +- [Input Variables](/docs/language/values/variables.html) serve as parameters for a Terraform module, so users can customize behavior without editing the source. -- [Output Values](/docs/configuration/outputs.html) are like return values for a +- [Output Values](/docs/language/values/outputs.html) are like return values for a Terraform module. -- [Local Values](/docs/configuration/locals.html) are a convenience feature for +- [Local Values](/docs/language/values/locals.html) are a convenience feature for assigning a short name to an expression. diff --git a/website/docs/configuration/locals.html.md b/website/docs/language/values/locals.html.md similarity index 88% rename from website/docs/configuration/locals.html.md rename to website/docs/language/values/locals.html.md index d77012a32..ad755b264 100644 --- a/website/docs/configuration/locals.html.md +++ b/website/docs/language/values/locals.html.md @@ -9,15 +9,11 @@ description: |- # Local Values --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Local Values](../configuration-0-11/locals.html). - > **Hands-on:** Try the [Simplify Terraform Configuration with Locals](https://learn.hashicorp.com/tutorials/terraform/locals?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. -A local value assigns a name to an [expression](/docs/configuration/expressions/index.html), +A local value assigns a name to an [expression](/docs/language/expressions/index.html), so you can use it multiple times within a module without repeating it. @@ -65,7 +61,7 @@ locals { ## Using Local Values Once a local value is declared, you can reference it in -[expressions](/docs/configuration/expressions/index.html) as `local.`. +[expressions](/docs/language/expressions/index.html) as `local.`. -> **Note:** Local values are _created_ by a `locals` block (plural), but you _reference_ them as attributes on an object named `local` (singular). Make sure diff --git a/website/docs/configuration/outputs.html.md b/website/docs/language/values/outputs.html.md similarity index 89% rename from website/docs/configuration/outputs.html.md rename to website/docs/language/values/outputs.html.md index 6eeedefdf..60450f83d 100644 --- a/website/docs/configuration/outputs.html.md +++ b/website/docs/language/values/outputs.html.md @@ -8,10 +8,6 @@ description: |- # Output Values --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Output Values](../configuration-0-11/outputs.html). - > **Hands-on:** Try the [Output Data From Terraform](https://learn.hashicorp.com/tutorials/terraform/outputs?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. @@ -23,9 +19,9 @@ uses: to a parent module. - A root module can use outputs to print certain values in the CLI output after running `terraform apply`. -- When using [remote state](/docs/state/remote.html), root module outputs can be +- When using [remote state](/docs/language/state/remote.html), root module outputs can be accessed by other configurations via a - [`terraform_remote_state` data source](/docs/providers/terraform/d/remote_state.html). + [`terraform_remote_state` data source](/docs/language/state/remote-state-data.html). Resource instances managed by Terraform each export attributes whose values can be used elsewhere in configuration. Output values are a way to expose some @@ -46,11 +42,11 @@ output "instance_ip_addr" { ``` The label immediately after the `output` keyword is the name, which must be a -valid [identifier](./syntax.html#identifiers). In a root module, this name is +valid [identifier](/docs/language/syntax/configuration.html#identifiers). In a root module, this name is displayed to the user; in a child module, it can be used to access the output's value. -The `value` argument takes an [expression](/docs/configuration/expressions/index.html) +The `value` argument takes an [expression](/docs/language/expressions/index.html) whose result is to be returned to the user. In this example, the expression refers to the `private_ip` attribute exposed by an `aws_instance` resource defined elsewhere in this module (not shown). Any valid expression is allowed @@ -155,9 +151,9 @@ Changes to Outputs: -> **Note:** In Terraform versions prior to Terraform 0.14, setting an output value in the root module as sensitive would prevent Terraform from showing its value in the list of outputs at the end of `terraform apply`. However, the value could still display in the CLI output for other reasons, like if the value is referenced in an expression for a resource argument. Sensitive output values are still recorded in the -[state](/docs/state/index.html), and so will be visible to anyone who is able +[state](/docs/language/state/index.html), and so will be visible to anyone who is able to access the state data. For more information, see -[_Sensitive Data in State_](/docs/state/sensitive-data.html). +[_Sensitive Data in State_](/docs/language/state/sensitive-data.html). @@ -173,7 +169,7 @@ correctly determine the dependencies between resources defined in different modules. Just as with -[resource dependencies](/docs/configuration/blocks/resources/behavior.html#resource-dependencies), +[resource dependencies](/docs/language/resources/behavior.html#resource-dependencies), Terraform analyzes the `value` expression for an output value and automatically determines a set of dependencies, but in less-common cases there are dependencies that cannot be recognized implicitly. In these rare cases, the diff --git a/website/docs/configuration/variables.html.md b/website/docs/language/values/variables.html.md similarity index 93% rename from website/docs/configuration/variables.html.md rename to website/docs/language/values/variables.html.md index 21249c3fc..75f6b4780 100644 --- a/website/docs/configuration/variables.html.md +++ b/website/docs/language/values/variables.html.md @@ -9,10 +9,6 @@ description: |- # Input Variables --> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and -earlier, see -[0.11 Configuration Language: Input Variables](../configuration-0-11/variables.html). - > **Hands-on:** Try the [Customize Terraform Configuration with Variables](https://learn.hashicorp.com/tutorials/terraform/variables?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. Input variables serve as parameters for a Terraform module, allowing aspects @@ -21,7 +17,7 @@ and allowing modules to be shared between different configurations. When you declare variables in the root module of your configuration, you can set their values using CLI options and environment variables. -When you declare them in [child modules](/docs/configuration/blocks/modules/index.html), +When you declare them in [child modules](/docs/language/modules/index.html), the calling module should pass values in the `module` block. If you're familiar with traditional programming languages, it can be useful to @@ -36,7 +32,7 @@ compare Terraform modules to function definitions: variable is being discussed. Other kinds of variables in Terraform include _environment variables_ (set by the shell where Terraform runs) and _expression variables_ (used to indirectly represent a value in an -[expression](/docs/configuration/expressions/index.html)). +[expression](/docs/language/expressions/index.html)). ## Declaring an Input Variable @@ -74,11 +70,11 @@ be unique among all variables in the same module. This name is used to assign a value to the variable from outside and to reference the variable's value from within the module. -The name of a variable can be any valid [identifier](./syntax.html#identifiers) +The name of a variable can be any valid [identifier](/docs/language/syntax/configuration.html#identifiers) _except_ the following: `source`, `version`, `providers`, `count`, `for_each`, `lifecycle`, `depends_on`, `locals`. These names are reserved for meta-arguments in -[module configuration blocks](/docs/configuration/blocks/modules/syntax.html), and cannot be +[module configuration blocks](/docs/language/modules/syntax.html), and cannot be declared as variable names. ## Arguments @@ -106,7 +102,7 @@ configuration. [inpage-type]: #type-constraints The `type` argument in a `variable` block allows you to restrict the -[type of value](/docs/configuration/expressions/types.html) that will be accepted as +[type of value](/docs/language/expressions/types.html) that will be accepted as the value for a variable. If no type constraint is set then a value of any type is accepted. @@ -133,7 +129,7 @@ collections: The keyword `any` may be used to indicate that any type is acceptable. For more information on the meaning and behavior of these different types, as well as detailed information about automatic conversion of complex types, see -[Type Constraints](./types.html). +[Type Constraints](/docs/language/expressions/types.html). If both the `type` and `default` arguments are specified, the given default value must be convertible to the specified type. @@ -187,7 +183,7 @@ The expression can refer only to the variable that the condition applies to, and _must not_ produce errors. If the failure of an expression is the basis of the validation decision, use -[the `can` function](./functions/can.html) to detect such errors. For example: +[the `can` function](/docs/language/functions/can.html) to detect such errors. For example: ```hcl variable "image_id" { @@ -217,7 +213,7 @@ using a sentence structure similar to the above examples. Setting a variable as `sensitive` prevents Terraform from showing its value in the `plan` or `apply` output, when that variable is used within a configuration. -Sensitive values are still recorded in the [state](/docs/state/index.html), and so will be visible to anyone who is able to access the state data. For more information, see [_Sensitive Data in State_](/docs/state/sensitive-data.html). +Sensitive values are still recorded in the [state](/docs/language/state/index.html), and so will be visible to anyone who is able to access the state data. For more information, see [_Sensitive Data in State_](/docs/language/state/sensitive-data.html). A provider can define [an attribute as sensitive](/docs/extend/best-practices/sensitive-state.html#using-the-sensitive-flag), which prevents the value of that attribute from being displayed in logs or regular output. The `sensitive` argument on variables allows users to replicate this behavior for values in their configuration, by defining a variable as `sensitive`. @@ -304,7 +300,7 @@ random_pet.animal: Creation complete after 0s [id=jae-known-mongoose] ## Using Input Variable Values Within the module that declared a variable, its value can be accessed from -within [expressions](/docs/configuration/expressions/index.html) as `var.`, +within [expressions](/docs/language/expressions/index.html) as `var.`, where `` matches the label given in the declaration block: -> **Note:** Input variables are _created_ by a `variable` block, but you @@ -334,7 +330,7 @@ can be set in a number of ways: The following sections describe these options in more detail. This section does not apply to _child_ modules, where values for input variables are instead assigned in the configuration of their parent module, as described in -[_Modules_](/docs/configuration/blocks/modules/index.html). +[_Modules_](/docs/language/modules/index.html). ### Variables on the Command Line @@ -417,7 +413,7 @@ and lower case letters as in the above example. When variable values are provided in a variable definitions file, you can use Terraform's usual syntax for -[literal expressions](/docs/configuration/expressions/types.html#literal-expressions) +[literal expressions](/docs/language/expressions/types.html#literal-expressions) to assign complex-typed values, like lists and maps. Some special rules apply to the `-var` command line option and to environment diff --git a/website/docs/plugins/basics.html.md b/website/docs/plugins/basics.html.md deleted file mode 100644 index 16cdc4b4b..000000000 --- a/website/docs/plugins/basics.html.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -layout: "extend" -page_title: "Plugin Basics" -sidebar_current: "docs-plugins-basics" -description: |- - This page documents the basics of how the plugin system in Terraform works, and how to setup a basic development environment for plugin development if you're writing a Terraform plugin. ---- - -# Plugin Basics - -~> **Advanced topic!** Plugin development is a highly advanced -topic in Terraform, and is not required knowledge for day-to-day usage. -If you don't plan on writing any plugins, this section of the documentation is -not necessary to read. For general use of Terraform, please see -[Intro to Terraform](/intro/index.html) or the -[Terraform: Get Started](https://learn.hashicorp.com/collections/terraform/aws-get-started?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) -collection on HashiCorp Learn. - -This page documents the basics of how the plugin system in Terraform -works, and how to setup a basic development environment for plugin development -if you're writing a Terraform plugin. - -## How it Works - -Terraform providers and provisioners are provided via plugins. Each plugin -exposes an implementation for a specific service, such as AWS, or provisioner, -such as bash. Plugins are executed as a separate process and communicate with -the main Terraform binary over an RPC interface. - -The code within the binaries must adhere to certain interfaces. -The network communication and RPC is handled automatically by higher-level -Terraform libraries. The exact interface to implement is documented -in its respective documentation section. - -## Installing Plugins - -The [provider plugins distributed by HashiCorp](/docs/providers/index.html) are -automatically installed by `terraform init`. Third-party plugins (both -providers and provisioners) can be manually installed into the user plugins -directory, located at `%APPDATA%\terraform.d\plugins` on Windows and -`~/.terraform.d/plugins` on other systems. - -For more information, see: - -- [Configuring Providers](/docs/configuration/providers.html) - -For developer-centric documentation, see: - -- [How Terraform Works: Plugin Discovery](/docs/extend/how-terraform-works.html#discovery) - -## Developing a Plugin - -Developing a plugin is simple. The only knowledge necessary to write -a plugin is basic command-line skills and basic knowledge of the -[Go programming language](http://golang.org). - --> **Note:** A common pitfall is not properly setting up a -$GOPATH. This can lead to strange errors. You can read more about -this [here](https://golang.org/doc/code.html) to familiarize -yourself. - -Create a new Go project somewhere in your `$GOPATH`. If you're a -GitHub user, we recommend creating the project in the directory -`$GOPATH/src/github.com/USERNAME/terraform-NAME`, where `USERNAME` -is your GitHub username and `NAME` is the name of the plugin you're -developing. This structure is what Go expects and simplifies things down -the road. - -The `NAME` should either begin with `provider-` or `provisioner-`, -depending on what kind of plugin it will be. The repository name will, -by default, be the name of the binary produced by `go install` for -your plugin package. - -With the package directory made, create a `main.go` file. This project will -be a binary so the package is "main": - -```golang -package main - -import ( - "github.com/hashicorp/terraform/plugin" -) - -func main() { - plugin.Serve(new(MyPlugin)) -} -``` - -The name `MyPlugin` is a placeholder for the struct type that represents -your plugin's implementation. This must implement either -`terraform.ResourceProvider` or `terraform.ResourceProvisioner`, depending -on the plugin type. - -To test your plugin, the easiest method is to copy your `terraform` binary -to `$GOPATH/bin` and ensure that this copy is the one being used for testing. -`terraform init` will search for plugins within the same directory as the -`terraform` binary, and `$GOPATH/bin` is the directory into which `go install` -will place the plugin executable. diff --git a/website/docs/plugins/index.html.md b/website/docs/plugins/index.html.md deleted file mode 100644 index 97ceeff08..000000000 --- a/website/docs/plugins/index.html.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: "extend" -page_title: "Plugins" -sidebar_current: "docs-plugins" -description: |- - Terraform is built on a plugin-based architecture. All providers and provisioners that are used in Terraform configurations are plugins, even the core types such as AWS and Heroku. Users of Terraform are able to write new plugins in order to support new functionality in Terraform. ---- - -# Plugins - -Terraform is built on a plugin-based architecture. All providers and -provisioners that are used in Terraform configurations are plugins, even -the core types such as AWS and Heroku. Users of Terraform are able to -write new plugins in order to support new functionality in Terraform. - -This section of the documentation gives a high-level overview of how -to write plugins for Terraform. It does not hold your hand through the -process, however, and expects a relatively high level of understanding -of Go, provider semantics, Unix, etc. - -~> **Advanced topic!** Plugin development is a highly advanced -topic in Terraform, and is not required knowledge for day-to-day usage. -If you don't plan on writing any plugins, we recommend not reading -this section of the documentation. diff --git a/website/docs/plugins/provider.html.md b/website/docs/plugins/provider.html.md deleted file mode 100644 index 9b5c04b6d..000000000 --- a/website/docs/plugins/provider.html.md +++ /dev/null @@ -1,308 +0,0 @@ ---- -layout: "extend" -page_title: "Provider Plugins" -sidebar_current: "docs-plugins-provider" -description: |- - A provider in Terraform is responsible for the lifecycle of a resource: create, read, update, delete. An example of a provider is AWS, which can manage resources of type `aws_instance`, `aws_eip`, `aws_elb`, etc. ---- - -# Provider Plugins - -~> **Advanced topic!** Plugin development is a highly advanced -topic in Terraform, and is not required knowledge for day-to-day usage. -If you don't plan on writing any plugins, this section of the documentation is -not necessary to read. For general use of Terraform, please see -[Intro to Terraform](/intro/index.html) or the -[Terraform: Get Started](https://learn.hashicorp.com/collections/terraform/aws-get-started?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) -collection on HashiCorp Learn. - -> **Hands-on:** Try the [Call APIs with Terraform Providers](https://learn.hashicorp.com/collections/terraform/providers?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) collection on HashiCorp Learn. - -A provider in Terraform is responsible for the lifecycle of a resource: -create, read, update, delete. An example of a provider is AWS, which -can manage resources of type `aws_instance`, `aws_eip`, `aws_elb`, etc. - -The primary reasons to care about provider plugins are: - - * You want to add a new resource type to an existing provider. - - * You want to write a completely new provider for managing resource - types in a system not yet supported. - - * You want to write a completely new provider for custom, internal - systems such as a private inventory management system. - -If you're interested in provider development, then read on. The remainder -of this page will assume you're familiar with -[plugin basics](/docs/plugins/basics.html) and that you already have -a basic development environment setup. - -## Provider Plugin Codebases - -Provider plugins live outside of the Terraform core codebase in their own -source code repositories, and are typically published in a provider registry -such as [the public Terraform Registry](https://registry.terraform.io/). - -When developing a provider plugin, it is recommended to use a common `GOPATH` -that includes both the core Terraform repository and the repositories of any -providers being changed. This makes it easier to use a locally-built -`terraform` executable and a set of locally-built provider plugins together -without further configuration. - -For example, to download both Terraform and the `template` provider into -`GOPATH`: - -``` -$ go get github.com/hashicorp/terraform -$ go get github.com/terraform-providers/terraform-provider-template -``` - -These two packages are both "main" packages that can be built into separate -executables with `go install`: - -``` -$ go install github.com/hashicorp/terraform -$ go install github.com/terraform-providers/terraform-provider-template -``` - -After running the above commands, both Terraform core and the `template` -provider will both be installed in the current `GOPATH` and `$GOPATH/bin` -will contain both `terraform` and `terraform-provider-template` executables. -This `terraform` executable will find and use the `template` provider plugin -alongside it in the `bin` directory in preference to downloading and installing -an official release. - -When constructing a new provider from scratch, it's recommended to follow -a similar repository structure as for the existing providers, with the main -package in the repository root and a library package in a subdirectory named -after the provider. For more information, see the -[Call APIs with Terraform Providers](https://learn.hashicorp.com/collections/terraform/providers?utm_source=WEBSITE/docs/extend/writing-custom-providers.htmlutm_medium=WEB_IO/docs/extend/writing-custom-providers.htmlutm_offer=ARTICLE_PAGE/docs/extend/writing-custom-providers.htmlutm_content=DOCS) collection on HashiCorp Learn. - -When making changes only to files within the provider repository, it is _not_ -necessary to re-build the main Terraform executable. Note that some packages -from the Terraform repository are used as library dependencies by providers, -such as `github.com/hashicorp/terraform/helper/schema`; it is recommended to -use `govendor` to create a local vendor copy of the relevant packages in the -provider repository, as can be seen in the repositories within the -`terraform-providers` GitHub organization. - -## Low-Level Interface - -The interface you must implement for providers is -[ResourceProvider](https://github.com/hashicorp/terraform/blob/master/terraform/resource_provider.go). - -This interface is extremely low level, however, and we don't recommend -you implement it directly. Implementing the interface directly is error -prone, complicated, and difficult. - -Instead, we've developed some higher level libraries to help you out -with developing providers. These are the same libraries we use in our -own core providers. - -## helper/schema - -The `helper/schema` package in the plugin SDK is a framework designed to allow -building providers at a higher level of abstraction than the raw plugin protocol -that Terraform expects. This is the same library we've used to build most -of the official providers. - -For more information on `helper/schema`, see -[the `helper/schema` package reference documentation](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema). - -## Provider - -The first thing to do in your plugin is to create the -[schema.Provider](https://godoc.org/github.com/hashicorp/terraform/helper/schema#Provider) structure. -This structure implements the `ResourceProvider` interface. We -recommend creating this structure in a function to make testing easier -later. Example: - -```golang -func Provider() *schema.Provider { - return &schema.Provider{ - ... - } -} -``` - -Within the `schema.Provider`, you should initialize all the fields. They -are documented within the godoc, but a brief overview is here as well: - - * `Schema` - This is the configuration schema for the provider itself. - You should define any API keys, etc. here. Schemas are covered below. - - * `ResourcesMap` - The map of resources that this provider supports. - All keys are resource names and the values are the - [schema.Resource](https://godoc.org/github.com/hashicorp/terraform/helper/schema#Resource) structures implementing this resource. - - * `ConfigureFunc` - This function callback is used to configure the - provider. This function should do things such as initialize any API - clients, validate API keys, etc. The `interface{}` return value of - this function is the `meta` parameter that will be passed into all - resource [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) - functions. In general, the returned value is a configuration structure - or a client. - -As part of the unit tests, you should call `InternalValidate`. This is used -to verify the structure of the provider and all of the resources, and reports -an error if it is invalid. An example test is shown below: - -```golang -func TestProvider(t *testing.T) { - if err := Provider().(*schema.Provider).InternalValidate(); err != nil { - t.Fatalf("err: %s", err) - } -} -``` - -Having this unit test will catch a lot of beginner mistakes as you build -your provider. - -## Resources - -Next, you'll want to create the resources that the provider can manage. -These resources are put into the `ResourcesMap` field of the provider -structure. Again, we recommend creating functions to instantiate these. -An example is shown below. - -```golang -func resourceComputeAddress() *schema.Resource { - return &schema.Resource { - ... - } -} -``` - -Resources are described using the -[schema.Resource](https://godoc.org/github.com/hashicorp/terraform/helper/schema#Resource) -structure. This structure has the following fields: - - * `Schema` - The configuration schema for this resource. Schemas are - covered in more detail below. - - * `Create`, `Read`, `Update`, and `Delete` - These are the callback - functions that implement CRUD operations for the resource. The only - optional field is `Update`. If your resource doesn't support update, then - you may keep that field nil. - - * `Importer` - If this is non-nil, then this resource is - [importable](/docs/import/importability.html). It is recommended to - implement this. - -The CRUD operations in more detail, along with their contracts: - - * `Create` - This is called to create a new instance of the resource. - Terraform guarantees that an existing ID is not set on the resource - data. That is, you're working with a new resource. Therefore, you are - responsible for calling `SetId` on your `schema.ResourceData` using a - value suitable for your resource. This ensures whatever resource - state you set on `schema.ResourceData` will be persisted in local state. - If you neglect to `SetId`, no resource state will be persisted. - - * `Read` - This is called to resync the local state with the remote state. - Terraform guarantees that an existing ID will be set. This ID should be - used to look up the resource. Any remote data should be updated into - the local data. **No changes to the remote resource are to be made.** - If the resource is no longer present, calling `SetId` - with an empty string will signal its removal. - - * `Update` - This is called to update properties of an existing resource. - Terraform guarantees that an existing ID will be set. Additionally, - the only changed attributes are guaranteed to be those that support - update, as specified by the schema. Be careful to read about partial - states below. - - * `Delete` - This is called to delete the resource. Terraform guarantees - an existing ID will be set. - - * `Exists` - This is called to verify a resource still exists. It is - called prior to `Read`, and lowers the burden of `Read` to be able - to assume the resource exists. `false` should be returned if - the resources is no longer present, which has the same effect - as calling `SetId("")` from `Read` (i.e. removal of the resource data - from state). - -## Schemas - -Both providers and resources require a schema to be specified. The schema -is used to define the structure of the configuration, the types, etc. It is -very important to get correct. - -In both provider and resource, the schema is a `map[string]*schema.Schema`. -The key of this map is the configuration key, and the value is a schema for -the value of that key. - -Schemas are incredibly powerful, so this documentation page won't attempt -to cover the full power of them. Instead, the API docs should be referenced -which cover all available settings. - -We recommend viewing schemas of existing or similar providers to learn -best practices. A good starting place is the -[core Terraform providers](https://github.com/terraform-providers). - -## Resource Data - -The parameter to provider configuration as well as all the CRUD operations -on a resource is a -[schema.ResourceData](https://godoc.org/github.com/hashicorp/terraform/helper/schema#ResourceData). -This structure is used to query configurations as well as to set information -about the resource such as its ID, connection information, and computed -attributes. - -The API documentation covers ResourceData well, as well as the core providers -in Terraform. - -**Partial state** deserves a special mention. Occasionally in Terraform, create or -update operations are not atomic; they can fail halfway through. As an example, -when creating an AWS security group, creating the group may succeed, -but creating all the initial rules may fail. In this case, it is incredibly -important that Terraform record the correct _partial state_ so that a -subsequent `terraform apply` fixes this resource. - -Most of the time, partial state is not required. When it is, it must be -specifically enabled. An example is shown below: - -```golang -func resourceUpdate(d *schema.ResourceData, meta interface{}) error { - // Enable partial state mode - d.Partial(true) - - if d.HasChange("tags") { - // If an error occurs, return with an error, - // we didn't finish updating - if err := updateTags(d, meta); err != nil { - return err - } - - d.SetPartial("tags") - } - - if d.HasChange("name") { - if err := updateName(d, meta); err != nil { - return err - } - - d.SetPartial("name") - } - - // We succeeded, disable partial mode - d.Partial(false) - - return nil -} -``` - -In the example above, it is possible that setting the `tags` succeeds, -but setting the `name` fails. In this scenario, we want to make sure -that only the state of the `tags` is updated. To do this the -`Partial` and `SetPartial` functions are used. - -`Partial` toggles partial-state mode. When disabled, all changes are merged -into the state upon result of the operation. When enabled, only changes -enabled with `SetPartial` are merged in. - -`SetPartial` tells Terraform what state changes to adopt upon completion -of an operation. You should call `SetPartial` with every key that is safe -to merge into the state. The parameter to `SetPartial` is a prefix, so -if you have a nested structure and want to accept the whole thing, -you can just specify the prefix. diff --git a/website/docs/providers/terraform/index.html.markdown b/website/docs/providers/terraform/index.html.markdown deleted file mode 100644 index 99a3e561e..000000000 --- a/website/docs/providers/terraform/index.html.markdown +++ /dev/null @@ -1,22 +0,0 @@ ---- -layout: "language" -page_title: "Provider: Terraform" -sidebar_current: "docs-terraform-index" -description: |- - The special `terraform_remote_state` data source is used to access outputs from shared infrastructure. ---- - -# The Built-In `terraform` Provider - -Terraform includes one built-in data source: -[`terraform_remote_state`](/docs/providers/terraform/d/remote_state.html), which -provides access to root module outputs from some other Terraform configuration. - -This data source is implemented by a built-in provider, whose -[source address](/docs/configuration/provider-requirements.html#source-addresses) -is `terraform.io/builtin/terraform`. You do not need to require or configure -this provider in order to use the `terraform_remote_state` data source; it is -always available. - -The `terraform_remote_state` data source is -[documented in the Terraform Language docs](/docs/providers/terraform/d/remote_state.html). diff --git a/website/docs/state/environments.html.md b/website/docs/state/environments.html.md deleted file mode 100644 index 1d340b8cb..000000000 --- a/website/docs/state/environments.html.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: "language" -page_title: "State: Environments" -sidebar_current: "docs-state-env" -description: |- - Legacy terminology for "Workspaces". ---- - -# State Environments - -The term _state environment_, or just _environment_, was used within the -Terraform 0.9 releases to refer to the idea of having multiple distinct, -named states associated with a single configuration directory. - -After this concept was implemented, we received feedback that this terminology -caused confusion due to other uses of the word "environment", both within -Terraform itself and within organizations using Terraform. - -As of 0.10, the preferred term is "workspace". For more information on -workspaces, see [the main Workspaces page](/docs/state/workspaces.html). diff --git a/website/guides/core-workflow.html.md b/website/guides/core-workflow.html.md index f60ffb110..e307728e4 100644 --- a/website/guides/core-workflow.html.md +++ b/website/guides/core-workflow.html.md @@ -235,7 +235,7 @@ for a better experience at each step. Terraform Cloud provides a centralized and secure location for storing input variables and state while also bringing back a tight feedback loop for speculative plans for config authors. Terraform configuration interacts with -Terraform Cloud via the ["remote" backend](/docs/backends/types/remote.html). +Terraform Cloud via the ["remote" backend](/docs/language/settings/backends/remote.html). ``` terraform { diff --git a/website/layouts/docs.erb b/website/layouts/docs.erb index 67e1aefc1..7ebf352d6 100644 --- a/website/layouts/docs.erb +++ b/website/layouts/docs.erb @@ -1,15 +1,15 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> -

Terraform CLI

+

Terraform CLI

@@ -37,15 +37,15 @@
  • - plan + plan
  • - apply + apply
  • - destroy + destroy
  • @@ -58,11 +58,11 @@
  • - login + login
  • - logout + logout
  • @@ -75,23 +75,23 @@
  • - console + console
  • - fmt + fmt
  • - validate + validate
  • - 0.13upgrade + 0.13upgrade
  • - 0.12upgrade + 0.12upgrade
  • @@ -104,23 +104,23 @@
  • - graph + graph
  • - output + output
  • - show + show
  • - state list + state list
  • - state show + state show
  • @@ -129,19 +129,19 @@ Importing Infrastructure @@ -188,11 +192,11 @@
  • - taint + taint
  • - untaint + untaint
  • @@ -205,15 +209,15 @@
  • - state mv + state mv
  • - state rm + state rm
  • - state replace-provider + state replace-provider
  • @@ -226,15 +230,15 @@
  • - state pull + state pull
  • - state push + state push
  • - force-unlock + force-unlock
  • @@ -253,27 +257,27 @@ workspace @@ -288,23 +292,27 @@
  • - providers + Plugin Signing
  • - version + providers
  • - providers lock + version
  • - providers mirror + providers lock
  • - providers schema + providers mirror +
  • + +
  • + providers schema
  • @@ -317,11 +325,11 @@
  • - CLI Config File + CLI Config File
  • - Environment Variables + Environment Variables
  • @@ -350,159 +358,159 @@ diff --git a/website/layouts/language.erb b/website/layouts/language.erb index 27e37e5c1..f6c5145cb 100644 --- a/website/layouts/language.erb +++ b/website/layouts/language.erb @@ -1,22 +1,22 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> -

    Terraform Language

    +

    Terraform Language