Skip to content

Commit d4a3e24

Browse files
dataproc_metastore_service - promote args to GA (#9619) (#6767)
* promote to GA * psc routes test * lint [upstream:16442bfe269f04a114487f48101598ab320f3e33] Signed-off-by: Modular Magician <[email protected]>
1 parent acaff92 commit d4a3e24

File tree

4 files changed

+73
-7
lines changed

4 files changed

+73
-7
lines changed

.changelog/9619.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:enhancement
2+
metastore: added `endpoint_protocol`, `metadata_integration`, and `auxiliary_versions` to google_dataproc_metastore_service (GA only)
3+
```
4+
```release-note:enhancement
5+
metastore: added `consumers.custom_routes_enabled` to google_dataproc_metastore_service (beta only)
6+
```

google-beta/services/dataprocmetastore/resource_dataproc_metastore_service.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ There must be at least one IP address available in the subnet's primary range. T
293293
},
294294
},
295295
},
296+
"custom_routes_enabled": {
297+
Type: schema.TypeBool,
298+
Optional: true,
299+
Description: `Enables custom routes to be imported and exported for the Dataproc Metastore service's peered VPC network.`,
300+
},
296301
},
297302
},
298303
},
@@ -1136,6 +1141,8 @@ func flattenDataprocMetastoreServiceNetworkConfig(v interface{}, d *schema.Resou
11361141
transformed := make(map[string]interface{})
11371142
transformed["consumers"] =
11381143
flattenDataprocMetastoreServiceNetworkConfigConsumers(original["consumers"], d, config)
1144+
transformed["custom_routes_enabled"] =
1145+
flattenDataprocMetastoreServiceNetworkConfigCustomRoutesEnabled(original["customRoutesEnabled"], d, config)
11391146
return []interface{}{transformed}
11401147
}
11411148
func flattenDataprocMetastoreServiceNetworkConfigConsumers(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
@@ -1165,6 +1172,10 @@ func flattenDataprocMetastoreServiceNetworkConfigConsumersSubnetwork(v interface
11651172
return v
11661173
}
11671174

1175+
func flattenDataprocMetastoreServiceNetworkConfigCustomRoutesEnabled(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1176+
return v
1177+
}
1178+
11681179
func flattenDataprocMetastoreServiceDatabaseType(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
11691180
return v
11701181
}
@@ -1539,6 +1550,13 @@ func expandDataprocMetastoreServiceNetworkConfig(v interface{}, d tpgresource.Te
15391550
transformed["consumers"] = transformedConsumers
15401551
}
15411552

1553+
transformedCustomRoutesEnabled, err := expandDataprocMetastoreServiceNetworkConfigCustomRoutesEnabled(original["custom_routes_enabled"], d, config)
1554+
if err != nil {
1555+
return nil, err
1556+
} else if val := reflect.ValueOf(transformedCustomRoutesEnabled); val.IsValid() && !tpgresource.IsEmptyValue(val) {
1557+
transformed["customRoutesEnabled"] = transformedCustomRoutesEnabled
1558+
}
1559+
15421560
return transformed, nil
15431561
}
15441562

@@ -1579,6 +1597,10 @@ func expandDataprocMetastoreServiceNetworkConfigConsumersSubnetwork(v interface{
15791597
return v, nil
15801598
}
15811599

1600+
func expandDataprocMetastoreServiceNetworkConfigCustomRoutesEnabled(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1601+
return v, nil
1602+
}
1603+
15821604
func expandDataprocMetastoreServiceDatabaseType(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
15831605
return v, nil
15841606
}

google-beta/services/dataprocmetastore/resource_dataproc_metastore_service_generated_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAuxExample(t *testi
167167

168168
acctest.VcrTest(t, resource.TestCase{
169169
PreCheck: func() { acctest.AccTestPreCheck(t) },
170-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
170+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
171171
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
172172
Steps: []resource.TestStep{
173173
{
@@ -186,7 +186,6 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceAuxExample(t *testi
186186
func testAccDataprocMetastoreService_dataprocMetastoreServiceAuxExample(context map[string]interface{}) string {
187187
return acctest.Nprintf(`
188188
resource "google_dataproc_metastore_service" "aux" {
189-
provider = google-beta
190189
service_id = "tf-test-metastore-aux%{random_suffix}"
191190
location = "us-central1"
192191
tier = "DEVELOPER"
@@ -211,7 +210,7 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceMetadataExample(t *
211210

212211
acctest.VcrTest(t, resource.TestCase{
213212
PreCheck: func() { acctest.AccTestPreCheck(t) },
214-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
213+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
215214
CheckDestroy: testAccCheckDataprocMetastoreServiceDestroyProducer(t),
216215
Steps: []resource.TestStep{
217216
{
@@ -230,7 +229,6 @@ func TestAccDataprocMetastoreService_dataprocMetastoreServiceMetadataExample(t *
230229
func testAccDataprocMetastoreService_dataprocMetastoreServiceMetadataExample(context map[string]interface{}) string {
231230
return acctest.Nprintf(`
232231
resource "google_dataproc_metastore_service" "metadata" {
233-
provider = google-beta
234232
service_id = "tf-test-metastore-metadata%{random_suffix}"
235233
location = "us-central1"
236234
tier = "DEVELOPER"

website/docs/r/dataproc_metastore_service.html.markdown

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,42 @@ resource "google_dataproc_metastore_service" "default" {
120120
}
121121
}
122122
```
123+
## Example Usage - Dataproc Metastore Service Private Service Connect Custom Routes
124+
125+
126+
```hcl
127+
resource "google_compute_network" "net" {
128+
provider = google-beta
129+
name = "my-network"
130+
auto_create_subnetworks = false
131+
}
132+
133+
resource "google_compute_subnetwork" "subnet" {
134+
provider = google-beta
135+
name = "my-subnetwork"
136+
region = "us-central1"
137+
network = google_compute_network.net.id
138+
ip_cidr_range = "10.0.0.0/22"
139+
private_ip_google_access = true
140+
}
141+
142+
resource "google_dataproc_metastore_service" "default" {
143+
provider = google-beta
144+
service_id = "metastore-srv"
145+
location = "us-central1"
146+
147+
hive_metastore_config {
148+
version = "3.1.2"
149+
}
150+
151+
network_config {
152+
consumers {
153+
subnetwork = google_compute_subnetwork.subnet.id
154+
}
155+
custom_routes_enabled = true
156+
}
157+
}
158+
```
123159
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
124160
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=dataproc_metastore_service_dpms2&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
125161
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
@@ -249,7 +285,7 @@ The following arguments are supported:
249285
Possible values are: `CANARY`, `STABLE`.
250286

251287
* `metadata_integration` -
252-
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
288+
(Optional)
253289
The setting that defines how metastore metadata should be integrated with external services and systems.
254290
Structure is [documented below](#nested_metadata_integration).
255291

@@ -299,7 +335,7 @@ The following arguments are supported:
299335
<a name="nested_hive_metastore_config"></a>The `hive_metastore_config` block supports:
300336

301337
* `endpoint_protocol` -
302-
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
338+
(Optional)
303339
The protocol to use for the metastore service endpoint. If unspecified, defaults to `THRIFT`.
304340
Default value is `THRIFT`.
305341
Possible values are: `THRIFT`, `GRPC`.
@@ -319,7 +355,7 @@ The following arguments are supported:
319355
Structure is [documented below](#nested_kerberos_config).
320356

321357
* `auxiliary_versions` -
322-
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
358+
(Optional)
323359
A mapping of Hive metastore version to the auxiliary version configuration.
324360
When specified, a secondary Hive metastore service is created along with the primary service.
325361
All auxiliary versions must be less than the service's primary version.
@@ -371,6 +407,10 @@ The following arguments are supported:
371407
The consumer-side network configuration for the Dataproc Metastore instance.
372408
Structure is [documented below](#nested_consumers).
373409

410+
* `custom_routes_enabled` -
411+
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
412+
Enables custom routes to be imported and exported for the Dataproc Metastore service's peered VPC network.
413+
374414

375415
<a name="nested_consumers"></a>The `consumers` block supports:
376416

0 commit comments

Comments
 (0)