Skip to content

Commit 202d42b

Browse files
modular-magicianrileykarson
authored andcommitted
add default labels to provider reference page (#9143) (#6421)
Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Riley Karson <[email protected]>
1 parent caf28b3 commit 202d42b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.changelog/9143.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

website/docs/guides/provider_reference.html.markdown

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,34 @@ following ordered by precedence.
240240
* GCLOUD_ZONE
241241
* CLOUDSDK_COMPUTE_ZONE
242242

243+
---
244+
245+
* `default_labels` (Optional) Labels that will be applied to all resources
246+
with a top level `labels` field or a `labels` field nested inside a top level
247+
`metadata` field. Setting the same key as a default label at the resource level
248+
will override the default value for that label. These values will be recorded in
249+
individual resource plans through the `terraform_labels` and `effective_labels`
250+
fields.
251+
252+
```
253+
provider "google" {
254+
default_labels = {
255+
my_global_key = "one"
256+
my_default_key = "two"
257+
}
258+
}
259+
260+
resource "google_compute_address" "my_address" {
261+
name = "my-address"
262+
263+
labels = {
264+
my_key = "three"
265+
# overrides provider-wide setting
266+
my_default_key = "four"
267+
}
268+
}
269+
```
270+
243271
## Advanced Settings Configuration
244272

245273
* `request_timeout` - (Optional) A duration string controlling the amount of time

0 commit comments

Comments
 (0)