Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
22a1f70
gathered depends_on content into d_o ref page
trujillo-adam Oct 23, 2025
8ca88ba
draft of depends_on
trujillo-adam Oct 24, 2025
6c39935
revert accidental draft of resources overview
trujillo-adam Oct 24, 2025
c65c4ca
Merge branch 'main' into atru/create-meta-args-reference-topics
trujillo-adam Oct 24, 2025
2f26e85
draft of count, updates to depends_on
trujillo-adam Oct 24, 2025
eb253b1
draft of for_each
trujillo-adam Oct 24, 2025
1a691d5
reorder subtopics on coutn and f_e
trujillo-adam Oct 25, 2025
8091319
draft of provider m-a
trujillo-adam Oct 27, 2025
8f914ae
draft of providers m-a ref
trujillo-adam Oct 27, 2025
17911f6
lifecycle m-a ref draft
trujillo-adam Oct 27, 2025
8b8b8b7
Merge branch 'main' into atru/create-meta-args-reference-topics
trujillo-adam Oct 27, 2025
3f56933
Apply suggestions from code review
trujillo-adam Oct 27, 2025
c78924a
update examples and other tweaks
trujillo-adam Oct 27, 2025
a8193f3
Apply suggestions from code review
trujillo-adam Oct 29, 2025
64c72fc
Merge branch 'main' into atru/create-meta-args-reference-topics
trujillo-adam Oct 29, 2025
6bf58ef
Update content/terraform/v1.13.x/docs/language/meta-arguments/index.mdx
trujillo-adam Oct 29, 2025
2e18a17
Update content/terraform/v1.13.x/docs/language/meta-arguments/lifecyc…
trujillo-adam Oct 29, 2025
1a84bdc
Apply suggestions from code review
trujillo-adam Oct 29, 2025
7148218
Apply suggestions from code review
trujillo-adam Oct 30, 2025
c461d46
Merge branch 'main' into atru/create-meta-args-reference-topics
trujillo-adam Oct 30, 2025
c940b65
backport meta-args topics to 1.12
trujillo-adam Oct 30, 2025
7a29850
forport meta-args topics to 1.14 core - TODO stacks
trujillo-adam Oct 30, 2025
da1b955
link stacks references to m-a refs
trujillo-adam Oct 30, 2025
b371e46
fix merge conflicts
trujillo-adam Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions content/terraform-docs-common/redirects.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,7 @@
"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)
{
"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",
"permanent": true
},
// temporarily cut redirs to test
// Reference rewrites phase 1 - latest
{
"source": "/terraform/language/providers/configuration",
Expand Down
32 changes: 31 additions & 1 deletion content/terraform/v1.12.x/data/language-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
41 changes: 4 additions & 37 deletions content/terraform/v1.12.x/docs/language/block/check.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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`

Expand All @@ -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

Expand Down Expand Up @@ -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"
}
}
```
```
Loading
Loading