variable "name_prefix" {
  type        = string
  description = "The prefix name of the objects"
}

variable "name" {
  type        = string
  description = "The name of the cluster"
}

variable "common_tags" {
  type        = map(string)
  description = "Common tags to add for the objects"
  default = {
  }
}

variable "db_subnet_group_name" {
  description = "DB subnet group name"
  type        = string
}

variable "instance_count" {
  description = "Number of reader nodes to create.  If `replica_scale_enable` is `true`, the value of `replica_scale_min` is used instead."
  default     = 1
}

variable "security_groups" {
  description = "A list of Security Group to apply."
  default     = []
}

variable "vpc_id" {
  description = "VPC ID"
}

variable "instance_type" {
  type        = string
  description = "Instance type to use"
}

variable "master_instance_type" {
  type        = string
  description = "Writer instance type to use"
  default     = ""
}

variable "publicly_accessible" {
  description = "Whether the DB should have a public IP address"
  default     = false
}

variable "database_name" {
  description = "Name for an automatically created database on cluster creation"
  default     = ""
}

variable "username" {
  description = "Master DB username"
  default     = null
}

variable "password" {
  description = "Master DB password"
  default     = null
}

variable "final_snapshot_identifier_prefix" {
  description = "The prefix name to use when creating a final snapshot on cluster destroy, appends a random 8 digits to name to ensure it's unique too."
  default     = "final"
}

variable "skip_final_snapshot" {
  description = "Should a final snapshot be created on cluster destroy"
  default     = false
}

variable "deletion_protection" {
  description = "If the DB instance should have deletion protection enabled"
  default     = false
}

variable "backup_retention_period" {
  description = "How long to keep backups for (in days)"
  default     = "30"
}

variable "preferred_backup_window" {
  description = "When to perform DB backups"
  default     = "02:00-03:00"
}

variable "preferred_maintenance_window" {
  description = "When to perform DB maintenance"
  default     = "sun:05:00-sun:06:00"
}

variable "port" {
  description = "The port on which to accept connections"
  default     = ""
}

variable "apply_immediately" {
  description = "Determines whether or not any DB modifications are applied immediately, or during the maintenance window"
  default     = false
}

variable "monitoring_interval" {
  description = "The interval (seconds) between points when Enhanced Monitoring metrics are collected. Set 0 to disable"
  type        = number
  default     = null
}

variable "monitoring_role_arn" {
  description = "The interval (seconds) between points when Enhanced Monitoring metrics are collected"
  type        = string
  default     = null
}

variable "auto_minor_version_upgrade" {
  description = "Determines whether minor engine upgrades will be performed automatically in the maintenance window"
  default     = true
}

variable "db_parameter_group_name" {
  description = "The name of a DB parameter group to use"
  default     = "default.aurora5.6"
}

variable "db_cluster_parameter_group_name" {
  description = "The name of a DB Cluster parameter group to use"
  default     = "default.aurora5.6"
}

variable "snapshot_identifier" {
  description = "DB snapshot to create this database from"
  default     = ""
}

variable "storage_encrypted" {
  description = "Specifies whether the underlying storage layer should be encrypted"
  default     = false
}

variable "kms_key_id" {
  description = "The ARN for the KMS encryption key if one is set to the cluster."
  default     = ""
}

variable "engine" {
  description = "Aurora database engine type, currently aurora, aurora-mysql or aurora-postgresql"
  default     = "aurora"
}

variable "engine_version" {
  description = "Aurora database engine version."
  default     = "5.6.10a"
}

variable "allow_major_version_upgrade" {
  description = "Determines whether major engine upgrades are allowed when changing engine version."
  type        = bool
  default     = false
}

variable "performance_insights_enabled" {
  description = "Specifies whether Performance Insights is enabled or not."
  default     = false
}

variable "performance_insights_kms_key_id" {
  description = "The ARN for the KMS key to encrypt Performance Insights data."
  default     = ""
}

variable "iam_database_authentication_enabled" {
  description = "Specifies whether IAM Database authentication should be enabled or not. Not all versions and instances are supported. Refer to the AWS documentation to see which versions are supported."
  default     = false
}

variable "copy_tags_to_snapshot" {
  description = "Specifies whether Database snapshot will inherit tags from cluster. True by default"
  default     = true
}

variable "enabled_cloudwatch_logs_exports" {
  description = "List of log types to export to cloudwatch"
  type        = list(string)
  default     = []
}

variable "global_cluster_identifier" {
  description = "The global cluster identifier specified on aws_rds_global_cluster"
  default     = null
}

variable "engine_mode" {
  description = "The database engine mode. Valid values: global, parallelquery, provisioned, serverless."
  default     = "provisioned"
}

variable "iam_roles" {
  type        = list(string)
  description = "A List of ARNs for the IAM roles to associate to the RDS Cluster"
  default     = null
}

variable "iam_role_assosiations" {
  type        = map(string)
  description = "Key - feature name, value - ARN for the IAM roles to associate"
  default     = {}
}

variable "availability_zones" {
  type    = list(string)
  default = null
}
