################################################################################
# general configurations 
################################################################################
variable "region" {
  description = "aws region name"
  type        = string
  default     = "ap-southeast-1"
}

# centos ami id reference list: https://wiki.centos.org/Cloud/AWS
variable "ami_id" {
  description = "ami id for centos"
  type        = map
  default     = {
    "us-east-2" =  "ami-00f8e2c955f7ffa9b"
    "us-east-1" =  "ami-00e87074e52e6c9f9"
    "us-west-1" =  "ami-08d2d8b00f270d03b"
    "us-west-2" =  "ami-0686851c4e7b1a8e1"
    "af-south-1" =  "ami-0b761332115c38669"
    "ap-east-1" =  "ami-09611bd6fa5dd0e3d"
    "ap-south-1" =  "ami-0ffc7af9c06de0077"
    "ap-northeast-1" =  "ami-0ddea5e0f69c193a4"
    "ap-northeast-2" =  "ami-0e4214f08b51e23cc"
    "ap-southeast-1" =  "ami-0adfdaea54d40922b"
    "ap-southeast-2" =  "ami-03d56f451ca110e99"
    "ca-central-1" =  "ami-0a7c5b189b6460115"
    "eu-central-1" =  "ami-08b6d44b4f6f7b279"
    "eu-west-1" =  "ami-04f5641b0d178a27a"
    "eu-west-2" =  "ami-0b22fcaf3564fb0c9"
    "eu-west-3" =  "ami-072ec828dae86abe5"
    "eu-south-1" =  "ami-0fe3899b62205176a"
    "eu-north-1" =  "ami-0358414bac2039369"
    "me-south-1" =  "ami-0ac17dcdd6f6f4eb6"
    "sa-east-1" =  "ami-02334c45dd95ca1fc"
  }
}

################################################################################
# sever configurations 
################################################################################
variable "jump_instance_type" {
  description = "instance type for the jump machine"
  type        = string
  default     = "c5.large"
}

variable "jump_instance_disk_size" {
  description = "disk size for the jump machine"
  type        = number
  default     = 20 
}

variable "pd_instance_type" {
  description = "instance type for the pd machine"
  type        = string
  default     = "m5.large"
}

variable "pd_instance_disk_size" {
  description = "disk size for the pd machine"
  type        = number
  default     = 20 
}

variable "pd_instance_number" {
  description = "number of PD instances in the cluster"
  type        = number
  default     = 3 
}

variable "tidb_instance_type" {
  description = "instance type for the tidb machine"
  type        = string
  default     = "c5.large"
}

variable "tidb_instance_disk_size" {
  description = "disk size for the tidb machine"
  type        = number
  default     = 20 
}

variable "tidb_instance_number" {
  description = "number of TiDB instances in the cluster"
  type        = number
  default     = 1 
}

variable "tidb_instance_number_scaleout" {
  description = "number of TiDB instances to be scaled out in the cluster"
  type        = number
  default     = 0 
}

variable "tikv_instance_type" {
  description = "instance type for the tikv machine"
  type        = string
  default     = "r5.large"
}

variable "tikv_instance_disk_size" {
  description = "disk size for the tikv machine"
  type        = number
  default     = 20 
}

variable "tikv_ebs_iops" {
  description = "IOPS of tikv's EBS"
  type        = number
  default     = 3000 
}

variable "tikv_ebs_throughput" {
  description = "Throughput of tikv's EBS"
  type        = number
  default     = 125 
}

variable "tikv_instance_number" {
  description = "number of TiKV instances in the cluster"
  type        = number
  default     = 3 
}

variable "tikv_instance_number_scaleout" {
  description = "number of TiKV instances to be scaled out in the cluster"
  type        = number
  default     = 0 
}

variable "tiflash_instance_type" {
  description = "instance type for the tiflash machine"
  type        = string
  default     = "m5.large"
}

variable "tiflash_instance_disk_size" {
  description = "disk size for the tiflash machine"
  type        = number
  default     = 20 
}

variable "tiflash_instance_number" {
  description = "number of TiFlash instances in the cluster"
  type        = number
  default     = 0 
}

variable "tiflash_instance_number_scaleout" {
  description = "number of TiFlash instances to be scaled out in the cluster"
  type        = number
  default     = 0 
}

variable "tiup_config_path" {
  description = "path of the tiup configuration template, relative to tidb-demo-aws dir"
  type        = string 
  default     = "tiup/files/deploy.yml.template" 
}
