diff --git a/mmv1/products/monitoring/MetricDescriptor.yaml b/mmv1/products/monitoring/MetricDescriptor.yaml index b3b8f2c2b431..c871f2fc72ab 100644 --- a/mmv1/products/monitoring/MetricDescriptor.yaml +++ b/mmv1/products/monitoring/MetricDescriptor.yaml @@ -74,6 +74,7 @@ properties: The set of labels that can be used to describe a specific instance of this metric type. In order to delete a label, the entire resource must be deleted, then created with the desired labels. + immutable: true is_set: true item_type: !ruby/object:Api::Type::NestedObject properties: diff --git a/mmv1/third_party/terraform/services/monitoring/resource_monitoring_metric_descriptor_test.go b/mmv1/third_party/terraform/services/monitoring/resource_monitoring_metric_descriptor_test.go index a34cc21f54db..53ad4f17478e 100644 --- a/mmv1/third_party/terraform/services/monitoring/resource_monitoring_metric_descriptor_test.go +++ b/mmv1/third_party/terraform/services/monitoring/resource_monitoring_metric_descriptor_test.go @@ -9,8 +9,6 @@ import ( ) func TestAccMonitoringMetricDescriptor_update(t *testing.T) { - // TODO: Fix requires a breaking change https://github.com/hashicorp/terraform-provider-google/issues/12139 - t.Skip() t.Parallel() acctest.VcrTest(t, resource.TestCase{ @@ -19,8 +17,7 @@ func TestAccMonitoringMetricDescriptor_update(t *testing.T) { CheckDestroy: testAccCheckMonitoringMetricDescriptorDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccMonitoringMetricDescriptor_update("key1", "STRING", - "description1", "30s", "30s"), + Config: testAccMonitoringMetricDescriptor_update("30s", "30s"), }, { ResourceName: "google_monitoring_metric_descriptor.basic", @@ -29,8 +26,7 @@ func TestAccMonitoringMetricDescriptor_update(t *testing.T) { ImportStateVerifyIgnore: []string{"metadata", "launch_stage"}, }, { - Config: testAccMonitoringMetricDescriptor_update("key2", "INT64", - "description2", "60s", "60s"), + Config: testAccMonitoringMetricDescriptor_update("60s", "60s"), }, { ResourceName: "google_monitoring_metric_descriptor.basic", @@ -42,8 +38,7 @@ func TestAccMonitoringMetricDescriptor_update(t *testing.T) { }) } -func testAccMonitoringMetricDescriptor_update(key, valueType, description, - samplePeriod, ingestDelay string) string { +func testAccMonitoringMetricDescriptor_update(samplePeriod, ingestDelay string) string { return fmt.Sprintf(` resource "google_monitoring_metric_descriptor" "basic" { description = "Daily sales records from all branch stores." @@ -53,9 +48,9 @@ resource "google_monitoring_metric_descriptor" "basic" { value_type = "DOUBLE" unit = "{USD}" labels { - key = "%s" - value_type = "%s" - description = "%s" + key = "key" + value_type = "STRING" + description = "description" } launch_stage = "BETA" metadata { @@ -63,6 +58,6 @@ resource "google_monitoring_metric_descriptor" "basic" { ingest_delay = "%s" } } -`, key, valueType, description, samplePeriod, ingestDelay, +`, samplePeriod, ingestDelay, ) }