Skip to content

Commit b8e53f2

Browse files
committed
Atru/create meta args reference topics (#1179)
This PR reverses the strategy applied in PR-530 and aggregates meta-arguments into their own reference section with separate pages for each argument.
2 parents c06f7a2 + ec61bed commit b8e53f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4042
-3345
lines changed

content/terraform-docs-common/redirects.jsonc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -427,22 +427,10 @@
427427
"destination": "/terraform/language/v:version/modules/configuration",
428428
"permanent": true
429429
},
430-
// Moving meta-arguments content to dedicated meta-arguments reference page
431-
{
432-
"source": "/terraform/language/meta-arguments/:slug",
433-
"destination": "/terraform/language/meta-arguments",
434-
"permanent": true
435-
},
436-
// meta-arguments content pre PR-530 (anything 1.11 and older)
430+
// add meta-arguments landing page for 1.11 and older
437431
{
438432
"source": "/terraform/language/v:version(1\\.(?:[1-9]|1[01])\\.x)/meta-arguments",
439-
"destination": "/terraform/language/v:version/meta-arguments/depends_on",
440-
"permanent": true
441-
},
442-
// meta-arguments content post PR-530 (anything 1.12 and above)
443-
{
444-
"source": "/terraform/language/v:version((?:1\\.(?:1[2-9]|[2-9]\\d)|[2-9]\\d*\\.\\d+)\\.x)/meta-arguments/:slug",
445-
"destination": "/terraform/language/v:version/meta-arguments",
433+
"destination": "/terraform/language/v:version/resources/syntax#meta-arguments",
446434
"permanent": true
447435
},
448436
// Reference rewrites phase 1 - latest

content/terraform/v1.12.x/data/language-nav-data.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,37 @@
328328
},
329329
{
330330
"title": "Meta-arguments",
331-
"path": "meta-arguments"
331+
"routes": [
332+
{
333+
"title": "Overview",
334+
"path": "meta-arguments",
335+
"alias": "actions"
336+
},
337+
{
338+
"title": "count",
339+
"path": "meta-arguments/count"
340+
},
341+
{
342+
"title": "depends_on",
343+
"path": "meta-arguments/depends_on"
344+
},
345+
{
346+
"title": "for_each",
347+
"path": "meta-arguments/for_each"
348+
},
349+
{
350+
"title": "lifecycle",
351+
"path": "meta-arguments/lifecycle"
352+
},
353+
{
354+
"title": "provider",
355+
"path": "meta-arguments/provider"
356+
},
357+
{
358+
"title": "providers",
359+
"path": "meta-arguments/providers"
360+
}
361+
]
332362
},
333363
{
334364
"title": "Built-in resources",

content/terraform/v1.12.x/docs/language/block/check.mdx

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The arguments within a `data` block are provider-specific. Refer to the [registr
122122

123123
### `depends_on`
124124

125-
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.
125+
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.
126126

127127
```hcl
128128
check "unique_name" {
@@ -135,13 +135,7 @@ check "unique_name" {
135135
}
136136
```
137137

138-
We recommend adding the `depends_on` argument if your nested data source depends on another resource without referencing that resource directly.
139-
140-
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.
141-
142-
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.
143-
144-
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.
138+
`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.
145139

146140
### `provider`
147141

@@ -158,16 +152,7 @@ check "unique_name" {
158152
}
159153
```
160154

161-
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.
162-
163-
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.
164-
165-
#### Summary
166-
167-
- Data type: Block.
168-
- Default: None.
169-
- Supported meta-arguments: `depends_on` and `provider`.
170-
- Example: [Resource dependency](#resource-dependency).
155+
`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.
171156

172157
## Examples
173158

@@ -210,22 +195,4 @@ check "service_validation" {
210195
error_message = "Load balancer must have at least one security group"
211196
}
212197
}
213-
```
214-
215-
### Resource dependency
216-
217-
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:
218-
219-
```hcl
220-
check "database_connection" {
221-
data "postgresql_database" "app_db" {
222-
name = "application"
223-
depends_on = [aws_db_instance.main]
224-
}
225-
226-
assert {
227-
condition = data.postgresql_database.app_db.allow_connections
228-
error_message = "Database is not accepting connections"
229-
}
230-
}
231-
```
198+
```

0 commit comments

Comments
 (0)