You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/terraform/v1.12.x/docs/language/block/check.mdx
+4-37Lines changed: 4 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ The arguments within a `data` block are provider-specific. Refer to the [registr
122
122
123
123
### `depends_on`
124
124
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.
126
126
127
127
```hcl
128
128
check "unique_name" {
@@ -135,13 +135,7 @@ check "unique_name" {
135
135
}
136
136
```
137
137
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.
145
139
146
140
### `provider`
147
141
@@ -158,16 +152,7 @@ check "unique_name" {
158
152
}
159
153
```
160
154
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`.
`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.
171
156
172
157
## Examples
173
158
@@ -210,22 +195,4 @@ check "service_validation" {
210
195
error_message = "Load balancer must have at least one security group"
211
196
}
212
197
}
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:
0 commit comments