# Copyright 2025 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-cloud-spanner
  annotations:
    config.kubernetes.io/local-config: "true"
spec:
  info:
    title: terraform-google-cloud-spanner
    source:
      repo: https://github.com/GoogleCloudPlatform/terraform-google-cloud-spanner
      sourceType: git
      dir: /modules/schedule_spanner_backup
    version: 1.1.3
    actuationTool:
      flavor: Terraform
      version: ">= 1.3"
    description: {}
    icon: assets/icon.png
  content:
    examples:
      - name: example_with_backup
        location: examples/example_with_backup
      - name: example_with_kms
        location: examples/example_with_kms
      - name: simple_example
        location: examples/simple_example
  interfaces:
    variables:
      - name: project_id
        description: The project ID to deploy to
        varType: string
        required: true
      - name: instance_name
        description: The name of the Spanner instance
        varType: string
        required: true
      - name: database_name
        description: The name of the Spanner database
        varType: string
        required: true
      - name: backup_schedule_name
        description: The name of the backup schedule
        varType: string
        defaultValue: backup-schedule
      - name: cron_spec_text
        description: The CRON spec text
        varType: string
        defaultValue: 0 2 * * *
      - name: retention_duration
        description: The duration for which the backup should be retained.
        varType: string
        defaultValue: 86400s
      - name: use_full_backup_spec
        description: Whether to use full backup specification.
        varType: bool
        defaultValue: true
      - name: use_incremental_backup_spec
        description: Whether to use incremental backup specification.
        varType: bool
        defaultValue: false
    outputs:
      - name: spanner_schedule_backup_id
        description: Spanner Schedule Backup ID
        type: string
  requirements:
    roles:
      - level: Project
        roles:
          - roles/owner
    services:
      - iam.googleapis.com
      - cloudresourcemanager.googleapis.com
      - storage-api.googleapis.com
      - serviceusage.googleapis.com
      - workflows.googleapis.com
      - cloudscheduler.googleapis.com
      - spanner.googleapis.com
      - pubsub.googleapis.com
      - logging.googleapis.com
      - storage.googleapis.com
      - appengine.googleapis.com
      - cloudkms.googleapis.com
    providerVersions:
      - source: hashicorp/google
        version: ">= 6.1, < 7"
      - source: hashicorp/google-beta
        version: ">= 6.1, < 7"
      - source: hashicorp/null
        version: ~> 3.1
      - source: hashicorp/random
        version: ~> 3.1
