From 6eac75fcb6e6803eb3a71dc36bf28d71936103f5 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 2 Oct 2023 12:39:56 -0400 Subject: [PATCH] add default labels to provider reference page (#9143) (#6421) Signed-off-by: Modular Magician Co-authored-by: Riley Karson --- .changelog/9143.txt | 3 ++ .../guides/provider_reference.html.markdown | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .changelog/9143.txt diff --git a/.changelog/9143.txt b/.changelog/9143.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/9143.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/website/docs/guides/provider_reference.html.markdown b/website/docs/guides/provider_reference.html.markdown index ae8f9a5ec2..d9b34636ad 100644 --- a/website/docs/guides/provider_reference.html.markdown +++ b/website/docs/guides/provider_reference.html.markdown @@ -240,6 +240,34 @@ following ordered by precedence. * GCLOUD_ZONE * CLOUDSDK_COMPUTE_ZONE +--- + +* `default_labels` (Optional) Labels that will be applied to all resources +with a top level `labels` field or a `labels` field nested inside a top level +`metadata` field. Setting the same key as a default label at the resource level +will override the default value for that label. These values will be recorded in +individual resource plans through the `terraform_labels` and `effective_labels` +fields. + +``` +provider "google" { + default_labels = { + my_global_key = "one" + my_default_key = "two" + } +} + +resource "google_compute_address" "my_address" { + name = "my-address" + + labels = { + my_key = "three" + # overrides provider-wide setting + my_default_key = "four" + } +} +``` + ## Advanced Settings Configuration * `request_timeout` - (Optional) A duration string controlling the amount of time