Skip to content

Commit 65a11d7

Browse files
Revert "Support for Tags in google_dataproc_metastore_service resource" (#13854)
[upstream:0c7c724f926d235bdf49d989a2b1adf3f632ddc6] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent f9f36b9 commit 65a11d7

6 files changed

+18
-104
lines changed

.changelog/13854.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
metastore: remove non-functioning `tags` field from `google_dataproc_metastore_service`. It was introduced in v6.31.0 but the feature was not yet GA.
3+
```

google/services/dataprocmetastore/resource_dataproc_metastore_service.go

-26
Original file line numberDiff line numberDiff line change
@@ -416,15 +416,6 @@ There must be at least one IP address available in the subnet's primary range. T
416416
},
417417
},
418418
},
419-
"tags": {
420-
Type: schema.TypeMap,
421-
Optional: true,
422-
ForceNew: true,
423-
Description: `A map of resource manager tags.
424-
Resource manager tag keys and values have the same definition as resource manager tags.
425-
Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}.`,
426-
Elem: &schema.Schema{Type: schema.TypeString},
427-
},
428419
"telemetry_config": {
429420
Type: schema.TypeList,
430421
Computed: true,
@@ -607,12 +598,6 @@ func resourceDataprocMetastoreServiceCreate(d *schema.ResourceData, meta interfa
607598
} else if v, ok := d.GetOkExists("telemetry_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(telemetryConfigProp)) && (ok || !reflect.DeepEqual(v, telemetryConfigProp)) {
608599
obj["telemetryConfig"] = telemetryConfigProp
609600
}
610-
tagsProp, err := expandDataprocMetastoreServiceTags(d.Get("tags"), d, config)
611-
if err != nil {
612-
return err
613-
} else if v, ok := d.GetOkExists("tags"); !tpgresource.IsEmptyValue(reflect.ValueOf(tagsProp)) && (ok || !reflect.DeepEqual(v, tagsProp)) {
614-
obj["tags"] = tagsProp
615-
}
616601
labelsProp, err := expandDataprocMetastoreServiceEffectiveLabels(d.Get("effective_labels"), d, config)
617602
if err != nil {
618603
return err
@@ -2052,17 +2037,6 @@ func expandDataprocMetastoreServiceTelemetryConfigLogFormat(v interface{}, d tpg
20522037
return v, nil
20532038
}
20542039

2055-
func expandDataprocMetastoreServiceTags(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]string, error) {
2056-
if v == nil {
2057-
return map[string]string{}, nil
2058-
}
2059-
m := make(map[string]string)
2060-
for k, val := range v.(map[string]interface{}) {
2061-
m[k] = val.(string)
2062-
}
2063-
return m, nil
2064-
}
2065-
20662040
func expandDataprocMetastoreServiceEffectiveLabels(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]string, error) {
20672041
if v == nil {
20682042
return map[string]string{}, nil

google/services/dataprocmetastore/resource_dataproc_metastore_service_generated_meta.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ fields:
4747
provider_only: true
4848
- field: 'state'
4949
- field: 'state_message'
50-
- field: 'tags'
5150
- field: 'telemetry_config.log_format'
5251
- field: 'terraform_labels'
5352
provider_only: true

google/services/dataprocmetastore/resource_dataproc_metastore_service_generated_test.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceBasicExample(t *tes
4949
ResourceName: "google_dataproc_metastore_service.default",
5050
ImportState: true,
5151
ImportStateVerify: true,
52-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
52+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
5353
},
5454
},
5555
})
@@ -99,7 +99,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceDeletionProtectionE
9999
ResourceName: "google_dataproc_metastore_service.default",
100100
ImportState: true,
101101
ImportStateVerify: true,
102-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
102+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
103103
},
104104
},
105105
})
@@ -150,7 +150,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceCmekTestExample(t *
150150
ResourceName: "google_dataproc_metastore_service.default",
151151
ImportState: true,
152152
ImportStateVerify: true,
153-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
153+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
154154
},
155155
},
156156
})
@@ -216,7 +216,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceEndpointExample(t *
216216
ResourceName: "google_dataproc_metastore_service.endpoint",
217217
ImportState: true,
218218
ImportStateVerify: true,
219-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
219+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
220220
},
221221
},
222222
})
@@ -256,7 +256,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAuxExample(t *testi
256256
ResourceName: "google_dataproc_metastore_service.aux",
257257
ImportState: true,
258258
ImportStateVerify: true,
259-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
259+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
260260
},
261261
},
262262
})
@@ -299,7 +299,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceMetadataExample(t *
299299
ResourceName: "google_dataproc_metastore_service.metadata",
300300
ImportState: true,
301301
ImportStateVerify: true,
302-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
302+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
303303
},
304304
},
305305
})
@@ -344,7 +344,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceTelemetryExample(t
344344
ResourceName: "google_dataproc_metastore_service.telemetry",
345345
ImportState: true,
346346
ImportStateVerify: true,
347-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
347+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
348348
},
349349
},
350350
})
@@ -388,7 +388,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2Example(t *tes
388388
ResourceName: "google_dataproc_metastore_service.dpms2",
389389
ImportState: true,
390390
ImportStateVerify: true,
391-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
391+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
392392
},
393393
},
394394
})
@@ -434,7 +434,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorE
434434
ResourceName: "google_dataproc_metastore_service.dpms2_scaling_factor",
435435
ImportState: true,
436436
ImportStateVerify: true,
437-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
437+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
438438
},
439439
},
440440
})
@@ -480,7 +480,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceDpms2ScalingFactorL
480480
ResourceName: "google_dataproc_metastore_service.dpms2_scaling_factor_lt1",
481481
ImportState: true,
482482
ImportStateVerify: true,
483-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
483+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
484484
},
485485
},
486486
})
@@ -526,7 +526,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceScheduledBackupExam
526526
ResourceName: "google_dataproc_metastore_service.backup",
527527
ImportState: true,
528528
ImportStateVerify: true,
529-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
529+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
530530
},
531531
},
532532
})
@@ -587,7 +587,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMaxScali
587587
ResourceName: "google_dataproc_metastore_service.test_resource",
588588
ImportState: true,
589589
ImportStateVerify: true,
590-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
590+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
591591
},
592592
},
593593
})
@@ -638,7 +638,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinAndMa
638638
ResourceName: "google_dataproc_metastore_service.test_resource",
639639
ImportState: true,
640640
ImportStateVerify: true,
641-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
641+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
642642
},
643643
},
644644
})
@@ -690,7 +690,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingMinScali
690690
ResourceName: "google_dataproc_metastore_service.test_resource",
691691
ImportState: true,
692692
ImportStateVerify: true,
693-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
693+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
694694
},
695695
},
696696
})
@@ -741,7 +741,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAutoscalingNoLimitC
741741
ResourceName: "google_dataproc_metastore_service.test_resource",
742742
ImportState: true,
743743
ImportStateVerify: true,
744-
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "tags", "terraform_labels"},
744+
ImportStateVerifyIgnore: []string{"labels", "location", "service_id", "terraform_labels"},
745745
},
746746
},
747747
})

google/services/dataprocmetastore/resource_dataproc_metastore_service_test.go

-56
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package dataprocmetastore_test
55
import (
66
"fmt"
77
"github.com/hashicorp/terraform-provider-google/google/acctest"
8-
"github.com/hashicorp/terraform-provider-google/google/envvar"
98
"testing"
109

1110
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -170,58 +169,3 @@ resource "google_storage_bucket" "bucket" {
170169
}
171170
`, context)
172171
}
173-
174-
func TestAccMetastoreService_tags(t *testing.T) {
175-
t.Parallel()
176-
tagKey := acctest.BootstrapSharedTestTagKey(t, "metastore-service-tagkey")
177-
context := map[string]interface{}{
178-
"random_suffix": acctest.RandString(t, 10),
179-
"org": envvar.GetTestOrgFromEnv(t),
180-
"tagKey": tagKey,
181-
"tagValue": acctest.BootstrapSharedTestTagValue(t, "metastore-service-tagvalue", tagKey),
182-
}
183-
184-
acctest.VcrTest(t, resource.TestCase{
185-
PreCheck: func() { acctest.AccTestPreCheck(t) },
186-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
187-
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
188-
Steps: []resource.TestStep{
189-
{
190-
Config: testAccMetastoreServiceTags(context),
191-
},
192-
{
193-
ResourceName: "google_dataproc_metastore_service.default",
194-
ImportState: true,
195-
ImportStateVerify: true,
196-
ImportStateVerifyIgnore: []string{"service_id", "location", "labels", "terraform_labels", "tags"},
197-
},
198-
},
199-
})
200-
}
201-
202-
func testAccMetastoreServiceTags(context map[string]interface{}) string {
203-
return acctest.Nprintf(`
204-
resource "google_dataproc_metastore_service" "default" {
205-
service_id = "tf-test-my-service-%{random_suffix}"
206-
location = "us-central1"
207-
port = 9080
208-
tier = "DEVELOPER"
209-
210-
maintenance_window {
211-
hour_of_day = 2
212-
day_of_week = "SUNDAY"
213-
}
214-
215-
hive_metastore_config {
216-
version = "2.3.6"
217-
}
218-
219-
labels = {
220-
env = "test"
221-
}
222-
tags = {
223-
"%{org}/%{tagKey}" = "%{tagValue}"
224-
}
225-
}
226-
`, context)
227-
}

website/docs/r/dataproc_metastore_service.html.markdown

-6
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,6 @@ The following arguments are supported:
499499
The configuration specifying telemetry settings for the Dataproc Metastore service. If unspecified defaults to JSON.
500500
Structure is [documented below](#nested_telemetry_config).
501501

502-
* `tags` -
503-
(Optional)
504-
A map of resource manager tags.
505-
Resource manager tag keys and values have the same definition as resource manager tags.
506-
Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/{tag_value_id}.
507-
508502
* `location` -
509503
(Optional)
510504
The location where the metastore service should reside.

0 commit comments

Comments
 (0)