Skip to content

Commit

Permalink
Add Dataproc Metastore Database Resource for IAM support
Browse files Browse the repository at this point in the history
  • Loading branch information
Noremac201 committed Mar 11, 2025
1 parent 9156ea5 commit d3657d8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
50 changes: 50 additions & 0 deletions mmv1/products/metastore/Database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2025 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: 'Database'
description: |
Only used to generate IAM resources
# This resource is only used to generate IAM resources. They do not correspond to real
# GCP resources, and should not be used to generate anything other than IAM support.
docs:
base_url: 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
self_link: 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
exclude_resource: true
timeouts:
insert_minutes: 2
update_minutes: 2
delete_minutes: 2
iam_policy:
method_name_separator: ':'
parent_resource_attribute: 'database'
parent_resource_type: "google_dataproc_metastore_service"
example_config_body: "templates/terraform/iam/example_config_body/dataproc_metastore_database_template.tf.tmpl"
import_format:
- '{{name}}'
- 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{name}}'
custom_code:
examples:
- name: 'dataproc_metastore_service_basic'
primary_resource_id: 'service'
primary_resource_name: 'fmt.Sprintf("tf-test-metastore-srv%s", context["random_suffix"])'
test_vars_overrides:
database: '"default"'
service_resource: '"service"'
vars:
metastore_service_name: 'service-id'
parameters:
properties:
- name: 'name'
type: String
description: Dummy property.
required: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"
tier = "DEVELOPER"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

project = google_dataproc_metastore_service.%{service_resource}.project
location = google_dataproc_metastore_service.%{service_resource}.location
service_id = google_dataproc_metastore_service.%{service_resource}.service_id
database = "%{database}"

0 comments on commit d3657d8

Please sign in to comment.