#!/usr/bin/env bash
set -euo pipefail

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

export QOS="production"

cat <<EOF
landscape:
  name: staging
  domain: staging.shared.aws.tidbcloud.com
$(resource_base 2)
  cluster:
    kubeconfig: ./kubeconfig
    networks:
      nodes: "10.0.0.0/17"
      pods: "10.0.128.0/17"
      services: "172.20.0.0/16"
  etcd:
    backupBucket: $(garden_output staging backupBucketName)
    serviceAccount: $(garden_output staging etcdServiceAccount)
  iaas:
    - name: base
      type: aws
      region: us-west-2
      mode: soil
      zones:
        - us-west-2a
        - us-west-2b
        - us-west-2c
      credentials:
        accessKeyID: ""
        secretAccessKey: ""
      cluster:
        networks:
          nodes: "192.168.0.0/16"
          pods: "10.0.0.0/16"
          services: "172.20.0.0/16"
        kubeconfig:
$(eks_kubeconfig us-west-2 staging-base-us-west-2 10)

    - name: aws-us-west-2
      zones:
        - us-west2-c
        - us-west2-b
        - us-west2-a
$(eks_seed_spec us-west-2 staging-seed-us-west-2 6)

    - name: gcp-us-west1
      zones:
        - us-west1-a
        - us-west1-b
        - us-west1-c
$(gke_seed_spec staging us-west1 pingcap-gardener staging-seed-us-west1-73cb72c 6)

    - name: gcp-asia-northeast1
      zones:
        - asia-northeast1-a
        - asia-northeast1-b
        - asia-northeast1-c
$(gke_seed_spec staging asia-northeast1 pingcap-gardener staging-seed-asia-northeast1-83d8caa 6)

    - name: aws-ap-northeast-2
      zones:
        - ap-northeast-2a
        - ap-northeast-2b
        - ap-northeast-2c
        - ap-northeast-2d
$(eks_seed_spec ap-northeast-2 staging-seed-ap-northeast-2 6)

    - name: gcp-asia-southeast1
      zones:
        - asia-southeast1-a
        - asia-southeast1-b
        - asia-southeast1-c
$(gke_seed_spec staging asia-southeast1 pingcap-gardener staging-seed-asia-southeast1-b7bc5b9 6)

    - name: gcp-us-central1
      zones:
        - us-central1-a
        - us-central1-b
        - us-central1-c
        - us-central1-f
$(gke_seed_spec staging us-central1 pingcap-gardener staging-seed-us-central1-6159679 6)

    - name: aws-us-east-1
      zones:
        - us-east-1a
        - us-east-1b
        - us-east-1c
        - us-east-1d
        - us-east-1e
        - us-east-1f
$(eks_seed_spec us-east-1 staging-seed-us-east-1 6)

    - name: aws-ap-northeast-1
      zones:
        - ap-northeast-1a
        - ap-northeast-1c
        - ap-northeast-1d
$(eks_seed_spec ap-northeast-1 staging-seed-ap-northeast-1 6)

    - name: aws-ap-southeast-1
      zones:
        - ap-southeast-1a
        - ap-southeast-1b
        - ap-southeast-1c
$(eks_seed_spec ap-southeast-1 staging-seed-ap-southeast-1 6)

    - name: aws-eu-central-1
      zones:
        - eu-central-1a
        - eu-central-1b
        - eu-central-1c
$(eks_seed_spec eu-central-1 staging-seed-eu-central-1 6)

    - name: gcp-asia-east1
      zones:
        - asia-east1-a
        - asia-east1-b
        - asia-east1-c
$(gke_seed_spec staging asia-east1 pingcap-gardener staging-seed-asia-east1-27722c2 6)

  cert-manager:
    email: cloud@pingcap.com
  dns:
    type: aws-route53
    roleArn: $(garden_output staging baseDnsControllerRole)
    credentials:
      accessKeyID: ""
      secretAccessKey: ""
EOF
