Skip to content

Commit

Permalink
website: Update all links to {expressions,modules,resources}.html
Browse files Browse the repository at this point in the history
...as well as to the standard module structure section in module development.
  • Loading branch information
nfagerlund committed Nov 18, 2020
1 parent 535f409 commit d7e6a11
Show file tree
Hide file tree
Showing 42 changed files with 103 additions and 96 deletions.
2 changes: 1 addition & 1 deletion website/docs/cli/code/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ potentially save you time and effort.

- [The `terraform console` command](/docs/commands/console.html) starts an
interactive shell for evaluating Terraform
[expressions](/docs/configuration/expressions.html), which can be a faster way
[expressions](/docs/configuration/expressions/index.html), which can be a faster way
to verify that a particular resource argument results in the value you expect.


Expand Down
2 changes: 1 addition & 1 deletion website/docs/commands/0.12upgrade.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ 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/modules.html#module-versions)
[fix existing configurations to a previous version](/docs/configuration/blocks/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
Expand Down
4 changes: 2 additions & 2 deletions website/docs/commands/console.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ description: |-
# Command: console

The `terraform console` command provides an interactive console for
evaluating [expressions](/docs/configuration/expressions.html).
evaluating [expressions](/docs/configuration/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.html).
experimenting with [expressions](/docs/configuration/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).
Expand Down
4 changes: 2 additions & 2 deletions website/docs/commands/import.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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/resources.html#count-multiple-resource-instances-by-count):
[`count`](/docs/configuration/meta-arguments/count.html):

```shell
$ terraform import 'aws_instance.baz[0]' i-abcd1234
Expand All @@ -142,7 +142,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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings):
[`for_each`](/docs/configuration/meta-arguments/for_each.html):

Linux, Mac OS, and UNIX:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/commands/state/mv.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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/resources.html#count-multiple-resource-instances-by-count) to
[`count`](/docs/configuration/meta-arguments/count.html) to
the first instance of a resource named `helper` also configured with `count`:

```shell
Expand All @@ -105,7 +105,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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
[`for_each`](/docs/configuration/meta-arguments/for_each.html)
to the `"example456"` instance of a resource named `helper` also configuring `for_each`:

Linux, Mac OS, and UNIX:
Expand Down
4 changes: 2 additions & 2 deletions website/docs/commands/state/rm.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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/resources.html#count-multiple-resource-instances-by-count):
[`count`](/docs/configuration/meta-arguments/count.html):

```shell
$ terraform state rm 'packet_device.worker[0]'
Expand All @@ -87,7 +87,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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings):
[`for_each`](/docs/configuration/meta-arguments/for_each.html):

Linux, Mac OS, and UNIX:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/commands/state/show.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/resources.html#count-multiple-resource-instances-by-count):
[`count`](/docs/configuration/meta-arguments/count.html):

```shell
$ terraform state show 'packet_device.worker[0]'
Expand All @@ -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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings):
[`for_each`](/docs/configuration/meta-arguments/for_each.html):

Linux, Mac OS, and UNIX:

Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration-0-11/interpolation.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: |-

-> **Note:** This page is about Terraform 0.11 and earlier. For Terraform 0.12
and later, see
[Configuration Language: Expressions](../configuration/expressions.html) and
[Configuration Language: Expressions](/docs/configuration/expressions/index.html) and
[Configuration Language: Functions](../configuration/functions.html).

Embedded within strings in Terraform, whether you're using the
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/attr-as-blocks.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.html#dynamic-blocks)
[`dynamic` blocks](/docs/configuration/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
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/blocks/providers/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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/resources.html)
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
manage.

Expand Down
23 changes: 13 additions & 10 deletions website/docs/configuration/data-sources.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ 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 types](./resources.html#resource-types-and-arguments).
alongside its set of [resource](/docs/configuration/blocks/resources/index.html)
types.

## Using Data Sources

Expand Down Expand Up @@ -71,7 +72,7 @@ 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](./expressions.html) and other dynamic
use of [expressions](/docs/configuration/expressions/index.html) and other dynamic
Terraform language features.

However, there are some "meta-arguments" that are defined by Terraform itself
Expand Down Expand Up @@ -113,7 +114,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](./resources.html#resource-dependencies).
[as defined for managed resources](/docs/configuration/blocks/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.

Expand All @@ -122,8 +123,8 @@ the data source until after all changes to the dependencies have been applied.

## Multiple Resource Instances

Data resources support [`count`](./resources.html#count-multiple-resource-instances-by-count)
and [`for_each`](./resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
Data resources support [`count`](/docs/configuration/meta-arguments/count.html)
and [`for_each`](/docs/configuration/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
Expand All @@ -133,7 +134,7 @@ own variant of the constraint arguments, producing an indexed result.

## Selecting a Non-default Provider Configuration

Data resources support [the `provider` meta-argument](./resources.html#provider-selecting-a-non-default-provider-configuration)
Data resources support [the `provider` meta-argument](/docs/configuration/meta-arguments/resource-provider.html)
as defined for managed resources, with the same syntax and behavior.

## Lifecycle Customizations
Expand Down Expand Up @@ -187,13 +188,15 @@ resource "aws_instance" "web" {
## Meta-Arguments

As data sources are essentially a read only subset of resources, they also
support the same [meta-arguments](./resources.html#meta-arguments) of resources
support the same [meta-arguments](/docs/configuration/blocks/resources/syntax.html#meta-arguments) of resources
with the exception of the
[`lifecycle` configuration block](./resources.html#lifecycle-lifecycle-customizations).
[`lifecycle` configuration block](/docs/configuration/meta-arguments/lifecycle.html).

### Non-Default Provider Configurations

Similarly to [resources](./resources.html), when a module has multiple configurations for the same provider you can specify which configuration to use with the `provider` meta-argument:
Similarly to [resources](/docs/configuration/blocks/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:

```hcl
data "aws_ami" "web" {
Expand All @@ -204,7 +207,7 @@ data "aws_ami" "web" {
```

See
[Resources: Selecting a Non-Default Provider Configuration](./resources.html#provider-selecting-a-non-default-provider-configuration)
[The Resource `provider` Meta-Argument](/docs/configuration/meta-arguments/resource-provider.html)
for more information.

## Data Source Lifecycle
Expand Down
10 changes: 5 additions & 5 deletions website/docs/configuration/dependency-lock.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ dependency that come from outside of its own codebase:

* [Providers](./provider-requirements.html), which are plugins for Terraform
that extend it with support for interacting with various external systems.
* [Modules](./modules.html), which allow splitting out groups of Terraform
configuration constructs (written in the Terraform language) into reusable
abstractions.
* [Modules](/docs/configuration/blocks/modules/index.html), which allow
splitting out groups of Terraform configuration constructs (written in the
Terraform language) into reusable abstractions.

Both of these dependency types can be published and updated independently from
Terraform itself and from the configurations that depend on them. For that
Expand Down Expand Up @@ -168,7 +168,7 @@ block in the dependency lock file.
@@ -6,6 +6,26 @@
]
}

+provider "registry.terraform.io/hashicorp/azurerm" {
+ version = "2.30.0"
+ constraints = "~> 2.12"
Expand Down Expand Up @@ -219,7 +219,7 @@ block to reflect that change.
+++ .terraform.lock.hcl 2020-10-07 16:43:42.785665945 -0700
@@ -7,22 +7,22 @@
}

provider "registry.terraform.io/hashicorp/azurerm" {
- version = "2.1.0"
- constraints = "~> 2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/files/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/modules.html) to
A Terraform module can use [module calls](/docs/configuration/blocks/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
Expand Down
4 changes: 2 additions & 2 deletions website/docs/configuration/functions.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ max(5, 12, 9)
```

For more details on syntax, see
[_Function Calls_](./expressions.html#function-calls)
on the Expressions page.
[_Function Calls_](/docs/configuration/expressions/function-calls.html)
in the Expressions section.

The Terraform language does not support user-defined functions, and so only
the functions built in to the language are available for use. The navigation
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/functions/cidrsubnets.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ platforms.
```

You can use nested `cidrsubnets` calls with
[`for` expressions](/docs/configuration/expressions.html#for-expressions)
[`for` expressions](/docs/configuration/expressions/for.html)
to concisely allocate groups of network address blocks:

```
Expand Down
4 changes: 2 additions & 2 deletions website/docs/configuration/functions/csvdecode.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
[the `for_each` meta-argument](/docs/configuration/meta-arguments/for_each.html)
to describe a collection of similar objects whose differences are
described by the rows in the given CSV file.

Expand Down Expand Up @@ -94,7 +94,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/resources.html#count-multiple-resource-instances-by-count)
[the `count` meta-argument](/docs/configuration/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
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/functions/fileset.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings):
[the `for_each` meta-argument](/docs/configuration/meta-arguments/for_each.html):

```hcl
resource "example_thing" "example" {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/configuration/functions/flatten.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Indirectly-nested lists, such as those in maps, are _not_ flattened.
## Flattening nested structures for `for_each`

The
[resource `for_each`](/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
[resource `for_each`](/docs/configuration/meta-arguments/for_each.html)
and
[`dynamic` block](/docs/configuration/expressions.html#dynamic-blocks)
[`dynamic` block](/docs/configuration/expressions/dynamic-blocks.html)
language features both require a collection value that has one element for
each repetition.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/functions/jsondecode.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ of the result of decoding that string.
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).

This function maps JSON values to
[Terraform language values](../expressions.html#types-and-values)
[Terraform language values](/docs/configuration/expressions/types.html)
in the following way:

| JSON type | Terraform type |
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/functions/jsonencode.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ earlier, see
The JSON encoding is defined in [RFC 7159](https://tools.ietf.org/html/rfc7159).

This function maps
[Terraform language values](../expressions.html#types-and-values)
[Terraform language values](/docs/configuration/expressions/types.html)
to JSON values in the following way:

| Terraform type | JSON type |
Expand Down
4 changes: 2 additions & 2 deletions website/docs/configuration/functions/setproduct.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ elements all have a consistent type:
## Finding combinations for `for_each`

The
[resource `for_each`](/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings)
[resource `for_each`](/docs/configuration/meta-arguments/for_each.html)
and
[`dynamic` block](/docs/configuration/expressions.html#dynamic-blocks)
[`dynamic` block](/docs/configuration/expressions/dynamic-blocks.html)
language features both require a collection value that has one element for
each repetition.

Expand Down
18 changes: 9 additions & 9 deletions website/docs/configuration/functions/templatefile.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ templatefile(path, vars)
```

The template syntax is the same as for
[string templates](../expressions.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.
[string templates](/docs/configuration/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.

The "vars" argument must be a map. Within the template file, each of the keys
in the map is available as a variable for interpolation. The template may
Expand Down Expand Up @@ -78,8 +78,8 @@ The `templatefile` function renders the template:

```
> templatefile(
"${path.module}/backends.tmpl",
{
"${path.module}/backends.tmpl",
{
config = {
"x" = "y"
"foo" = "bar"
Expand All @@ -102,7 +102,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.html)
[normal Terraform expression syntax](/docs/configuration/expressions/index.html)
as in the following examples:

```
Expand All @@ -122,9 +122,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.html#for-expressions)
[`for` expression](/docs/configuration/expressions/for.html)
rather than by using
[template directives](/docs/configuration/expressions.html#directives).
[template directives](/docs/configuration/expressions/strings.html#directives).

```json
{"backends":["10.0.0.1:8080","10.0.0.2:8080"]}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/configuration/functions/timestamp.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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](../resources.html#ignore_changes)
[the `ignore_changes` lifecycle meta-argument](/docs/configuration/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/).

Expand Down
Loading

0 comments on commit d7e6a11

Please sign in to comment.