Skip to content

Commit d3657d8

Browse files
committed
Add Dataproc Metastore Database Resource for IAM support
Fixes hashicorp/terraform-provider-google#21822
1 parent 9156ea5 commit d3657d8

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

mmv1/products/metastore/Database.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright 2025 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
---
14+
name: 'Database'
15+
description: |
16+
Only used to generate IAM resources
17+
# This resource is only used to generate IAM resources. They do not correspond to real
18+
# GCP resources, and should not be used to generate anything other than IAM support.
19+
docs:
20+
base_url: 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
21+
self_link: 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
22+
exclude_resource: true
23+
timeouts:
24+
insert_minutes: 2
25+
update_minutes: 2
26+
delete_minutes: 2
27+
iam_policy:
28+
method_name_separator: ':'
29+
parent_resource_attribute: 'database'
30+
parent_resource_type: "google_dataproc_metastore_service"
31+
example_config_body: "templates/terraform/iam/example_config_body/dataproc_metastore_database_template.tf.tmpl"
32+
import_format:
33+
- '{{name}}'
34+
- 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
35+
custom_code:
36+
examples:
37+
- name: 'dataproc_metastore_service_basic'
38+
primary_resource_id: 'service'
39+
primary_resource_name: 'fmt.Sprintf("tf-test-metastore-srv%s", context["random_suffix"])'
40+
test_vars_overrides:
41+
database: '"default"'
42+
service_resource: '"service"'
43+
vars:
44+
metastore_service_name: 'service-id'
45+
parameters:
46+
properties:
47+
- name: 'name'
48+
type: String
49+
description: Dummy property.
50+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
2+
service_id = "{{index $.Vars "metastore_service_name"}}"
3+
location = "us-central1"
4+
tier = "DEVELOPER"
5+
}
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
project = google_dataproc_metastore_service.%{service_resource}.project
3+
location = google_dataproc_metastore_service.%{service_resource}.location
4+
service_id = google_dataproc_metastore_service.%{service_resource}.service_id
5+
database = "%{database}"

0 commit comments

Comments
 (0)