# 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: 'Table'
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/{{databaseId}}/tables/{{name}}'
self_link: 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{name}}'
import_format:
  - 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{name}}'
  - '{{name}}'
exclude_resource: true
timeouts:
  insert_minutes: 2
  update_minutes: 2
  delete_minutes: 2
iam_policy:
  method_name_separator: ':'
  parent_resource_attribute: 'table'
  parent_resource_type: "google_dataproc_metastore_service"
  example_config_body: "templates/terraform/iam/example_config_body/dataproc_metastore_table_template.tf.tmpl"
  import_format:
    - 'projects/{{project}}/locations/{{location}}/services/{{serviceId}}/databases/{{databaseId}}/tables/{{name}}'
    - '{{name}}'
custom_code:
examples:
  - name: 'dataproc_metastore_service_table_iam'
    primary_resource_id: 'dpms_service'
    primary_resource_name: 'fmt.Sprintf("tf-test-metastore-srv-%s", context["random_suffix"]), "testdb", "testtbl"'
parameters:
properties:
  - name: 'name'
    type: String
    description: Dummy property.
    required: true
