diff --git a/mmv1/api/resource.rb b/mmv1/api/resource.rb index cf4f9d45542b..9de32c1961d0 100644 --- a/mmv1/api/resource.rb +++ b/mmv1/api/resource.rb @@ -469,6 +469,7 @@ def add_labels_related_fields(props, parent) def add_labels_fields(props, parent, labels) # The effective_labels field is used to write to API, instead of the labels field. labels.ignore_write = true + labels.description = "#{labels.description}\n\n#{get_labels_field_note(labels.name)}" @custom_diff ||= [] if parent.nil? || parent.flatten_object @@ -542,6 +543,12 @@ def ignore_read_labels_fields(props) fields end + def get_labels_field_note(title) + "**Note**: This field is non-authoritative, and will only manage the #{title} present " \ +"in your configuration. +Please refer to the field `effective_#{title}` for all of the #{title} present on the resource." + end + # ==================== # Version-related methods # ==================== diff --git a/mmv1/api/type.rb b/mmv1/api/type.rb index 0d81c8335929..130cd2cec617 100644 --- a/mmv1/api/type.rb +++ b/mmv1/api/type.rb @@ -23,7 +23,7 @@ module Fields include Api::Object::Named::Properties attr_reader :default_value - attr_reader :description + attr_accessor :description attr_reader :exclude # Add a deprecation message for a field that's been deprecated in the API diff --git a/mmv1/products/bigquery/Dataset.yaml b/mmv1/products/bigquery/Dataset.yaml index 2fb36dfc2c06..41c0fbf1491d 100644 --- a/mmv1/products/bigquery/Dataset.yaml +++ b/mmv1/products/bigquery/Dataset.yaml @@ -294,10 +294,7 @@ properties: name: 'labels' description: | The labels associated with this dataset. You can use these to - organize and group your datasets - - **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. - Please refer to the field `effective_labels` for all of the labels present on the resource. + organize and group your datasets. - !ruby/object:Api::Type::Integer name: 'lastModifiedTime' description: | diff --git a/mmv1/products/compute/Address.yaml b/mmv1/products/compute/Address.yaml index ddf3a7f329ba..43ac9b0420a6 100644 --- a/mmv1/products/compute/Address.yaml +++ b/mmv1/products/compute/Address.yaml @@ -198,9 +198,6 @@ properties: name: 'labels' description: | Labels to apply to this address. A list of key->value pairs. - - **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. - Please refer to the field `effective_labels` for all of the labels present on the resource. update_verb: :POST update_url: 'projects/{{project}}/regions/{{region}}/addresses/{{name}}/setLabels' min_version: beta diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go index e7aa05f777d4..11c14014ace9 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go @@ -137,6 +137,49 @@ func TestAccBigQueryDataset_withProvider5(t *testing.T) { }) } +func TestAccBigQueryDataset_withOutOfBandLabels(t *testing.T) { + acctest.SkipIfVcr(t) + t.Parallel() + + datasetID := fmt.Sprintf("tf_test_%s", acctest.RandString(t, 10)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckBigQueryDatasetDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccBigQueryDataset(datasetID), + Check: addOutOfBandLabels(t, datasetID), + }, + { + ResourceName: "google_bigquery_dataset.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"delete_contents_on_destroy", "labels", "terraform_labels"}, + }, + { + Config: testAccBigQueryDatasetUpdated(datasetID), + }, + { + ResourceName: "google_bigquery_dataset.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"delete_contents_on_destroy", "labels", "terraform_labels"}, + }, + { + Config: testAccBigQueryDatasetUpdated_withOutOfBandLabels(datasetID), + }, + { + ResourceName: "google_bigquery_dataset.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"delete_contents_on_destroy", "labels", "terraform_labels"}, + }, + }, + }) +} + func TestAccBigQueryDataset_datasetWithContents(t *testing.T) { t.Parallel() @@ -302,6 +345,25 @@ func testAccAddTable(t *testing.T, datasetID string, tableID string) resource.Te } } +func addOutOfBandLabels(t *testing.T, datasetID string) resource.TestCheckFunc { + // Not actually a check, but adds labels independently of terraform + return func(s *terraform.State) error { + config := acctest.GoogleProviderConfig(t) + + dataset, err := config.NewBigQueryClient(config.UserAgent).Datasets.Get(config.Project, datasetID).Do() + if err != nil { + return fmt.Errorf("Could not get dataset with ID %s", datasetID) + } + + dataset.Labels["outband_key"] = "test" + _, err = config.NewBigQueryClient(config.UserAgent).Datasets.Patch(config.Project, datasetID, dataset).Do() + if err != nil { + return fmt.Errorf("Could not update labele for the dataset") + } + return nil + } +} + func testAccBigQueryDataset_withoutLabels(datasetID string) string { return fmt.Sprintf(` resource "google_bigquery_dataset" "test" { @@ -351,6 +413,25 @@ resource "google_bigquery_dataset" "test" { `, datasetID) } +func testAccBigQueryDatasetUpdated_withOutOfBandLabels(datasetID string) string { + return fmt.Sprintf(` +resource "google_bigquery_dataset" "test" { + dataset_id = "%s" + friendly_name = "bar" + description = "This is a bar description" + location = "EU" + default_partition_expiration_ms = 7200000 + default_table_expiration_ms = 7200000 + + labels = { + env = "bar" + default_table_expiration_ms = 7200000 + outband_key = "test-update" + } +} +`, datasetID) +} + func testAccBigQueryDatasetUpdated2(datasetID string) string { return fmt.Sprintf(` resource "google_bigquery_dataset" "test" { diff --git a/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template.go.erb index ee82da732187..bd0cdca09643 100644 --- a/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template.go.erb @@ -92,7 +92,10 @@ func datasourceComputeInstanceTemplateRead(d *schema.ResourceData, meta interfac func retrieveInstance(d *schema.ResourceData, meta interface{}, project, name string) error { d.SetId("projects/" + project + "/global/instanceTemplates/" + name) - return resourceComputeInstanceTemplateRead(d, meta) + if err := resourceComputeInstanceTemplateRead(d, meta); err != nil { + return err + } + return tpgresource.SetDataSourceLabels(d) } func retrieveInstanceFromUniqueId(d *schema.ResourceData, meta interface{}, project, self_link_unique string) error { @@ -100,7 +103,10 @@ func retrieveInstanceFromUniqueId(d *schema.ResourceData, meta interface{}, proj d.SetId(normalId) d.Set("self_link_unique", self_link_unique) - return resourceComputeInstanceTemplateRead(d, meta) + if err := resourceComputeInstanceTemplateRead(d, meta); err != nil { + return err + } + return tpgresource.SetDataSourceLabels(d) } // ByCreationTimestamp implements sort.Interface for []*InstanceTemplate based on diff --git a/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template_test.go b/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template_test.go index 9ed0dffc7f67..ef8e82a26180 100644 --- a/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template_test.go +++ b/mmv1/third_party/terraform/services/compute/data_source_google_compute_instance_template_test.go @@ -115,6 +115,9 @@ resource "google_compute_instance_template" "default" { network_interface { network = "default" } + labels = { + my-label = "my-label-value" + } } data "google_compute_instance_template" "default" { diff --git a/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template.go.erb index 6ebe245ba3ae..e69a2857ff38 100644 --- a/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template.go.erb @@ -124,5 +124,8 @@ func datasourceComputeRegionInstanceTemplateRead(d *schema.ResourceData, meta in func retrieveInstances(d *schema.ResourceData, meta interface{}, project, region, name string) error { d.SetId("projects/" + project + "/regions/" + region + "/instanceTemplates/" + name) - return resourceComputeRegionInstanceTemplateRead(d, meta) + if err := resourceComputeRegionInstanceTemplateRead(d, meta); err != nil { + return err + } + return tpgresource.SetDataSourceLabels(d) } diff --git a/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template_test.go.erb b/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template_test.go.erb index 6c32fddcb0d6..73a4d1fa09f0 100644 --- a/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/data_source_google_compute_region_instance_template_test.go.erb @@ -91,6 +91,9 @@ resource "google_compute_region_instance_template" "default" { network_interface { network = "default" } + labels = { + my-label = "my-label-value" + } } data "google_compute_region_instance_template" "default" { project = "%{project}" diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb index 277825a3428b..d20b70d5b532 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb @@ -66,6 +66,7 @@ func ResourceComputeInstanceTemplate() *schema.Resource { resourceComputeInstanceTemplateSourceImageCustomizeDiff, resourceComputeInstanceTemplateScratchDiskCustomizeDiff, resourceComputeInstanceTemplateBootDiskCustomizeDiff, + tpgresource.SetLabelsDiff, ), MigrateState: resourceComputeInstanceTemplateMigrateState, @@ -927,9 +928,19 @@ be from 0 to 999,999,999 inclusive.`, Please refer to the field 'effective_labels' for all of the labels present on the resource.`, }, + "terraform_labels": { + Type: schema.TypeMap, + Computed: true, + Set: schema.HashString, + Description: `The combination of labels configured directly on the resource and default labels configured on the provider.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "effective_labels": { Type: schema.TypeMap, Computed: true, + ForceNew: true, + Set: schema.HashString, Description: `All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.`, Elem: &schema.Schema{Type: schema.TypeString}, }, @@ -1320,8 +1331,8 @@ func resourceComputeInstanceTemplateCreate(d *schema.ResourceData, meta interfac ReservationAffinity: reservationAffinity, } - if _, ok := d.GetOk("labels"); ok { - instanceProperties.Labels = tpgresource.ExpandLabels(d) + if _, ok := d.GetOk("effective_labels"); ok { + instanceProperties.Labels = tpgresource.ExpandEffectiveLabels(d) } var itName string @@ -1649,6 +1660,9 @@ func resourceComputeInstanceTemplateRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("Error setting labels: %s", err) } } + if err := tpgresource.SetLabels(instanceTemplate.Properties.Labels, d, "terraform_labels"); err != nil { + return fmt.Errorf("Error setting terraform_labels: %s", err) + } if err := d.Set("effective_labels", instanceTemplate.Properties.Labels); err != nil { return fmt.Errorf("Error setting effective_labels: %s", err) } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb index eabe9c303cb4..d5e7c5470303 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb @@ -51,7 +51,7 @@ func TestAccComputeInstanceTemplate_basic(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -78,7 +78,7 @@ func TestAccComputeInstanceTemplate_imageShorthand(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -135,7 +135,7 @@ func TestAccComputeInstanceTemplate_maintenance_interval(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, { Config: testAccComputeInstanceTemplate_basic(acctest.RandString(t, 10)), @@ -612,7 +612,7 @@ func TestAccComputeInstanceTemplate_EncryptKMS(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -944,7 +944,7 @@ func TestAccComputeInstanceTemplate_diskResourcePolicies(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -1022,7 +1022,7 @@ func TestAccComputeInstanceTemplate_managedEnvoy(t *testing.T) { ResourceName: "google_compute_instance_template.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"labels"}, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb index ada53db8730c..e2a2182a2e6f 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb @@ -39,6 +39,7 @@ func ResourceComputeRegionInstanceTemplate() *schema.Resource { resourceComputeInstanceTemplateSourceImageCustomizeDiff, resourceComputeInstanceTemplateScratchDiskCustomizeDiff, resourceComputeInstanceTemplateBootDiskCustomizeDiff, + tpgresource.SetLabelsDiff, ), Timeouts: &schema.ResourceTimeout{ @@ -877,7 +878,27 @@ be from 0 to 999,999,999 inclusive.`, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, - Description: `A set of key/value label pairs to assign to instances created from this template,`, + Description: `A set of key/value label pairs to assign to instances created from this template, + + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource.`, + }, + + "terraform_labels": { + Type: schema.TypeMap, + Computed: true, + Set: schema.HashString, + Description: `The combination of labels configured directly on the resource and default labels configured on the provider.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "effective_labels": { + Type: schema.TypeMap, + Computed: true, + ForceNew: true, + Set: schema.HashString, + Description: `All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.`, + Elem: &schema.Schema{Type: schema.TypeString}, }, "resource_policies": { @@ -1010,8 +1031,8 @@ func resourceComputeRegionInstanceTemplateCreate(d *schema.ResourceData, meta in ReservationAffinity: reservationAffinity, } - if _, ok := d.GetOk("labels"); ok { - instanceProperties.Labels = tpgresource.ExpandLabels(d) + if _, ok := d.GetOk("effective_labels"); ok { + instanceProperties.Labels = tpgresource.ExpandEffectiveLabels(d) } var itName string @@ -1137,10 +1158,16 @@ func resourceComputeRegionInstanceTemplateRead(d *schema.ResourceData, meta inte } } if instanceProperties.Labels != nil { - if err := d.Set("labels", instanceProperties.Labels); err != nil { + if err := tpgresource.SetLabels(instanceProperties.Labels, d, "labels"); err != nil { return fmt.Errorf("Error setting labels: %s", err) } } + if err := tpgresource.SetLabels(instanceProperties.Labels, d, "terraform_labels"); err != nil { + return fmt.Errorf("Error setting terraform_labels: %s", err) + } + if err := d.Set("effective_labels", instanceProperties.Labels); err != nil { + return fmt.Errorf("Error setting effective_labels: %s", err) + } if err = d.Set("self_link", instanceTemplate["selfLink"]); err != nil { return fmt.Errorf("Error setting self_link: %s", err) } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb index f53fdba3c3c6..bef9e29f4526 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb @@ -50,6 +50,7 @@ func TestAccComputeRegionInstanceTemplate_basic(t *testing.T) { ResourceName: "google_compute_region_instance_template.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -76,6 +77,7 @@ func TestAccComputeRegionInstanceTemplate_imageShorthand(t *testing.T) { ResourceName: "google_compute_region_instance_template.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -767,6 +769,7 @@ func TestAccComputeRegionInstanceTemplate_maintenance_interval(t *testing.T) { ResourceName: "google_compute_region_instance_template.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, { Config: testAccComputeRegionInstanceTemplate_basic(acctest.RandString(t, 10)), @@ -894,6 +897,7 @@ func TestAccComputeRegionInstanceTemplate_diskResourcePolicies(t *testing.T) { ResourceName: "google_compute_region_instance_template.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) @@ -971,6 +975,7 @@ func TestAccComputeRegionInstanceTemplate_managedEnvoy(t *testing.T) { ResourceName: "google_compute_region_instance_template.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, }, }, }) diff --git a/mmv1/third_party/terraform/tpgresource/annotations.go b/mmv1/third_party/terraform/tpgresource/annotations.go index 3739a0cea62b..410fbd2355d4 100644 --- a/mmv1/third_party/terraform/tpgresource/annotations.go +++ b/mmv1/third_party/terraform/tpgresource/annotations.go @@ -13,6 +13,10 @@ func SetAnnotationsDiff(_ context.Context, d *schema.ResourceDiff, meta interfac return nil } + if d.Get("effective_annotations") == nil { + return fmt.Errorf("`effective_annotations` field is not present in the resource schema.") + } + o, n := d.GetChange("annotations") effectiveAnnotations := d.Get("effective_annotations").(map[string]interface{}) @@ -44,6 +48,10 @@ func SetMetadataAnnotationsDiff(_ context.Context, d *schema.ResourceDiff, meta return nil } + if d.Get("metadata.0.effective_annotations") == nil { + return fmt.Errorf("`metadata.0.effective_annotations` field is not present in the resource schema.") + } + o, n := d.GetChange("metadata.0.annotations") effectiveAnnotations := d.Get("metadata.0.effective_annotations").(map[string]interface{}) diff --git a/mmv1/third_party/terraform/tpgresource/labels.go b/mmv1/third_party/terraform/tpgresource/labels.go index 7b80869a972a..78436b7968fa 100644 --- a/mmv1/third_party/terraform/tpgresource/labels.go +++ b/mmv1/third_party/terraform/tpgresource/labels.go @@ -18,7 +18,7 @@ func SetLabels(labels map[string]string, d *schema.ResourceData, lineage string) if v, ok := d.GetOk(lineage); ok { if labels != nil { - for k, _ := range v.(map[string]interface{}) { + for k := range v.(map[string]interface{}) { transformed[k] = labels[k] } } @@ -54,6 +54,19 @@ func SetDataSourceLabels(d *schema.ResourceData) error { } func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { + raw := d.Get("labels") + if raw == nil { + return nil + } + + if d.Get("terraform_labels") == nil { + return fmt.Errorf("`terraform_labels` field is not present in the resource schema.") + } + + if d.Get("effective_labels") == nil { + return fmt.Errorf("`effective_labels` field is not present in the resource schema.") + } + config := meta.(*transport_tpg.Config) // Merge provider default labels with the user defined labels in the resource to get terraform managed labels @@ -62,11 +75,6 @@ func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) terraformLabels[k] = v } - raw := d.Get("labels") - if raw == nil { - return nil - } - labels := raw.(map[string]interface{}) for k, v := range labels { terraformLabels[k] = v.(string) @@ -107,6 +115,14 @@ func SetMetadataLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta inter return nil } + if d.Get("metadata.0.terraform_labels") == nil { + return fmt.Errorf("`metadata.0.terraform_labels` field is not present in the resource schema.") + } + + if d.Get("metadata.0.effective_labels") == nil { + return fmt.Errorf("`metadata.0.effective_labels` field is not present in the resource schema.") + } + config := meta.(*transport_tpg.Config) // Merge provider default labels with the user defined labels in the resource to get terraform managed labels diff --git a/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown b/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown index 78d4668a668c..929a8e8f2c70 100644 --- a/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/bigquery_table.html.markdown @@ -114,6 +114,9 @@ The following arguments are supported: * `labels` - (Optional) A mapping of labels to assign to the resource. + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + * `terraform_labels` - The combination of labels configured directly on the resource and default labels configured on the provider. diff --git a/mmv1/third_party/terraform/website/docs/r/bigtable_instance.html.markdown b/mmv1/third_party/terraform/website/docs/r/bigtable_instance.html.markdown index 0a9b88877615..9f64f4873d6d 100644 --- a/mmv1/third_party/terraform/website/docs/r/bigtable_instance.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/bigtable_instance.html.markdown @@ -102,6 +102,9 @@ in Terraform state, a `terraform destroy` or `terraform apply` that would delete * `labels` - (Optional) A set of key/value label pairs to assign to the resource. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements. + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + * `terraform_labels` - The combination of labels configured directly on the resource and default labels configured on the provider. diff --git a/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown index b6c5fe8b88d1..a1c450d39ccf 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown @@ -308,8 +308,11 @@ The following arguments are supported: * `labels` - (Optional) A set of key/value label pairs to assign to instances created from this template. - **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. - Please refer to the field 'effective_labels' for all of the labels present on the resource. + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + +* `terraform_labels` - + The combination of labels configured directly on the resource and default labels configured on the provider. * `effective_labels` - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. diff --git a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown index 4e1c3a29838f..5364b3197115 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown @@ -320,6 +320,15 @@ The following arguments are supported: * `labels` - (Optional) A set of key/value label pairs to assign to instances created from this template. + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + +* `terraform_labels` - + The combination of labels configured directly on the resource and default labels configured on the provider. + +* `effective_labels` - + All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. + * `metadata` - (Optional) Metadata key/value pairs to make available from within instances created from this template.