# Copyright 2023 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-data-warehouse
  annotations:
    config.kubernetes.io/local-config: "true"
spec:
  info:
    title: terraform-google-bigquery-data-warehouse
    source:
      repo: https://github.com/terraform-google-modules/terraform-google-bigquery
      sourceType: git
      dir: /modules/data_warehouse
    version: 7.0.0
    actuationTool:
      flavor: Terraform
      version: ">= 0.13"
    description: {}
  content:
    documentation:
      - title: Create a Data Warehouse
        url: https://cloud.google.com/architecture/big-data-analytics/data-warehouse
      - title: Learn about BigQuery
        url: https://cloud.google.com/bigquery/docs/introduction
    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: deletion_protection
        description: Whether or not to protect GCS resources from deletion when solution is modified or changed.
        varType: string
        defaultValue: true
      - name: enable_apis
        description: Whether or not to enable underlying apis in this solution.
        varType: string
        defaultValue: true
      - name: force_destroy
        description: Whether or not to protect BigQuery resources from deletion when solution is modified or changed.
        varType: string
        defaultValue: false
      - name: labels
        description: A map of labels to apply to contained resources.
        varType: map(string)
        defaultValue:
          data-warehouse: true
      - name: project_id
        description: Google Cloud Project ID
        varType: string
        defaultValue: null
        required: true
      - name: region
        description: Google Cloud Region
        varType: string
        defaultValue: null
        required: true
      - name: text_generation_model_name
        description: Name of the BigQuery ML GenAI remote model that connects to the LLM used for text generation
        varType: string
        defaultValue: text_generate_model
    outputs:
      - name: bigquery_editor_url
        description: The URL to launch the BigQuery editor with the sample query procedure opened
      - name: ds_friendly_name
        description: Dataset name
      - name: lookerstudio_report_url
        description: The URL to create a new Looker Studio report displays a sample dashboard for the e-commerce data analysis
      - name: neos_tutorial_url
        description: The URL to launch the in-console tutorial for the EDW solution
      - name: raw_bucket
        description: Raw bucket name
  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
