# Copyright 2024 Google LLC
#
# 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.

apiVersion: blueprints.cloud.google.com/v1alpha1
kind: BlueprintMetadata
metadata:
  name: terraform-google-bigquery-scheduled-queries
  annotations:
    config.kubernetes.io/local-config: "true"
spec:
  info:
    title: BigQuery Scheduled Queries
    source:
      repo: https://github.com/terraform-google-modules/terraform-google-bigquery
      sourceType: git
      dir: /modules/scheduled_queries
    version: 8.1.0
    actuationTool:
      flavor: Terraform
      version: ">= 1.3"
    description: {}
  content:
    examples:
      - name: basic_bq
        location: examples/basic_bq
      - name: basic_view
        location: examples/basic_view
      - name: data_warehouse
        location: examples/data_warehouse
      - name: multiple_tables
        location: examples/multiple_tables
      - name: scheduled_queries
        location: examples/scheduled_queries
  interfaces:
    variables:
      - name: project_id
        description: The project where scheduled queries are created
        varType: string
        required: true
      - name: queries
        description: Data transfer configuration for creating scheduled queries
        varType: list(any)
        required: true
    outputs:
      - name: query_names
        description: The resource names of the transfer config
  requirements:
    roles:
      - level: Project
        roles:
          - roles/bigquery.admin
          - roles/cloudkms.cryptoKeyEncrypterDecrypter
          - roles/owner
    services:
      - cloudkms.googleapis.com
      - cloudresourcemanager.googleapis.com
      - bigquery.googleapis.com
      - bigquerystorage.googleapis.com
      - bigqueryconnection.googleapis.com
      - serviceusage.googleapis.com
      - iam.googleapis.com
    providerVersions:
      - source: hashicorp/google
        version: ">= 5.39, < 7"
