diff --git a/content/terraform-docs-common/redirects.jsonc b/content/terraform-docs-common/redirects.jsonc index 5c8c395996..3b8388c663 100644 --- a/content/terraform-docs-common/redirects.jsonc +++ b/content/terraform-docs-common/redirects.jsonc @@ -427,22 +427,10 @@ "destination": "/terraform/language/v:version/modules/configuration", "permanent": true }, - // Moving meta-arguments content to dedicated meta-arguments reference page - { - "source": "/terraform/language/meta-arguments/:slug", - "destination": "/terraform/language/meta-arguments", - "permanent": true - }, - // meta-arguments content pre PR-530 (anything 1.11 and older) + // add meta-arguments landing page for 1.11 and older { "source": "/terraform/language/v:version(1\\.(?:[1-9]|1[01])\\.x)/meta-arguments", - "destination": "/terraform/language/v:version/meta-arguments/depends_on", - "permanent": true - }, - // meta-arguments content post PR-530 (anything 1.12 and above) - { - "source": "/terraform/language/v:version((?:1\\.(?:1[2-9]|[2-9]\\d)|[2-9]\\d*\\.\\d+)\\.x)/meta-arguments/:slug", - "destination": "/terraform/language/v:version/meta-arguments", + "destination": "/terraform/language/v:version/resources/syntax#meta-arguments", "permanent": true }, // Reference rewrites phase 1 - latest diff --git a/content/terraform/v1.12.x/data/language-nav-data.json b/content/terraform/v1.12.x/data/language-nav-data.json index 0743392450..c9dd491491 100644 --- a/content/terraform/v1.12.x/data/language-nav-data.json +++ b/content/terraform/v1.12.x/data/language-nav-data.json @@ -328,7 +328,37 @@ }, { "title": "Meta-arguments", - "path": "meta-arguments" + "routes": [ + { + "title": "Overview", + "path": "meta-arguments", + "alias": "actions" + }, + { + "title": "count", + "path": "meta-arguments/count" + }, + { + "title": "depends_on", + "path": "meta-arguments/depends_on" + }, + { + "title": "for_each", + "path": "meta-arguments/for_each" + }, + { + "title": "lifecycle", + "path": "meta-arguments/lifecycle" + }, + { + "title": "provider", + "path": "meta-arguments/provider" + }, + { + "title": "providers", + "path": "meta-arguments/providers" + } + ] }, { "title": "Built-in resources", diff --git a/content/terraform/v1.12.x/docs/language/block/check.mdx b/content/terraform/v1.12.x/docs/language/block/check.mdx index 61bf3dcf66..26375c17d5 100644 --- a/content/terraform/v1.12.x/docs/language/block/check.mdx +++ b/content/terraform/v1.12.x/docs/language/block/check.mdx @@ -122,7 +122,7 @@ The arguments within a `data` block are provider-specific. Refer to the [registr ### `depends_on` -The `depends_on` argument specifies an upstream resource that the `data` block depends on. Terraform must complete all operations on the upstream resource before fetching information from the `data` block. +The `depends_on` argument specifies an upstream resource that the `data` block depends on. Terraform must complete all operations on the upstream resource before fetching information from the `data` block. ```hcl check "unique_name" { @@ -135,13 +135,7 @@ check "unique_name" { } ``` -We recommend adding the `depends_on` argument if your nested data source depends on another resource without referencing that resource directly. - -For example, if you define a `check` that verifies that a website API returns `200`, that check fails the first time Terraform runs your configuration because your website's infrastructure does not exist yet. You can set the `depends_on` argument to a resource, such as the load balancer, to ensure Terraform only runs the `check` once the website is up. When running an operation, Terraform evaluates the `check`, warns `known after apply` until that crucial piece of your website is ready, and continues the operation. - -However, this strategy only works when the `data` block does not directly reference the resource specified in the `depends_on` argument. Otherwise, anytime that resource changes, the `check` block warns `known after apply` until Terraform updates that resource, making your check potentially noisy and ineffective. Refer to the [example](#resource-dependency) for more details. - -The `depends_on` block is a meta-argument. Meta-arguments are built-in arguments that control how Terraform creates resources. Refer to [Meta-arguments](/terraform/language/meta-arguments) for additional information. +`depends_on` is a **meta-argument**. Meta-arguments are built into the Terraform language and control how Terraform creates resources. Refer to the [`depends_on` reference](/terraform/language/meta-arguments/depends_on) for details about how the argument works. ### `provider` @@ -158,16 +152,7 @@ check "unique_name" { } ``` -By default, Terraform automatically selects a provider based on the nested data source's type, but you can create multiple provider configurations and use a non-default configuration for specific data sources. - -The `provider` argument is a meta-argument, which is built into Terraform and controls the way that Terraform creates resources. Refer to [Meta-arguments](/terraform/language/meta-arguments) for additional information. - -#### Summary - -- Data type: Block. -- Default: None. -- Supported meta-arguments: `depends_on` and `provider`. -- Example: [Resource dependency](#resource-dependency). +`provider` is a **meta-argument**. Meta-arguments are built into the Terraform language and control how Terraform creates resources. Refer to the [`provider` reference](/terraform/language/meta-arguments/provider) for details about how the argument works. ## Examples @@ -210,22 +195,4 @@ check "service_validation" { error_message = "Load balancer must have at least one security group" } } -``` - -### Resource dependency - -In the following example, Terraform waits to run the check until it creates the `aws_db_instance.main` database. Terraform prints `known after apply`, instead of printing false warnings, until it finishes creating the database: - -```hcl -check "database_connection" { - data "postgresql_database" "app_db" { - name = "application" - depends_on = [aws_db_instance.main] - } - - assert { - condition = data.postgresql_database.app_db.allow_connections - error_message = "Database is not accepting connections" - } -} -``` +``` \ No newline at end of file diff --git a/content/terraform/v1.12.x/docs/language/block/data.mdx b/content/terraform/v1.12.x/docs/language/block/data.mdx index c980349cdc..70e4b90fd1 100644 --- a/content/terraform/v1.12.x/docs/language/block/data.mdx +++ b/content/terraform/v1.12.x/docs/language/block/data.mdx @@ -22,7 +22,7 @@ The `data` block supports the following configuration: - [`lifecycle`](#lifecycle)   block - [`precondition`](#precondition)   block - [`condition`](#precondition)   string - - [`error_message`](#precondition) & nbsp string + - [`error_message`](#precondition)   string - [`postcondition`](#postcondition)   block - [`condition`](#postcondition)   string - [`error_message`](#postcondition)   string @@ -74,7 +74,7 @@ The provider developer determines which arguments you can define for a data sour ### `count` -The `count` meta-argument instructs Terraform to provision multiple instances of the same data source with identical or similar configuration. +The `count` meta-argument instructs Terraform to provision multiple instances of the same data source with identical or similar configuration. You cannot use both a `count` and ` for_each` argument in the same block. ```hcl data "" "