# 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-dbt-composer-blueprint
  annotations:
    config.kubernetes.io/local-config: "true"
spec:
  info:
    title: terraform-google-dbt-composer-blueprint
    source:
      repo: https://github.com/GoogleCloudPlatform/terraform-google-dbt-composer-blueprint.git
      sourceType: git
    version: 0.0.1
    actuationTool:
      flavor: Terraform
      version: ">= 1.3"
    description: {}
    icon: assets/icon.png
    costEstimate:
      description: The major cost is in Cloud Composer Airflow. Cloud Build, Cloud Storage, Artifact Repository, and BigQuery are all costs that scale up and down with your usage, while Cloud Composer has minimum fixed costs depending on your side. It scales up with more work.
  content:
    examples:
      - name: dbt_job
        location: examples/dbt_job
  interfaces:
    variables:
      - name: bq_location
        description: The BQ location where the datasets will be created
        varType: string
        defaultValue: null
        required: true
      - name: composer_version
        description: Version of Cloud Composer
        varType: string
        defaultValue: composer-2.4.6-airflow-2.6.3
      - name: env_variables
        description: Variables of the airflow environment.
        varType: map(string)
        defaultValue: {}
      - name: gcs_location
        description: The GCS location where the buckets will be created
        varType: string
        defaultValue: null
        required: true
      - name: goog_packaged_solution
        description: Google packaged solution label
        varType: string
        defaultValue: gcp-dbt-composer
      - name: monitoring_dataset
        description: Dataset for monitoring activity
        varType: string
        defaultValue: monitoring
      - name: project_id
        description: The project ID to deploy to
        varType: string
        defaultValue: null
        required: true
      - name: region
        description: The region for Cloud Composer
        varType: string
        defaultValue: null
        required: true
    outputs:
      - name: airflow_dag_gcs_prefix
        description: Airflow GCS DAG prefix
      - name: airflow_gke_cluster
        description: Airflow GKE Cluster
      - name: airflow_uri
        description: Airflow URI
      - name: docs_gcs_bucket
        description: Documentation bucket
      - name: lookerstudio_create_dashboard_url
        description: Looker Studio template dashboard
  requirements:
    roles:
      - level: Project
        roles:
          - roles/owner
    services:
      - cloudresourcemanager.googleapis.com
      - storage-api.googleapis.com
      - serviceusage.googleapis.com
